entities listlengths 1 8.61k | max_stars_repo_path stringlengths 7 172 | max_stars_repo_name stringlengths 5 89 | max_stars_count int64 0 82k | content stringlengths 14 1.05M | id stringlengths 2 6 | new_content stringlengths 15 1.05M | modified bool 1 class | references stringlengths 29 1.05M |
|---|---|---|---|---|---|---|---|---|
[
{
"context": "zoom: 13\n styled_map.addStyle\n styledMapName:\"Volta\",\n styles: style,\n mapTypeId: \"volta\"\n sty",
"end": 2265,
"score": 0.957290530204773,
"start": 2260,
"tag": "NAME",
"value": "Volta"
}
] | public/template/src/resources/js/dashboard/views/maps/google.coffee | georgi-dev/dmr-academy | 0 | $(document).ready ->
'use strict'
style = [
{
'featureType': 'all'
'elementType': 'labels.text.fill'
'stylers': [
{ 'color': colors['white'] }
]
}
{
'featureType': 'all'
'elementType': 'labels.text.stroke'
'stylers': [
{ 'visibility': 'on' }
{ 'color': colors['black'] }
{ 'lightness': 0 }
]
}
{
'featureType': 'all'
'elementType': 'labels.icon'
'stylers': [ { 'visibility': 'off' } ]
}
{
'featureType': 'administrative'
'elementType': 'geometry.fill'
'stylers': [
{ 'color': colors['concrete'] }
{ 'lightness': 20 }
]
}
{
'featureType': 'administrative'
'elementType': 'geometry.stroke'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'weight': 1.2 }
]
}
{
'featureType': 'landscape'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['concrete'] }
]
}
{
'featureType': 'poi'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['black'] }
]
}
{
'featureType': 'road'
'elementType': 'geometry.fill'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
]
}
{
'featureType': 'road.highway'
'elementType': 'geometry.stroke'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'lightness': '20' }
]
}
{
'featureType': 'transit'
'elementType': 'geometry'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'lightness': 19 }
]
}
{
'featureType': 'water'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['asphalt'] }
]
}
]
###################################
default_map = new GMaps
el: '#gmaps-default'
lat: -33.8688
lng: 151.2093
zoom: 13
###################################
styled_map = new GMaps
el: '#gmaps-styled'
lat: -33.8688
lng: 151.2093
zoom: 13
styled_map.addStyle
styledMapName:"Volta",
styles: style,
mapTypeId: "volta"
styled_map.setStyle "volta"
###################################
return
| 29026 | $(document).ready ->
'use strict'
style = [
{
'featureType': 'all'
'elementType': 'labels.text.fill'
'stylers': [
{ 'color': colors['white'] }
]
}
{
'featureType': 'all'
'elementType': 'labels.text.stroke'
'stylers': [
{ 'visibility': 'on' }
{ 'color': colors['black'] }
{ 'lightness': 0 }
]
}
{
'featureType': 'all'
'elementType': 'labels.icon'
'stylers': [ { 'visibility': 'off' } ]
}
{
'featureType': 'administrative'
'elementType': 'geometry.fill'
'stylers': [
{ 'color': colors['concrete'] }
{ 'lightness': 20 }
]
}
{
'featureType': 'administrative'
'elementType': 'geometry.stroke'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'weight': 1.2 }
]
}
{
'featureType': 'landscape'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['concrete'] }
]
}
{
'featureType': 'poi'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['black'] }
]
}
{
'featureType': 'road'
'elementType': 'geometry.fill'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
]
}
{
'featureType': 'road.highway'
'elementType': 'geometry.stroke'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'lightness': '20' }
]
}
{
'featureType': 'transit'
'elementType': 'geometry'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'lightness': 19 }
]
}
{
'featureType': 'water'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['asphalt'] }
]
}
]
###################################
default_map = new GMaps
el: '#gmaps-default'
lat: -33.8688
lng: 151.2093
zoom: 13
###################################
styled_map = new GMaps
el: '#gmaps-styled'
lat: -33.8688
lng: 151.2093
zoom: 13
styled_map.addStyle
styledMapName:"<NAME>",
styles: style,
mapTypeId: "volta"
styled_map.setStyle "volta"
###################################
return
| true | $(document).ready ->
'use strict'
style = [
{
'featureType': 'all'
'elementType': 'labels.text.fill'
'stylers': [
{ 'color': colors['white'] }
]
}
{
'featureType': 'all'
'elementType': 'labels.text.stroke'
'stylers': [
{ 'visibility': 'on' }
{ 'color': colors['black'] }
{ 'lightness': 0 }
]
}
{
'featureType': 'all'
'elementType': 'labels.icon'
'stylers': [ { 'visibility': 'off' } ]
}
{
'featureType': 'administrative'
'elementType': 'geometry.fill'
'stylers': [
{ 'color': colors['concrete'] }
{ 'lightness': 20 }
]
}
{
'featureType': 'administrative'
'elementType': 'geometry.stroke'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'weight': 1.2 }
]
}
{
'featureType': 'landscape'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['concrete'] }
]
}
{
'featureType': 'poi'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['black'] }
]
}
{
'featureType': 'road'
'elementType': 'geometry.fill'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
]
}
{
'featureType': 'road.highway'
'elementType': 'geometry.stroke'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'lightness': '20' }
]
}
{
'featureType': 'transit'
'elementType': 'geometry'
'stylers': [
{ 'color': hexBlend(colors['primary'], colors['secondary'], 0.5) }
{ 'lightness': 19 }
]
}
{
'featureType': 'water'
'elementType': 'geometry'
'stylers': [
{ 'color': colors['asphalt'] }
]
}
]
###################################
default_map = new GMaps
el: '#gmaps-default'
lat: -33.8688
lng: 151.2093
zoom: 13
###################################
styled_map = new GMaps
el: '#gmaps-styled'
lat: -33.8688
lng: 151.2093
zoom: 13
styled_map.addStyle
styledMapName:"PI:NAME:<NAME>END_PI",
styles: style,
mapTypeId: "volta"
styled_map.setStyle "volta"
###################################
return
|
[
{
"context": "#\n mixin-js-auto-memory.js 0.1.5\n (c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/mixin/\n License: M",
"end": 67,
"score": 0.9998567700386047,
"start": 53,
"tag": "NAME",
"value": "Kevin Malakoff"
},
{
"context": "js 0.1.5\n (c) 2011, 2012 Kevin Malak... | src/lib/mixin-js-auto-memory.coffee | kmalakoff/mixin | 14 | ###
mixin-js-auto-memory.js 0.1.5
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/mixin/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Mixin.Core
###
root = @
Mixin.AutoMemory or= {}
class Mixin.AutoMemory.Property
constructor: (@owner) ->
# accepts:
# key
# fn_or_fn_name args
# [key1, key2, etc]
# [[key1, fn_or_fn_name1 args1], key2, etc]
setArgs: ->
throw new Error("Mixin.AutoMemory: missing key") if not arguments.length
@args = Array.prototype.slice.call(arguments)
return this if not Mixin.DEBUG
# [key1, key2, etc] or [[key1, fn_or_fn_name1 args1], key2, etc]
if _.isArray(@args[0])
@_validateEntry(key_or_array) for key_or_array in @args
# key or fn_or_fn_name args
else
@_validateEntry(@args)
return
destroy: ->
# [key1, key2, etc] or [[key1, fn_or_fn_name1 args1], key2, etc]
if _.isArray(@args[0])
@_destroyEntry(key_or_array) for key_or_array in @args
# key or fn_or_fn_name args
else
@_destroyEntry(@args)
return
_validateEntry: (entry) ->
key = entry[0]; fn_ref = if (entry.length>1) then entry[1] else undefined
throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, key)
throw new Error("Mixin.AutoMemory: unexpected function reference for property '#{key}' on '#{_.classOf(@owner)}'") if fn_ref and not (_.isFunction(fn_ref) or _.isString(fn_ref))
_destroyEntry: (entry) ->
key = entry[0]; fn_ref = if (entry.length>1) then entry[1] else undefined
if not fn_ref
keypath_owner = _.keypathValueOwner(@owner, key)
throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not keypath_owner
keypath_owner[key] = null
return;
value = _.keypath(@owner, key)
return if not value
if (_.isFunction(fn_ref))
fn_ref.apply(@owner,[value].concat(if entry.length>2 then entry.slice(2) else []))
else
# a function
if _.isFunction(value[fn_ref])
value[fn_ref].apply(value, if entry.length>2 then entry.slice(2) else [])
# properties array
else
@_destroyEntry([property]) for property in entry.slice(1)
_.keypath(@owner, key, null)
class Mixin.AutoMemory.WrappedProperty
constructor: (@owner, @key, @fn_ref, @wrapper) ->
if @fn_ref and _.isArray(@fn_ref)
throw new Error("Mixin.AutoMemory: unexpected function reference") if Mixin.DEBUG and not @fn_ref.length
@args=@fn_ref.splice(1); @fn_ref=@fn_ref[0]
return this if not Mixin.DEBUG
throw new Error("Mixin.AutoMemory: missing key") if not @key
if _.isArray(@key)
(throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, key)) for key in @key
else
throw new Error("Mixin.AutoMemory: property '#{@key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, @key)
throw new Error("Mixin.AutoMemory: unexpected function reference") if @fn_ref and not (_.isFunction(@fn_ref) or _.isString(@fn_ref))
throw new Error("Mixin.AutoMemory: missing wrapper") if not @wrapper
destroy: ->
if _.isArray(@key) then (@_destroyKey(key) for key in @key) else @_destroyKey(@key)
return
_destroyKey: (key) ->
(_.keypath(@owner, key, null); return) if not @fn_ref
value = _.keypath(@owner, key)
return if not value
wrapped_value = root.$(value)
if (_.isFunction(@fn_ref))
@fn_ref.apply(@owner,[wrapped_value].concat(if @args then @args.slice() else []))
else
throw new Error("Mixin.AutoMemory: function '#{@fn_ref}' missing for wrapped property '#{key}' on '#{_.classOf(@owner)}'") if Mixin.DEBUG and not _.isFunction(wrapped_value[@fn_ref])
wrapped_value[@fn_ref].apply(wrapped_value, @args)
_.keypath(@owner, key, null)
class Mixin.AutoMemory.Function
constructor: (@object, @fn_ref, @args) ->
return this if not Mixin.DEBUG
throw new Error("Mixin.AutoMemory: missing fn_ref") if not @fn_ref
throw new Error("Mixin.AutoMemory: unexpected function reference") if not _.isFunction(@fn_ref) and not (@object and _.isString(@fn_ref) and _.isFunction(@object[@fn_ref]))
destroy: ->
(@fn_ref.apply(null, @args); return) if not @object
(@object[@fn_ref].apply(@object, @args); return) if not _.isFunction(@fn_ref)
@fn_ref.apply(@object,[@object].concat(if @args then @args.slice() else []))
Mixin.AutoMemory._mixin_info =
mixin_name: 'AutoMemory'
initialize: -> Mixin.instanceData(this, 'AutoMemory', [])
destroy: ->
# call the auto clean ups
callbacks = Mixin.instanceData(this, 'AutoMemory'); Mixin.instanceData(this, 'AutoMemory', [])
callback.destroy() for callback in callbacks
return
mixin_object: {
autoProperty: (key, fn_ref) ->
auto_property = new Mixin.AutoMemory.Property(this); auto_property.setArgs.apply(auto_property, arguments)
Mixin.instanceData(this, 'AutoMemory').push(auto_property)
return this
autoWrappedProperty: (key, fn_ref, wrapper) ->
wrapper or= root.$
Mixin.instanceData(this, 'AutoMemory').push(new Mixin.AutoMemory.WrappedProperty(this, key, fn_ref, wrapper))
return this
autoFunction: (object, fn_ref) ->
Mixin.instanceData(this, 'AutoMemory').push(new Mixin.AutoMemory.Function(object, fn_ref, Array.prototype.slice.call(arguments, 2)))
return this
}
####################################################
# Make mixin available
####################################################
Mixin.registerMixin(Mixin.AutoMemory._mixin_info) | 1651 | ###
mixin-js-auto-memory.js 0.1.5
(c) 2011, 2012 <NAME> - http://kmalakoff.github.com/mixin/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Mixin.Core
###
root = @
Mixin.AutoMemory or= {}
class Mixin.AutoMemory.Property
constructor: (@owner) ->
# accepts:
# key
# fn_or_fn_name args
# [key1, key2, etc]
# [[key1, fn_or_fn_name1 args1], key2, etc]
setArgs: ->
throw new Error("Mixin.AutoMemory: missing key") if not arguments.length
@args = Array.prototype.slice.call(arguments)
return this if not Mixin.DEBUG
# [key1, key2, etc] or [[key1, fn_or_fn_name1 args1], key2, etc]
if _.isArray(@args[0])
@_validateEntry(key_or_array) for key_or_array in @args
# key or fn_or_fn_name args
else
@_validateEntry(@args)
return
destroy: ->
# [key1, key2, etc] or [[key1, fn_or_fn_name1 args1], key2, etc]
if _.isArray(@args[0])
@_destroyEntry(key_or_array) for key_or_array in @args
# key or fn_or_fn_name args
else
@_destroyEntry(@args)
return
_validateEntry: (entry) ->
key = entry[0]; fn_ref = if (entry.length>1) then entry[1] else undefined
throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, key)
throw new Error("Mixin.AutoMemory: unexpected function reference for property '#{key}' on '#{_.classOf(@owner)}'") if fn_ref and not (_.isFunction(fn_ref) or _.isString(fn_ref))
_destroyEntry: (entry) ->
key = entry[0]; fn_ref = if (entry.length>1) then entry[1] else undefined
if not fn_ref
keypath_owner = _.keypathValueOwner(@owner, key)
throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not keypath_owner
keypath_owner[key] = null
return;
value = _.keypath(@owner, key)
return if not value
if (_.isFunction(fn_ref))
fn_ref.apply(@owner,[value].concat(if entry.length>2 then entry.slice(2) else []))
else
# a function
if _.isFunction(value[fn_ref])
value[fn_ref].apply(value, if entry.length>2 then entry.slice(2) else [])
# properties array
else
@_destroyEntry([property]) for property in entry.slice(1)
_.keypath(@owner, key, null)
class Mixin.AutoMemory.WrappedProperty
constructor: (@owner, @key, @fn_ref, @wrapper) ->
if @fn_ref and _.isArray(@fn_ref)
throw new Error("Mixin.AutoMemory: unexpected function reference") if Mixin.DEBUG and not @fn_ref.length
@args=@fn_ref.splice(1); @fn_ref=@fn_ref[0]
return this if not Mixin.DEBUG
throw new Error("Mixin.AutoMemory: missing key") if not @key
if _.isArray(@key)
(throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, key)) for key in @key
else
throw new Error("Mixin.AutoMemory: property '#{@key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, @key)
throw new Error("Mixin.AutoMemory: unexpected function reference") if @fn_ref and not (_.isFunction(@fn_ref) or _.isString(@fn_ref))
throw new Error("Mixin.AutoMemory: missing wrapper") if not @wrapper
destroy: ->
if _.isArray(@key) then (@_destroyKey(key) for key in @key) else @_destroyKey(@key)
return
_destroyKey: (key) ->
(_.keypath(@owner, key, null); return) if not @fn_ref
value = _.keypath(@owner, key)
return if not value
wrapped_value = root.$(value)
if (_.isFunction(@fn_ref))
@fn_ref.apply(@owner,[wrapped_value].concat(if @args then @args.slice() else []))
else
throw new Error("Mixin.AutoMemory: function '#{@fn_ref}' missing for wrapped property '#{key}' on '#{_.classOf(@owner)}'") if Mixin.DEBUG and not _.isFunction(wrapped_value[@fn_ref])
wrapped_value[@fn_ref].apply(wrapped_value, @args)
_.keypath(@owner, key, null)
class Mixin.AutoMemory.Function
constructor: (@object, @fn_ref, @args) ->
return this if not Mixin.DEBUG
throw new Error("Mixin.AutoMemory: missing fn_ref") if not @fn_ref
throw new Error("Mixin.AutoMemory: unexpected function reference") if not _.isFunction(@fn_ref) and not (@object and _.isString(@fn_ref) and _.isFunction(@object[@fn_ref]))
destroy: ->
(@fn_ref.apply(null, @args); return) if not @object
(@object[@fn_ref].apply(@object, @args); return) if not _.isFunction(@fn_ref)
@fn_ref.apply(@object,[@object].concat(if @args then @args.slice() else []))
Mixin.AutoMemory._mixin_info =
mixin_name: 'AutoMemory'
initialize: -> Mixin.instanceData(this, 'AutoMemory', [])
destroy: ->
# call the auto clean ups
callbacks = Mixin.instanceData(this, 'AutoMemory'); Mixin.instanceData(this, 'AutoMemory', [])
callback.destroy() for callback in callbacks
return
mixin_object: {
autoProperty: (key, fn_ref) ->
auto_property = new Mixin.AutoMemory.Property(this); auto_property.setArgs.apply(auto_property, arguments)
Mixin.instanceData(this, 'AutoMemory').push(auto_property)
return this
autoWrappedProperty: (key, fn_ref, wrapper) ->
wrapper or= root.$
Mixin.instanceData(this, 'AutoMemory').push(new Mixin.AutoMemory.WrappedProperty(this, key, fn_ref, wrapper))
return this
autoFunction: (object, fn_ref) ->
Mixin.instanceData(this, 'AutoMemory').push(new Mixin.AutoMemory.Function(object, fn_ref, Array.prototype.slice.call(arguments, 2)))
return this
}
####################################################
# Make mixin available
####################################################
Mixin.registerMixin(Mixin.AutoMemory._mixin_info) | true | ###
mixin-js-auto-memory.js 0.1.5
(c) 2011, 2012 PI:NAME:<NAME>END_PI - http://kmalakoff.github.com/mixin/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Mixin.Core
###
root = @
Mixin.AutoMemory or= {}
class Mixin.AutoMemory.Property
constructor: (@owner) ->
# accepts:
# key
# fn_or_fn_name args
# [key1, key2, etc]
# [[key1, fn_or_fn_name1 args1], key2, etc]
setArgs: ->
throw new Error("Mixin.AutoMemory: missing key") if not arguments.length
@args = Array.prototype.slice.call(arguments)
return this if not Mixin.DEBUG
# [key1, key2, etc] or [[key1, fn_or_fn_name1 args1], key2, etc]
if _.isArray(@args[0])
@_validateEntry(key_or_array) for key_or_array in @args
# key or fn_or_fn_name args
else
@_validateEntry(@args)
return
destroy: ->
# [key1, key2, etc] or [[key1, fn_or_fn_name1 args1], key2, etc]
if _.isArray(@args[0])
@_destroyEntry(key_or_array) for key_or_array in @args
# key or fn_or_fn_name args
else
@_destroyEntry(@args)
return
_validateEntry: (entry) ->
key = entry[0]; fn_ref = if (entry.length>1) then entry[1] else undefined
throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, key)
throw new Error("Mixin.AutoMemory: unexpected function reference for property '#{key}' on '#{_.classOf(@owner)}'") if fn_ref and not (_.isFunction(fn_ref) or _.isString(fn_ref))
_destroyEntry: (entry) ->
key = entry[0]; fn_ref = if (entry.length>1) then entry[1] else undefined
if not fn_ref
keypath_owner = _.keypathValueOwner(@owner, key)
throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not keypath_owner
keypath_owner[key] = null
return;
value = _.keypath(@owner, key)
return if not value
if (_.isFunction(fn_ref))
fn_ref.apply(@owner,[value].concat(if entry.length>2 then entry.slice(2) else []))
else
# a function
if _.isFunction(value[fn_ref])
value[fn_ref].apply(value, if entry.length>2 then entry.slice(2) else [])
# properties array
else
@_destroyEntry([property]) for property in entry.slice(1)
_.keypath(@owner, key, null)
class Mixin.AutoMemory.WrappedProperty
constructor: (@owner, @key, @fn_ref, @wrapper) ->
if @fn_ref and _.isArray(@fn_ref)
throw new Error("Mixin.AutoMemory: unexpected function reference") if Mixin.DEBUG and not @fn_ref.length
@args=@fn_ref.splice(1); @fn_ref=@fn_ref[0]
return this if not Mixin.DEBUG
throw new Error("Mixin.AutoMemory: missing key") if not @key
if _.isArray(@key)
(throw new Error("Mixin.AutoMemory: property '#{key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, key)) for key in @key
else
throw new Error("Mixin.AutoMemory: property '#{@key}' doesn't exist on '#{_.classOf(@owner)}'") if not _.keypathExists(@owner, @key)
throw new Error("Mixin.AutoMemory: unexpected function reference") if @fn_ref and not (_.isFunction(@fn_ref) or _.isString(@fn_ref))
throw new Error("Mixin.AutoMemory: missing wrapper") if not @wrapper
destroy: ->
if _.isArray(@key) then (@_destroyKey(key) for key in @key) else @_destroyKey(@key)
return
_destroyKey: (key) ->
(_.keypath(@owner, key, null); return) if not @fn_ref
value = _.keypath(@owner, key)
return if not value
wrapped_value = root.$(value)
if (_.isFunction(@fn_ref))
@fn_ref.apply(@owner,[wrapped_value].concat(if @args then @args.slice() else []))
else
throw new Error("Mixin.AutoMemory: function '#{@fn_ref}' missing for wrapped property '#{key}' on '#{_.classOf(@owner)}'") if Mixin.DEBUG and not _.isFunction(wrapped_value[@fn_ref])
wrapped_value[@fn_ref].apply(wrapped_value, @args)
_.keypath(@owner, key, null)
class Mixin.AutoMemory.Function
constructor: (@object, @fn_ref, @args) ->
return this if not Mixin.DEBUG
throw new Error("Mixin.AutoMemory: missing fn_ref") if not @fn_ref
throw new Error("Mixin.AutoMemory: unexpected function reference") if not _.isFunction(@fn_ref) and not (@object and _.isString(@fn_ref) and _.isFunction(@object[@fn_ref]))
destroy: ->
(@fn_ref.apply(null, @args); return) if not @object
(@object[@fn_ref].apply(@object, @args); return) if not _.isFunction(@fn_ref)
@fn_ref.apply(@object,[@object].concat(if @args then @args.slice() else []))
Mixin.AutoMemory._mixin_info =
mixin_name: 'AutoMemory'
initialize: -> Mixin.instanceData(this, 'AutoMemory', [])
destroy: ->
# call the auto clean ups
callbacks = Mixin.instanceData(this, 'AutoMemory'); Mixin.instanceData(this, 'AutoMemory', [])
callback.destroy() for callback in callbacks
return
mixin_object: {
autoProperty: (key, fn_ref) ->
auto_property = new Mixin.AutoMemory.Property(this); auto_property.setArgs.apply(auto_property, arguments)
Mixin.instanceData(this, 'AutoMemory').push(auto_property)
return this
autoWrappedProperty: (key, fn_ref, wrapper) ->
wrapper or= root.$
Mixin.instanceData(this, 'AutoMemory').push(new Mixin.AutoMemory.WrappedProperty(this, key, fn_ref, wrapper))
return this
autoFunction: (object, fn_ref) ->
Mixin.instanceData(this, 'AutoMemory').push(new Mixin.AutoMemory.Function(object, fn_ref, Array.prototype.slice.call(arguments, 2)))
return this
}
####################################################
# Make mixin available
####################################################
Mixin.registerMixin(Mixin.AutoMemory._mixin_info) |
[
{
"context": "# Copyright (c) 2015 Jesse Grosjean. All rights reserved.\n\nGlobalMouseDown = 0\nGlobal",
"end": 35,
"score": 0.9997739791870117,
"start": 21,
"tag": "NAME",
"value": "Jesse Grosjean"
}
] | atom/packages/foldingtext-for-atom/lib/editor/global-mouse.coffee | prookie/dotfiles-1 | 0 | # Copyright (c) 2015 Jesse Grosjean. All rights reserved.
GlobalMouseDown = 0
GlobalMouseButton = {}
isGlobalMouseDown = ->
GlobalMouseDown > 0
isGlobalLeftMouseDown = ->
GlobalMouseButton[0]
isGlobalWheelMouseDown = ->
GlobalMouseButton[1]
isGlobalRightMouseDown = ->
GlobalMouseButton[2]
handleGlobalMouseDown = (e) ->
GlobalMouseDown++
GlobalMouseButton[e.button] = true
handleGlobalMouseUp = (e) ->
GlobalMouseDown--
GlobalMouseButton[e.button] = false
document.addEventListener 'mousedown', handleGlobalMouseDown, true
document.addEventListener 'mouseup', handleGlobalMouseUp, true
module.exports =
isGlobalMouseDown: isGlobalMouseDown
isGlobalLeftMouseDown: isGlobalLeftMouseDown
isGlobalWheelMouseDown: isGlobalWheelMouseDown
isGlobalRightMouseDown: isGlobalRightMouseDown | 136648 | # Copyright (c) 2015 <NAME>. All rights reserved.
GlobalMouseDown = 0
GlobalMouseButton = {}
isGlobalMouseDown = ->
GlobalMouseDown > 0
isGlobalLeftMouseDown = ->
GlobalMouseButton[0]
isGlobalWheelMouseDown = ->
GlobalMouseButton[1]
isGlobalRightMouseDown = ->
GlobalMouseButton[2]
handleGlobalMouseDown = (e) ->
GlobalMouseDown++
GlobalMouseButton[e.button] = true
handleGlobalMouseUp = (e) ->
GlobalMouseDown--
GlobalMouseButton[e.button] = false
document.addEventListener 'mousedown', handleGlobalMouseDown, true
document.addEventListener 'mouseup', handleGlobalMouseUp, true
module.exports =
isGlobalMouseDown: isGlobalMouseDown
isGlobalLeftMouseDown: isGlobalLeftMouseDown
isGlobalWheelMouseDown: isGlobalWheelMouseDown
isGlobalRightMouseDown: isGlobalRightMouseDown | true | # Copyright (c) 2015 PI:NAME:<NAME>END_PI. All rights reserved.
GlobalMouseDown = 0
GlobalMouseButton = {}
isGlobalMouseDown = ->
GlobalMouseDown > 0
isGlobalLeftMouseDown = ->
GlobalMouseButton[0]
isGlobalWheelMouseDown = ->
GlobalMouseButton[1]
isGlobalRightMouseDown = ->
GlobalMouseButton[2]
handleGlobalMouseDown = (e) ->
GlobalMouseDown++
GlobalMouseButton[e.button] = true
handleGlobalMouseUp = (e) ->
GlobalMouseDown--
GlobalMouseButton[e.button] = false
document.addEventListener 'mousedown', handleGlobalMouseDown, true
document.addEventListener 'mouseup', handleGlobalMouseUp, true
module.exports =
isGlobalMouseDown: isGlobalMouseDown
isGlobalLeftMouseDown: isGlobalLeftMouseDown
isGlobalWheelMouseDown: isGlobalWheelMouseDown
isGlobalRightMouseDown: isGlobalRightMouseDown |
[
{
"context": "{\n user:\n id: 24\n name: 'test user'\n email: 'test.user@guc.edu.eg'\n ",
"end": 2616,
"score": 0.7416966557502747,
"start": 2607,
"tag": "NAME",
"value": "test user"
},
{
"context": " 24\n name: 'test user'\n ... | spec/controllers/login_spec.coffee | ah450/guclink-auth-www | 0 | describe 'LoginController', ->
beforeEach module 'guclinkAuth'
$controller = null
$httpBackend = null
$rootScope = null
$state = null
beforeEach inject (_$controller_, _$httpBackend_, _$rootScope_, _$state_) ->
$controller = _$controller_
$httpBackend = _$httpBackend_
$state = _$state_
$rootScope = _$rootScope_
beforeEach ->
$httpBackend.when('GET', 'http://localhost:3000/api/configurations.json')
.respond({
default_token_exp: 30
})
afterEach inject (_UserAuth_) ->
_UserAuth_.logout()
it 'sets processing to true when submitting', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 401
$scope.submit()
expect($scope.processing).to.be.true
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
it 'sets error for 401', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 401
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
expect($scope.processing).to.be.false
expect($scope.error).to.eql('Invalid email or password')
it 'sets received error for 403', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 403, {message: 'unverified'}
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
expect($scope.processing).to.be.false
expect($scope.error).to.eql('unverified')
it 'transitions to internal error for any other error', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 500
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
$rootScope.$apply()
expect($state.current.name).to.eql('public.internal_error')
it 'transitions to profile page on successfull login', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond(201, {
user:
id: 24
name: 'test user'
email: 'test.user@guc.edu.eg'
verified: true
student: false
super_user: false
full_name: 'Test User'
created_at: '2016-04-08T20:06:45.391Z'
updated_at: '2016-04-08T20:06:45.391Z'
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJPbmxpbmUgSldUIEJ1aWxkZXIiLCJpYXQiOjE0NjAyMDAyMzAsImV4cCI6MTQ5MTczNjIzMCwiYXVkIjoid3d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsIkdpdmVuTmFtZSI6IkpvaG5ueSIsIlN1cm5hbWUiOiJSb2NrZXQiLCJFbWFpbCI6Impyb2NrZXRAZXhhbXBsZS5jb20iLCJSb2xlIjpbIk1hbmFnZXIiLCJQcm9qZWN0IEFkbWluaXN0cmF0b3IiXX0.Q82UHJ8ep8EUYLKBdwpiTa9S4j5lSxHFrTP3uePnln8'
})
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
$rootScope.$apply()
expect($state.current.name).to.eql('private.profile')
| 197069 | describe 'LoginController', ->
beforeEach module 'guclinkAuth'
$controller = null
$httpBackend = null
$rootScope = null
$state = null
beforeEach inject (_$controller_, _$httpBackend_, _$rootScope_, _$state_) ->
$controller = _$controller_
$httpBackend = _$httpBackend_
$state = _$state_
$rootScope = _$rootScope_
beforeEach ->
$httpBackend.when('GET', 'http://localhost:3000/api/configurations.json')
.respond({
default_token_exp: 30
})
afterEach inject (_UserAuth_) ->
_UserAuth_.logout()
it 'sets processing to true when submitting', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 401
$scope.submit()
expect($scope.processing).to.be.true
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
it 'sets error for 401', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 401
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
expect($scope.processing).to.be.false
expect($scope.error).to.eql('Invalid email or password')
it 'sets received error for 403', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 403, {message: 'unverified'}
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
expect($scope.processing).to.be.false
expect($scope.error).to.eql('unverified')
it 'transitions to internal error for any other error', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 500
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
$rootScope.$apply()
expect($state.current.name).to.eql('public.internal_error')
it 'transitions to profile page on successfull login', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond(201, {
user:
id: 24
name: '<NAME>'
email: '<EMAIL>'
verified: true
student: false
super_user: false
full_name: '<NAME>'
created_at: '2016-04-08T20:06:45.391Z'
updated_at: '2016-04-08T20:06:45.391Z'
token: '<KEY>'
})
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
$rootScope.$apply()
expect($state.current.name).to.eql('private.profile')
| true | describe 'LoginController', ->
beforeEach module 'guclinkAuth'
$controller = null
$httpBackend = null
$rootScope = null
$state = null
beforeEach inject (_$controller_, _$httpBackend_, _$rootScope_, _$state_) ->
$controller = _$controller_
$httpBackend = _$httpBackend_
$state = _$state_
$rootScope = _$rootScope_
beforeEach ->
$httpBackend.when('GET', 'http://localhost:3000/api/configurations.json')
.respond({
default_token_exp: 30
})
afterEach inject (_UserAuth_) ->
_UserAuth_.logout()
it 'sets processing to true when submitting', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 401
$scope.submit()
expect($scope.processing).to.be.true
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
it 'sets error for 401', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 401
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
expect($scope.processing).to.be.false
expect($scope.error).to.eql('Invalid email or password')
it 'sets received error for 403', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 403, {message: 'unverified'}
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
expect($scope.processing).to.be.false
expect($scope.error).to.eql('unverified')
it 'transitions to internal error for any other error', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond 500
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
$rootScope.$apply()
expect($state.current.name).to.eql('public.internal_error')
it 'transitions to profile page on successfull login', ->
$scope = {}
controller = $controller 'LoginController', {$scope: $scope}
$httpBackend.when('POST', 'http://localhost:3000/api/tokens.json')
.respond(201, {
user:
id: 24
name: 'PI:NAME:<NAME>END_PI'
email: 'PI:EMAIL:<EMAIL>END_PI'
verified: true
student: false
super_user: false
full_name: 'PI:NAME:<NAME>END_PI'
created_at: '2016-04-08T20:06:45.391Z'
updated_at: '2016-04-08T20:06:45.391Z'
token: 'PI:KEY:<KEY>END_PI'
})
$scope.submit()
$httpBackend.flush()
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
$rootScope.$apply()
expect($state.current.name).to.eql('private.profile')
|
[
{
"context": "f3c2b3c745b18645301fdb09a6a331e9fb6d9654fc79c14ed83ac1684c755b9cb209885f86ff290a71f08a848b960152f05b1aa8566bd382ddd45521062831d7a0fb3a8bd8e112a91b5960690cd8585c1aa104514e3b9cbf52f6384e84c27bda2802fe9fb952cbf2bd607f869d0aeaa6b136c6a5f6e9b0522b6019b7ba6af6cff99fda612e024867decd8c0c6fde2034\"\r\nf()\... | test/gen/gen_drbg_hmac_no_reseed.iced | CyberFlameGO/triplesec | 274 | # Some DRBG-HMAC-SHA512 test vectors from here:
# http://csrc.nist.gov/groups/STM/cavp/documents/drbg/drbgtestvectors.zip
out = []
f = () ->
out.push { EntropyInput, Nonce, PersonalizationString, ReturnedBits }
COUNT = "0"
EntropyInput = "35049f389a33c0ecb1293238fd951f8ffd517dfde06041d32945b3e26914ba15"
Nonce = "f7328760be6168e6aa9fb54784989a11"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e76491b0260aacfded01ad39fbf1a66a88284caa5123368a2ad9330ee48335e3c9c9ba90e6cbc9429962d60c1a6661edcfaa31d972b8264b9d4562cf18494128a092c17a8da6f3113e8a7edfcd4427082bd390675e9662408144971717303d8dc352c9e8b95e7f35fa2ac9f549b292bc7c4bc7f01ee0a577859ef6e82d79ef23892d167c140d22aac32b64ccdfeee2730528a38763b24227f91ac3ffe47fb11538e435307e77481802b0f613f370ffb0dbeab774fe1efbb1a80d01154a9459e73ad361108bbc86b0914f095136cbe634555ce0bb263618dc5c367291ce0825518987154fe9ecb052b3f0a256fcc30cc14572531c9628973639beda456f2bddf6"
f()
COUNT = "1"
EntropyInput = "4cc8214cd7e85a76bfa735bbbfce926c0323fc348de6c05ed1800c2c8f58c6b1"
Nonce = "001eb1f6b29b35242a3f8fa2e90003f4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1efa15d644e1bdf34eade3ff2f5e9ca45203ccaa1e534ac9b4287a846b71292b03102286d99f2be64b898fe909238f540ebc25f49522f60ef723a4c428ead530a97c62405cd5d9ecc54ac5baa47ac4f6195d637833f462d21a659b4903d9cfa6c9fd4512445f9abb5782899a6bb64592f3c2b3c745b18645301fdb09a6a331e9fb6d9654fc79c14ed83ac1684c755b9cb209885f86ff290a71f08a848b960152f05b1aa8566bd382ddd45521062831d7a0fb3a8bd8e112a91b5960690cd8585c1aa104514e3b9cbf52f6384e84c27bda2802fe9fb952cbf2bd607f869d0aeaa6b136c6a5f6e9b0522b6019b7ba6af6cff99fda612e024867decd8c0c6fde2034"
f()
COUNT = "2"
EntropyInput = "d046270e6b7997cd5f4e9ed1193e55382191f78547a660854cf60bb03d039a39"
Nonce = "50cd147a3445f6d32d14cbfb9da0c327"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cdfa9441aa5eb11fe3ba50528ed731c9ff9e70b78da075d00c52d0e281e3a868f66a53a2a6a272d7e0b1a32b6339f8afd108bb9e66b04c3d6bc069b7e01b69844322df7deac66e605a9e2f43665b7932c67c418a77a4c9a302782d0e735795755613a1c5e90089f759d780fb3a984dee4e06ba3dc5a8c652549587d975e586a98ac6aba6563e2767f1a379261b9dd37992ea9681881ea7933b5c64093234c849142ced85bbe5956f527d46ef091e4d18df2a6102621a91bca51bf7aa4b242414dc16e74ae59dfe560c19dbe315e7f98b11086bc26e336dcefcb91c4828682da90d3921336a45fcd36ea4d1213a13213a132bf20aa1a3991b60b65de7ab9cc656"
f()
COUNT = "3"
EntropyInput = "8c7c80b169160c78104c205e4492a9477e6f7ba1c3bb4daa86d222deb6241bfd"
Nonce = "2d2dcd5c40b46fa553ca6a2f6be96991"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1658a7552e4cc98c228072801f9ba230123e7f1f7dca7ba839f440e5f7570fd29c38b86a2aaca04cc87a56205b41d19e38998b47d0ffbfbd9bb56a6eb31bbfdce8d01e8991b82315c39f60c222298160e8d9f14b1a6038d8eaf15eb7310b180a8e2e8d05ef028782b55d4782d4774160a39896d1a896823f8b92a99abb546ef02cf189200a1a7a2fbb7019e4d8a935224c20d11a18e0d8890549666f6599c261532b036051cf7a65dd33bc0aeab8fa2ac9ed520f6dd893b9dc3cd3b87d02a0543eca0bb52c58b7ac4ab3f00171e21dfd3363229ed362f960d8a5fd06af5caa86018f9dce81ade6234a6992bfb9e2660d08a103dadd7d9ade4c45d691aa3799c1"
f()
COUNT = "4"
EntropyInput = "cd394508d86c384c0c998b58cf7017b7124269428e4cf39519b5815cc2d88734"
Nonce = "fd2cbc87c79063db588d90b9cb1569f3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "7c4de5fa97362e63e52e790fb66d4b067e8cc1742975ba6f9186295832d31c4e0c97b7dffa262b93b109621044a4bc89c9fc82211f5cb763974eb3a816fa7d7853577bee1c36c2c36aabe28559d5bd85691c3e3bd610e61e4c3b76e167526d1331459d8bf09ceb403062cc97e1229eb3a70af6049d291aadb002786e7d21b81c87fa68a51a1b9a89394788bab70783a88c883ca17eceaba455f357c611fb279e38f67e3c27c5ade5f95721fa79fc2da1bd44ca7f304161359da4e45d7b847672bc185ba502123a802535dbd167b2c93bf901626e23fcaba03c4f89625a930caaaa30400645680e5931e094aac6f6467b90b13c2be9c98744f89d113151cd2ffb"
f()
COUNT = "5"
EntropyInput = "a14be417001030f6a9c543f829715b075d0efd8fa35acc7eed02a1401c6f59df"
Nonce = "c87b8b9255e62fcda6a35e52fa4a6f9d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ed29a49be56e081f5b6abcd2ca1a16dc096071989de72a39b8bd544d2a2a2db5c886c0c29ce454cf60addb56cb4f28f959ccb7163280ef81e48dd2a02024c34a120301d359f03844d1af01f485afbe7c9b17288cf345172290fdc44e124670c5ca9e8590df6f9f63d60849c62d3921003532dbe3e3e6bdd75d28211365f6c489598a99e605ca671ff91552b5916ea9e12259723c0e1a633be34932d0c816c30b519c79656a70368b28fadaf5eb32eb6e47e00b04f152ace2eafc9a3ebd3b1b3795ad85e0897e46ab57c361fef2908041d365f73180b505ae2426603decd0b7dd33e2f7ac885aced4194999602d4d62a984233d0696fff86f7fa7a6cf993fb7e5"
f()
COUNT = "6"
EntropyInput = "b8ceee088f3b13dbd1e7cf230449f246a456f504d63fd4288838a50ab76576a3"
Nonce = "f400502913cf57cb2341c5e6a63fe9fa"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b4fe3f6caedf4ac7b93fb1c2f316bafa58487f28a37b8400fd1f32c963b04cb3c7eb601d0dd8a7e4538b14030fb0e97794c617366ca827e3afdb0f714983a6a72b261db8bf98d5fc48fb55158661f987d08e952913212717cf204a3e8cf1177f63e2a46d920ffcec4b580a1361253a689bf765200f4e90dc6b34a56e10cfdbf932fbc3b75da1d55cba0c5287f552d883763b83acdfc7fc9d762f79774701f7ace701f0b26c67217e022bf6b6e0602e0d68cb1377b5ebccb9a8e41188dd1dea662663e8aa093787d6490a4e887a34a27309c64c40e4ab2f0acfec4a1b8d419d99fb578aaa82da9166a7d7873e27226db20d313e868bcfa4fe3854d6fb34def7d6"
f()
COUNT = "7"
EntropyInput = "3c1e8a0199786fc268ee0ca0c0446d7363bd781069cf3a3faef2592cba06ce1e"
Nonce = "70c7c691af73d6d59addbd6e3f646d64"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "06f44bebc2c1736b5cee283e530bb877b28651d70983c272a10efa80e3794ee428644048d67245dd3ca8b769b6bb192c9468a9fcf2b71c417283713d39e800225ba659c3273022f5177fd7867173f457f3bb66ff2c2e7bb2574dfee54438e35c98506c178d35259b04e7c541016f5c2d980074b4ea865203ae2e8935d745a02ab5cce04d233cbc18719b1900f2e7e98229b851d19fac02fa6e5ac1bc973b20a17509739bd989d4ef5a66fd9e19e3ceef2415b498843e93631b2b168167bdbb8db313eef4c9668d5001cb34767ee41db872163987c3bdc144637b52dcb767ffc19bf44fbad487b1eeae7957b497fd59a95f0988315eba73ab7206542f31c49267"
f()
COUNT = "8"
EntropyInput = "e8a0925bfce66dee7e6a54fe0311d259bd7f7a22b8576d64840cc51c731212cb"
Nonce = "1763365deab3ab82de9996e5c8570eb9"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "63ddfd70508cfa247408ec231d56df7905f65b62e5e5a8309fff5239620faa0f055d7b8fdbc648ded78fd567c3141e1723d197296c92d43fdc18af0c4a54fcd52613286c78ba7bdfd0fcacc7b11b374739088323ba95f30872d77b6aad21228253133d76d29d0d742ba349956fe71e8bbf3fc7186a3f85f144a9040ceb0529a713583c1fcdee756d0130b38df0964bfc3b669fabb6ec6874d17d9ecda9fa567890e42540185eeb3497ba8db80b803f63803442aec14735e9eda177484ad61bf0c76c2862b7691b4cc74efbe35203f8cf4f24aaaa1d831030f28eef8b49e85b249e6fe835964d53aa74de6a31424ec3c833f4b8b39559934bf5f23d4b1d450bc3"
f()
COUNT = "9"
EntropyInput = "c493ad96bb20b2480bd3122b4b1ea51379f5fa2bfd8bc0fed4080995b162c609"
Nonce = "b6d6197f432c8597163feb9c5439525d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "764d3e4459504b490eb1db7b5ab8e6413601e449750534f4c4f70025026f87217010eb14705eae6e513796c7f20ecace32a063238824b3fd6956810066930bf425a1c585221c8f61ac64aeccfe8a3e33d164d02d5434e9e594b7ff451601874d268a2fd8de9922c36e67d8146fe553889a15f624d499a22f5109896758f30bb98f70eac11da1ad48e99bb4422acc5b97295094324eecf530525c1ba150886d053c84004c265693a4419602e5e59bf120de6ff054d0c7c96bc14e9b5fe1290c08ebebcda21744c04a2e78964cb2b52f8e6a70930fd1ded1f0edbda4deff91a3310019e967df3fdbfa228bec9897412a748201649328b7d784851fcb5ac1251f8b"
f()
COUNT = "10"
EntropyInput = "1e868c5fe4b59e6d4249854226bf1120a74386ea590e9c35c58d7ccdfad56d71"
Nonce = "dbf557da684289e96cbdd66cbd9cb879"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2032963be29c0d24c2631b1cd895124b9801a4d5c14c28fb34cbfb1c2467134f499153e2a3ec817cc4b2e4e06068ae78f5696dcee99334b0b51e9f29e56a3d3fd5c65c4cc70e10f9e0cea2572c28ec4afe0896d7689322d3afd931ff836be485f78aa179100d43d910564dd1adfedcd32e3e7e53b06c0a46a90b1173e4a5152cd8aa38f2a7e329d01c0b81e62be6c9fc8d1ff3db08f8c31c1e77c5d7fae619555c0e02c658486e35f27a7d58ce63b9b152b9ff528ab6a6cd9b59240f5a7b6b52dc3f6e47f9daa2cb8cb525d6760cf409ebe2c7641c3c32e330545bcd73da9eda20b7590d84831d4bec807a56994259bcd2fe28105f2d7fcdb3eec523fdef7044"
f()
COUNT = "11"
EntropyInput = "55bc1c7358dc334b26412ab472dcf4210740cfa0ea688812d8b1a7fb257b979e"
Nonce = "dbab14240cf59fcc8a7007553ac480eb"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6a9d30d4ca97dbfc2d2852bef044bbfb95ac253b27e588c67fe179f6adb81147cc1cb6eba6a2c4afd6f8b3f1c8d45b51af1435ebf1ba8596830314353c9b4d8aff9620dba0099fe0a1ea417b97fa4c28491fe6d2a619172127f18155840f90456bfbf1e7ff587fbe566d6b8eadd6ce594bfcbabedda37858a7610c8230f594861984dbf1e3ddc9eccc8b9d2ec3cba1306d178f7677ed399b10b995b3ea55586519e5730e52ee8880ef0e63c476f2a80d77c6ba802c47e9174297b27520fb027d134e17cfa6f99d59cc5f53737cdc2e663e1ac59bf74a87ab1064e9acd4811c0406ec5a29a081bd0efd1e557d6b6c9c7fe6131c5c00fae82339a1fb90d3be2b6b"
f()
COUNT = "12"
EntropyInput = "d894820d9cb243859447cd3a3f6cdd125a9c4faece6ad756d288a15c5d24c39d"
Nonce = "776c5ea9838c4c34f39f12c1a9df6700"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ba23f7aa0b7f6a93bc0df32e68e78786fffb5acd7fbc2864468568753e3ddf31fc2187b20c229d0d0b261510f6442816d2226024b57306b474079c92c66a00be482fc104cdbccef0450b3f2ce94f6bb6a5125e0774a28a2a083f802d3c45e9d4253295f80ca4bc439f539a7f82eec6fd450bd196ab468ec6902752dced44ab557fcd3f6a72c47c0f18cec6545ac669cf432e2db308d70a7394ec772a34f14f26d7bf7d0bd7e4437248618efa2c08adc7de9231ddcc976ef8bcbd11be54dd17ca9fa515fee6827bf5efb602fe8f1cf5d67078b17601803c5be05c24edccad2837d0be191f918d6dc62742241728a8690db5836c2045ec9f8bfa87b768f4febf2f"
f()
COUNT = "13"
EntropyInput = "17facdf2fca2e1134674ea8e8daa609b4477f415c6a13a5c157f3fb7727dda6d"
Nonce = "3c1dd89ad63e781588e4b3f8cb1f2f6e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f472b4c20bf07c170b3c8eb682469e88680d1fa5561d72b864c5c438c95c4c8a3e61f89fc30d5fb4e843e5ed1230778b48c467fa46ebfb7b56220a610483827f3f7f8ac307f8aa57a68922a06c8fa5de732a0d05835cd48690a2b3f734e4b7e74799ad774579a9eb296112f3e2bb68551af0e9e0e5e0bbb219ccb6c78459dc68a3663987156a50e72aebb219a1e43b5603dbd8055bf1e76a4468caee86489ac9a1a9a66ee7b193484ff3bea84341b62dab124a43e38945cfc99f2c4c15590fe180bb3e6eac544483aef710278213a83da85a38b6d140f33654c9d4f6b8ab3eacef1c57fd2237dbe8adf23b3aef6ab30327ca119b9e1e95ecd068aafae0d07a08"
f()
COUNT = "14"
EntropyInput = "2c13e44674e89aa105fc11b05e8526769a53ab0b4688f3d0d9cf23af4c8469bb"
Nonce = "700ac6a616c1d1bb7bd8ff7e96a4d250"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f778161306fc5f1d9e649b2a26983f31266a84bc79dd1b0016c8de53706f9812c4cebdbde78a3592bc7752303154acd7f4d27c2d5751fc7b1fee62677a71fc90e259dfb4b6a9c372515fac6efe01958d199888c360504ffa4c7cf4517918c430f5640fedc738e0cc1fcec33945a34a62ca61a71a9067298d34ac4a93751ddcd9a0f142748a1f0a81a948c6c6a16179e70b6f13633fd03b838da20f81450b4fdc1752e98e71296f1941ca58e71b73ea93e99a98f58d0892fa16de6a16c602036ac857dd75f9ac2c9185932103db5430e80cde9131e814a0bf3f3e7a2200a7152424472fd27f791a854f29aecc448f8d3fca3f93290266df3193d9e13e08907ab2"
f()
COUNT = "0"
EntropyInput = "73529bba71a3d4b4fcf9a7edeed269dbdc3748b90df68c0d00e245de54698c77"
Nonce = "22e2d6e24501212b6f058e7c54138007"
PersonalizationString = "e2cc19e31595d0e4de9e8bd3b236dec2d4b032c3dd5bf9891c284cd1bac67bdb"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1a73d58b7342c3c933e3ba15eedd8270988691c3794b45aa358570391571881c0d9c4289e5b198db5534c3cb8466ab48250fa67f24cb19b7038e46af56687bab7e5de3c82fa7312f54dc0f1dc93f5b03fcaa6003cae28d3d4707368c144a7aa46091822da292f97f32caf90ae3dd3e48e808ae12e633aa0410106e1ab56bc0a0d80f438e9b3492e4a3bc88d73a3904f7dd060c48ae8d7b12bf89a19551b53b3f55a511d2820e941640c845a8a0466432c5850c5b61bec5272602521125addf677e949b96782bc01a904491df08089bed004ad56e12f8ea1a200883ad72b3b9fae12b4eb65d5c2bacb3ce46c7c48464c9c29142fb35e7bc267ce852296ac042f9"
f()
COUNT = "1"
EntropyInput = "e72d696d4dcb41a42d89037487b3eb01d2ddcf0407e4daa0b8ff562461eb6f83"
Nonce = "b2b01fb9732601f3573c6831aef09ac3"
PersonalizationString = "8bbb235642f8caed49700463168ced9971a0204b981025bee41c72b76a965d51"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8e5cd2a91ea113072623b787ed37454fae2c1905a725be3b124bb243057794dd68325a5d8bba5d6c7796d91cf682587ebe91f6beb33c5cd60b00940bf6de57c7fb082b9ba0e5b44e021be6d45099ea59367291a733ca50334f0315d52ed267af1b98e5be59359a0b9965727d92aafe4c92fda2c915cfb5a378c7a717f743a3524fddf5a48b1e7e113fa6e94b76f4e13fce3cc18b970f2ed1c34bd622611c979b6a9712c4447c3e50a7bb7ae30a8bbf479dd4242a8c4d1492c892107bb4ca695e3c790c9799bc6ffd563ebc3a4968accfc2085ab576ca6e9bfb2904a357c2cfddb55378994e5e4b36008cacaae024312fdf036a097f0fc1d3f9e75fe7cff74540"
f()
COUNT = "2"
EntropyInput = "8d6ff3e3fe6808bc796a73957b19d758b257fab71dbb4e39acc2fafb01f88e98"
Nonce = "2e2b74490e062044975d6b1885f61ec7"
PersonalizationString = "b5f819154ed5442d5547771af76cb6333d7f35e6f3e1cb03b22d09e601eb8eec"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9cb257ba9d77b95e5bb2305424116eedc126b9a8654e56942e282da3823c09d9cc1c4b9c4975f13f9138e93ac75c4bd552c81d41d6363466cf2a38e2eec9294a93630dbc9d7ca89a0725fc7e41b0e55e8999279df88fb579dcc500aaa97d78ae354496048ad47d0b0285bac5e5f6e9bd50c2d9bb6f06090b3835171533d2105fbbb3762b2e33bb75c5f7c89cfb809858244526f8de3aa4f611bde41059109e8ff21b81392b55b9867523b4a4cf5dd74c23a2066f9b26225cace5c5822888f7f7dd233816ec3ef137852945fc6648b4c7cf11fa744cdf62aeb02ec2e68c29c071c84883472619da2680068aec82700cc1cec0dbae8b740b3be7c4b6c972c62998"
f()
COUNT = "3"
EntropyInput = "138a1a9408cd7de6c1796910145263e5816d377cb9949bad0927f9c61e7fd18c"
Nonce = "71eb585159831189707ac6b8b6f80100"
PersonalizationString = "9c0ca722c55c19694df96e70f941b5b230efb1fccc7a7abe0c471dde92a39272"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "976e1a19af964502177d27b09458e3beca6e9082ce21721d31b7241795886213894f2e3f9acc23af6aa5eae7218d00871dac9e237cde1dd9654c1e893bac47e9444f4dabd26d3dcd9f11a68b297956f135df32fc3470f7b01383c506e2a2fbdf1c387c4ce684592fd4e5be0469a29c8031cd1ccd002edae3bea44c93695241296d472783df68e5ac7a62e33a5a74f70fe45252f88309b7f3603f43a5a0a823cf6f3bd8670d50663ecc326aed709224b60fe67ed29860b31c8161d416dc5cbca1c16e69cd7ce41a77cd465cb810f2b5963d15e352715fd5e6175c68125fc8e107d6573ea89db8b34fdf93e2e173cef77746e6142c8e5c44dc288ce86c0710a04b"
f()
COUNT = "4"
EntropyInput = "f4010441edc99d524f6caa660c180e25afdd09315f2a495ec003471e1f79bf0a"
Nonce = "13bc6f04d81b25f4d4c9321aa3fa58b4"
PersonalizationString = "37fbbb3fc5aa698084184ecc8e8b45212dcf851e6e4f2db8f775d3f759ef0c4c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cb3a853a930cce84703c47719f6d609fce15f903a887f646c0781606f6f926765afd7411b4fc44be350b14cfff04383e4930eb36f94329033cd5f21d467fa74ca1a3c61c94a290bf6753809d8e7b75431d9450361613b16d6be55c392cbcb3d4212ea42cb341878cb268f3daa87c73297a807e35b82458cab693ec9bf66f43328ff1c4e727998d841a1d1491ad55c08522e5c69f19233fb4a8b11e937c55afa38ef5e0ac74b6f856902501a2558663f453d069c291d762da968298d596104580d80bf0787ce4a148dcda5ffc4b47c653f9b7bcde6cbd36dce707738b114d5f6e488b17b63f402c99d0c2b4dca40ef3d05025e50f87fbad86468ed5c08599bfdb"
f()
COUNT = "5"
EntropyInput = "64179b56a75ce27513f0353e10a5107b935293af96799112448fb5787d9949d0"
Nonce = "f38d2f6e523ca3ef7429621db65a37d6"
PersonalizationString = "f0cfd2400dd8d5e857e5878fc811a5c9ce5e0097184ccdc57c0f96d5a66020c3"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b79591df35bf97c7f4731ded3eefcaaf9d0033bbb0741c0c28aca622e211491107ba9b9645ed325ae18a7aac6160cee4e34f3d3a44de58af0f5fe148b3c93fa37fd2f98e1c3c46a216bfb78d2636dc6b89501ddc315ca16eaa31a818b2fd100a47ade02234096ecdbdfd0997a3c7a4481815665b9a41070bb1bd4d7d9576957421d3b9b75d0e06419298aaacaa4f77afccecc7a67d59295aa0122197ba72b115b8d6960fa7c6c801785734f716b36805b97d4416baa1ab16c190bb8095b0c9e1267f1ade79791333ef6e442c681134dc1ff4ea547a89b84fee3bee0cb481f0afc3d1d2026add34c44f67dfce9c01ffcd443d0d5eaea00b60d0cb2ef4fad1dbef"
f()
COUNT = "6"
EntropyInput = "c21f2ca0d103186755dbf2d8470c0282fe11824f0873cfd7935671d3af749ebe"
Nonce = "961df3048132b35d39bc1f96e21672b3"
PersonalizationString = "d040489ad6f484b13be395fd99fff34706cbf96867e614cd6c91554d61231eee"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a91bc36569a590e5dba3b64e896b21625a8555f71ab77f6f348d2d787e19594046a255f265bee7171100f2db39e3a5d966fcdd88ebc127b23b1798da44e03006a1987a4f5c8af3d83c220661b3c1ac45c5e785d96075681b2b19da1d5b0d143f3cf43c8010523f08feb59360d8a3dc12f101f2542d9fb0161696914f96cd1db573fde8957da6d7e9821032d9fca00f657c326ec0418cc3c60ae387e13894126fce27573ebdc1694853c5eb3bf37f82a5bd59b149d36cb3d408216315fecfbd2cce84f9e5186f24557c3c93827f6962b90fb1f49260250a55bb443c327e03e4a615be0bd5d290decc7fb6813d8b4d8c5619745cfaa1302987f2139ac71448aaf6"
f()
COUNT = "7"
EntropyInput = "b3679d82e8a26b602835fa5b780e9678d8a84cbcac2cd6a66174a9c6f68d86cb"
Nonce = "c4b1bcdcc20888953f8ff22363fa8a5e"
PersonalizationString = "c35fe47a7a0c8f82af93ec7dd162aeb423af44aa71b35d299d561b65640e43a1"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4fb91c1ac25546550d914c1bca10943f0bc2d6785d11eb28eef7b138b42a248b7866eeedee2a00772d3ea216430344af63e896fd0731e93ed7e06e96024385af563cc80cbb27df9285219b1abc57949c580b3d7b7b2e956ec2375ea5069c89ca50602494fbaf80b06424fda851a7576806dd18cb8c96e11c746b71e272c09eae0d3e1a5e14d46a4f09ce1520c36aee0e565f3093e703786bb109a4362620eec6108c0ae71abcb8e3a46e9907fa74522cf47f81d743ff4766b7ecf81982340e573a2893636ea8072373a628abe72e78fa22785e607d4fd6941b6b58da5d77517e3cd6d228b67b49b408b7b67c76ff126da818ba19e4dc36ab647f3b3bdb3c9e19"
f()
COUNT = "8"
EntropyInput = "d120f00e06be42483e026e4be88267ca2f8c1b92f3a8342fd460ee5f2f162bf9"
Nonce = "e851a711e87dd4ce719d660de2988754"
PersonalizationString = "28b9fd7cbe714602be7d7d8a159db5e72cfdc8ad8f25cd18023da801466bcd2b"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6912a14bbddf7b5fee9d8df4e06662b8856bcb85ed0dc70061c0951b46ff4a6d9fc49eed01f71a9155b3f03ec31d2bf96d0cd5b961a36cb702c9cbb4a938f3a5cdbbd22d4a94f12434a706362897617f25953d6f62243cb3b8cb21877cf74899d5285a5b7fdc8fe18f49bc7f0fa4d200e8c98ee38884e4ab56ff8e31dd2420957c016b3a3dd65f6cef4b440d1a4f4dd38ac774e0d06e4d32bcd1d25aa54417f6e2be37096fe6fe6b2e08863ae1f03f9c7f584ccb5790d085647a1ef6a39614b208fdce993294bbcf2b66692d41a9c71b91fa0183486d70b3ce17c8d3b6ed8a3eee804ead37cb8b13fba5858eb9ee7e44b4cd9f5d1e063c33e15046bc080bb3f7"
f()
COUNT = "9"
EntropyInput = "256eabcc37aed36ee6a5e288f6a96c28b8554ae987eea487a87f7f1a3c93052c"
Nonce = "9dceeb5a5749f26f4dfde9ce42908d33"
PersonalizationString = "0aeb442729544bdfdaf0a0997e12da31187d92e5491eeb19a9d0a5b8142f4017"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "729f91d238cbbcb0001d55967c9e33765db722ee3c1acfb58d67f630b24ed6ea612d45b12db152f082bef94fdf1e370bbf1388c26ccb6e5d2567340897cc11efe1c5f87213a38a4f4a8fcf0ed25647e800a5b67b67558f0dad71e560334b15f294f780d837819cbbf068b1855b3cf62d9cc9db854e69efeb82f71d4877fa3af331f9d93c4a44f8f034fe667ecc71114202560f4131002638bb97fd28cf8843b5aada3d173fb1a0f9ddd444bdbf902e4b1ae6530dd291217a26d0c3bcc8a745f1475473197f85de47c3c2fb0cc7dd3cef12296dda7d5f16b62cb2bde59b21d29c0e1c700fc513522b8cebe196ae36542f48abd8c6a0f75cd2da045221037ea8ff"
f()
COUNT = "10"
EntropyInput = "fe4e42ca7246202e31849eb9becc217a8ba475c289d36a96879afdffd0996e07"
Nonce = "26346eb244156cbc6cb297d3f57ceb43"
PersonalizationString = "8f75e9cb9dbf8636d5ca1a08e5def41e9c773de65bda450e025b3947d198fc0c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "952ecf7252536ef906e1c4a9d4d0fbe5696a574487a9192445b9730d96ec2bebf57c9fb3ff1203011ef221625f95721611b10ff4eca17833ce11c4ae6f2155d1954dcdcf17d4d9252a739c99e085c3a6169585fe1b2523388f0690392d30f153d2fa75d8dc12fb8f235cbd83d5d1d0f883bf2f0dff0bc3ecb490fbee2dd09be21cd63e56c90dc92552a7819da8682c1676ee432e1e6c85cb8928b9997ea4af23e7d5dcceaba634cfc31541133c2d11cda92aa858d7fc98940fe4bb6865f8986b27ccbe9889f94cfefdf5e7d7c9667dcb91ef9095daa86a27df13a4bb8afb32d4bc5273247c29a93b4eb53c0189308585bb83baf9b6ce76d995838e035aeee907"
f()
COUNT = "11"
EntropyInput = "b18f4e2614719779660fdfbd342f37b944141c5adc2346c4e37733a4da6fd2ba"
Nonce = "d849c315f51034df3c7bd39ce4f4ddf7"
PersonalizationString = "7b6c82ea24ddf29ae2fbea9c9e284506288abff2059c07246689618d3e6ecfc2"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2cbf77930162fd93a9becce1b29e5b37a9b401b8e7875f650204cce39ce74592686e274372be83c1ede3e7901d4e9fadc5d1b9f58e03e7db208feca9573dd3e0f39967922309fc7e065591b59e6cd7cd4aaf836882d1230320e22f0326c629afada478708125c4ad140b3054c9d4a660811a40df01d6f3d0acd7a16b69b10f388ce317fd795b8336a141a3c3cf95f30035567a58c66a08806c8523984bf18d75bcdd67a6c1f9fc464e939c913ba02d28fa465042e1151adb914bce52048544ff6835d1f81aec6c42f005f592772e751bc7f64ccadc276a1754c382e1355958e435fe2a096818171b644084c702ed4740bbad7f536aad0bf47b3c1fffdb3e214e"
f()
COUNT = "12"
EntropyInput = "14c817683e8013e1a3a56e46bcca485cbf386cf85bc45d11817264b0809919dc"
Nonce = "9fecddd4a2d910ff5ee139f436af231b"
PersonalizationString = "13145848e593be74e8d9730be55c9b98fa551eab55c364127b16b4a295ca15ad"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4a16be29fd77ac3e0b0754ef030b0702209be0bed2e2292059d5d9a07322050991991d482689e71921fb4f0d189be688fffd4eff001d78e2fa28075101c55ac98f4af065b9fb34df0a1db10ba41c5efb241e2acdf9bb65fa5051c6d01cb8a0d683b001c034cce35dae98197b3a6945b31f3eb1342cf1a8bb6e528dac01c7f0350253029a1ad0899801bca276bc5eb3dd92a712f2e99b21b81deadfc23ca053822b00f0ed0cad1b2367fd3f1bf50a121d29f4a95305877aea757456c852c2ba2af9da8cf3f8a68847749d6ffe8e115291f999059109f2ef4a1299798d2d04bada29088e9b886cf839c71cdae58b5a4d17818ecc05dfa09d7431f471f79abe0e66"
f()
COUNT = "13"
EntropyInput = "bd5263fad2fa0c4caf9b2031c27b1328bd30fbb88549d528fb3227994a012ffb"
Nonce = "b37e0aa74649ab01627fe3663d28fef0"
PersonalizationString = "e49c8fd4b2d1676096f937a0674ce41f2b960eb53e4b35d01212adb6b1ded917"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f5dd013f8eea8fc48a2a77600cac576dbab7919c91f2d360749ae7369f184fdb428d3575ff97574b8727ad20dceb04d116030b8c3ad2ee54c69e6e01fa1580cedca2949641067a2845f6fffd1909ae2e520b9319ecbbcd6c10afee1ac1e4630cdf6c7f66c233eee4e7147f0503cc4179a5047668f198b69aac1a715480602df33c8383ba3b9cd179c647dbb5d5d1bb20c9bec9d933d75ae6e9c256df9eef4ae2ea062583b6619d45f2fa684d4fb6535c381478c2204e2f448018e9fcc4184d40c3fd02f8382c6f856be5ccbba36a81c7789efd1ebc4b71f99dbb7c002787f9b2cd4a20dc6444b808dfb8654b00afbd1f6595668de0b52dbefa298ab69687a50e"
f()
COUNT = "14"
EntropyInput = "e9e4f59e1a5fd43acbe20923907227b2790efd1a2118106b1e4823588c525423"
Nonce = "fff1f2e2ac117af8b2cb023f0dd6c6ea"
PersonalizationString = "0a4c2df69d6c69df0a9c58ab7c886ed9db294f5fe98eb066fde543b409ee91e0"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ae35e947a538e7da73f944b4dea689c064b144b753fe597369e58ec4868099c0f000995949e82dc3e5c00555a2cfe48c8a87e87ae5e7402e2b1679e413cc556f08796269ef3ea83d6a49116349a31710964fb2f936cccf249472eab3267cc1ca0073ff4d964eefc82dd1559c3737661f8b206757a64c756680fb7ab6be8cb433b93f21a04c1e99c777ac26c1f34918794085ee593ca27ae991c53d141e52f90e7872bbb036dce78e6a33e2d638360f9c15d5746d6ff13c1bcdff1cd01749fa51c3c72e68c0ce57423d4915abe84c15cfb3301d0c3b8ffc6a1962c1fd981790fa2a3da60d70e8e8557e4b2e7458ad85f5141ad46e1db751893e8327c8197571e8"
f()
COUNT = "0"
EntropyInput = "dc01767ed6527b8775e99fd5d46dd33db0ec2ebb393acf59b080510a657954ba"
Nonce = "174e0ed454d1b57021fa980f4597ea25"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3de906b138662897b8a5aa00d8cfaa364bf70143d1de088a6f38b610c8f4d2a20c107c9f6d277850fa5f50007744f90cda0e20e3b140f9aac249a43ece99c574245ced90e6023ff5bf5bacee6656866db3fd72a209c79fd9829e3c63a7f46f0d31398e189331f93ec97ff1554bf0739c18abc1cc1dca1d8a8a5ab243b7355223ea6eeaddccc0972f23a03291b28af9303c21c0a1417529471c6adeaacc659554e8619b03fe6112de5c72162dc6e1039cf05141fa88be6abddcd2f312167e86773e52e73336c6404b44820bdc14ffa6f0e8f7149da33743fbd2c89dbd0e75b6bd9ce7703b337031ab51f5137fe1508567340fd11bf4b51f34032385f1287d4af1"
f()
COUNT = "1"
EntropyInput = "197c8b09c20500b2ff9095142c4629becd3a131ed17b99940ab31a53762226ba"
Nonce = "4579a3858564901928fed2a75c98f32f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c33b2418bf4d66f49ad1c05102686c65613cc3602d74aa4e5c611873a337c0fffc4c8ccba9c5ab56c3c9cdfd9be3c0da039bf08442cf2ed4af5a9fdbedf0d66001192bca2a2a5dd5a49cf159e2a5ff00066eec08b99312f84033e6e6f24bc5d908cd9d19e6314bfebb98bdf431c9779d0ee7d15cf9ee7e9baefddc6c6625500911d2810a0ec794e28eefcd0fd76590419933e1a1e077cb2860975762926eb206e1eee8f1a6eeba762d7ff6056a37c56649b034af7c976432cc63e672dfd4b564bfd4898de6ae7944789199e700c64a78ecd1b841d206a7c523040f240001829363809569dc5e90762c5c63a5147fdcf6f31beb60151ed54637c73d6df4a93aed"
f()
COUNT = "2"
EntropyInput = "dfe546e4148a5d0107f3dc9f735936d87f5ffbd694158d140ff04fce96785e93"
Nonce = "943f71ec131f0d6abe5098a00a93321f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8290a703f35fcec670b1239fee36a0059fa0b3a355cda9bc1f824ec616107edf4f101d9d8e7979892ae17a3cedfbc9c13a938335d61414f20308a4afb94846bc8ef1729cd35fca10f0bb975cfb554f8723cc51e9356d13c083fd5954a0e4346823dcd5b5ebcb0e21b788609bd88fe40354dfcdecbdd97d08af772351cb919e3d19ee65444f1269dd790cdac4ee88b026770eaf75c8018cfb7526a1c4efbb9a870287e6a0ed8dc8e67124feba54baefe721ce87da82743e4f185b7f591ef67506ad43c50df769dcb68965808d246f294461d4a55c9a148998572e6ab52bf574a50cc60129b1bbadde86695e3c5d4d21ba7f9e4beb432a39ba85dce836b16452a2"
f()
COUNT = "3"
EntropyInput = "f81566d48684aa031fa29e7a8c759dd08f6666b13692776361ece56e92bc3c2a"
Nonce = "40b04432b8979914f3e0e19b9d3c01b6"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1799a737c4436d32e8ea5662541c2ff628c2f293aaa7a463f6566e52d78782c88a34c505e36f29f351d2063880b5b8c3fc99ed9e02ee62496649e1401b1e151fcdbb3dc76f13b209044fa205d050603fb1197da58e7a1a3c3edc8c4b6adc230239a120b71baa6a272624c67f0eafbe6daa71c681eaa67b47227daa1ba058f399440c421dde47ec1b8211d5c57c7bb82c7448a3491b6209a450ac1e0856363fff9afecdb065051021c6b9f0e7a010d1022af4ad396ad1d164894e1c077fd83b71d55c12f9b41bfec2023998f43a2457cd55bd0fdf0a68258fde7a6fa13beb1070a5183145a2d7b88786b443deabd15e594dea1f1eb72d556178e0c74701773739"
f()
COUNT = "4"
EntropyInput = "36afbb34419c0396505235be6de69861e8902bf1c70a3e2836b97998cbac8b38"
Nonce = "d45450d4c1e1c3cc4be7379b0938cc37"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e1dc7fb2c7d11f53a88520928b127cc0e234c1ce3d593bb05967ab2600a1d66b0fb32e70b9985db2f6c14999f3b9faccb72c318e07f9d7770f3a0ed33f2f822e36a5db463cfadbaaab7ec75e773e8d4b5497ac104e23e199e1284c4f1f9e75322ebecbe659bd564ed808f815ed25317a7e5c770eaa40b63a529634a0cde0eb1bab761a91ef260eb4cd2c5e2535d8b51d272ea7251de7c9741c9b3d1ab95d1fafc7ecda61aa8aba1afe220c0fdf3cb22234538c1d47fd0921244b11b55e54aaec9e883ce542f238aa1f746c09be9bc8b4c09116730269115cc649c1abf323f3c1beab4601d402a49d35763f1ad49c7783faccf1bdeafc02beb34a6d247b6ff33c"
f()
COUNT = "5"
EntropyInput = "5eb9dd00469067be59bd445b04152b85576725c3395d7c413c723990b9f56000"
Nonce = "54b1b9129eca3d2db0c63e4467a495b9"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2fa8957e56449eeb60e0cb78e9a00a31842b821ac67e8c883f6be54e8134666b30011f6ca692f4694d663e8542ec824369faeedd281ad710110687092cff0f72990ed35cd942fc5626bd58bd4ca6a5043cce4db8d4e1dec5924bc9f9f2471b1ebc952c73629e3e53bd88b432b6930fd33e9c03daba84205793cc6c34d3e52f244efcb0e0b6335d14dbc4941bad32a8c69d750a7a91509a0ac714d80b2a0e28e14e02e5e5785906b94fa153b7abd1e0dec4b4fd00c073ab6acb6f705c07f8d7239caf3809109c78461d7ddb334edd0ef9902861ef98b7d7ac418ed9c24d2fb7c4414e25794ee5165feac3611caab8945541af42f77cbd0d7c118a077ade186972"
f()
COUNT = "6"
EntropyInput = "42f551fb6533137f40758d00c3b5b81058281f7cbc18ba5f40aeddd31065ec7b"
Nonce = "2cee96d6c3eef1c9ed1485cca77725a7"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3fd4f97eedccf2e2eddb37caaaae3433e5585c9fddf32aa601c68338554ec84f16aadb8e808e194c4f090defd53ba7c362aa70cdaf8c014543f4b11ef2a3a70f804422242d646a0fa234ac64719cdd7589835d49eb0bd2ada4b6ee458400974dafd17b43a9e5515495d0ac650fbce449e79db7842815beac2137d57b6edcf121389861d85b9ffe68143cc06e4afa9cd9639b45b310acac933160d7f0699a6df9e04b156acb02c43d5d729474bd28559de2f02192dacdd790ac550bd6c9afefae91ae3924494dfae1ce356a7bcb188da65be4eb0c356516246ef1f4e031d6247c61790b267dbf8775261e11cdae2bf7998bbce7c15c7ba5bb6b7857e7494dcd87"
f()
COUNT = "7"
EntropyInput = "a9e9d5d06014d240d427ff79fd0c6d314b5d4af6fac5c0c238a62f9224b3edc0"
Nonce = "b01fe9f159783d29824bf8055c646c93"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "60d46361f9b1834eb8c103422f3cbdfb243120cdeef6270806039931112aa45d4baa38791cca6b5eeff982a3aa7a2b2627502365644e4a6dc5a868785296bf3ca101e9bab6bd4f03b2adcc870ff9987afeddd9e6ba1edcba09f79192adef6b561c5c36dbe8aeb196da9a2384259583f6d40aeb54197f0291e5b70a34aa559558358b88f5786cd5822a1523dbbed83314882c5083aead0ef17c2ca94e7322142706cac212a5521f6d4f881ac61128b13e327f4b5e81c6bf2649b01b40645edb9aca61ebc58290db9f46eac6cb475b5c3a9e481a80cd98f548031c99e46f41d85456fa87f824e8164b408dcf1aa14fa3f9ff236f11e1ebc86c3dfe0e97e5d60018"
f()
COUNT = "8"
EntropyInput = "a160a99bc9baef7d5ec8be75bd005d094e431f555fe4d49d3f1f41fcb3a07736"
Nonce = "b5d170cc69ee34ee7ba73f35646512cf"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ce66754bd42cfe4ad5fbb8a0283cffa51dbd56da7326786ed7c5eb372a046dfb9ef6906c438eee9a21b78327073301c994353c42ad58db488e28004cdbf5c0cc9bfe75aad76be3c81fd72601fccbd580c2186d92ecdb25dc13973337f4876d6aabeeafe1604f1cbd5fbd804a6b15ee1e3d9987986941a4ea51c2d461364276913c16c580e12f51bf4444b5c0e4ff9f4b797cb850a9cc562c4e39e3240a196816638c5e62525f880dd57b1808c54d59f55b4f92d0706b08b25b77284544c91ee987452849d019a65a38ffe3511e0431e7be6207e88a1cfd989185906815fbd4c421e31c7f6cde9ed3139a87a5e08930e44aad1294451e0ad8f89978a1379cf7f3"
f()
COUNT = "9"
EntropyInput = "9ec905ee3602c95906f6084b8cf69a8be76d268652035370cfdf13a871a85f86"
Nonce = "a7764c145e668435e219dd8cf9cab23f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1996b8d7bf0d43454d61239147a8b32a27d73e0b1c1d8bbf8ab5b751bba9cc813d8be80c0ac7d71ce30bbd5ff5b1b17c12413a169af3d081f8ab1739048a0d2c1c2e24c5e44b0dd7225eeb227610af83a4a271fc31da57213eb6d938edcc2da5e712210202a09020ae24967e271677adeb2dfe6347cb6573e413dc20ae7ebd151acc91a255dc5153be1f6dfbaa4f2b7704d557592961d9847c5d8302469b02e3ca07cf331b9e61b9ec64efd32f3405319506b772fee3aa1d2ac2d70303d47e193e0e1ac9c8565861a5d7f62e515d61f770e2ab3fed00b3f9e713058322586914d69491fb4515cb2c5d21cf07c710cbc4ce362383d084c857e73f62c58f76567b"
f()
COUNT = "10"
EntropyInput = "8dbf9b093d9a190ea8d588a16b5ff2f72caa500a3cd55e0a0b7aea0ca5c41731"
Nonce = "a5087104d6327761d61843ef45cbbe88"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4b4ed879c2b1980112e0f4e627eff8f8c7d210f2606aaa2f7d26422c3e4dd3a66623ee501b702ae194b7ac258613e87f248bf49b40d0df4427142185d2e94b8e14570a00efcaf59ed542454f250475cfda7a98d1c1450978336f613f704dd9cb87b132ab60f24a51a1e1d815ab7e1d96967bb255dc5ac351238053602fd774b9223e7f079a423ef7b0a8ec9a71e222825ebe3c817ded31c2e6c68e9ae26feec7e75fd04157f60a25ad6c13734ea8ffcbf426dd61f4adc1a15e0693b420afc3035f7c847766430792b4fc78a32377a808c82ca7a2abc3c8370a3ff192014ffc819b5e842596cfc46d0c79546ea429f744f5b1acf603e65fc472d592ca07c8d19e"
f()
COUNT = "11"
EntropyInput = "222e8db3a1b1a95497aa0a141277d9c9c643d0cae5f47d1f58cc15c8120cefc4"
Nonce = "5836e4a886163ee0b2966ae82117b48e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e28b5015a08bb7b427bb90d734089a277eb749803280d5edd578fd4ab6bf48c3c6ad69176c116b3d98452e377c08bc4c2d06f552db3258c0c4062a498e22c438114dd312353e47444f4a3e393109fa4a33fd183b599ac0f7290726f9589f24a266e6214dbd0a165e22b277c88047ce9aba14f0b0912920560c89c658997590b4e18e7bd5989e956b0a4a05791c920adda109c598458209965fac49ba908be37301ae4f32691334975860014d63cd8cb4e12ea1052ab6b6fbf2728caa0d14321735a0a5064fa134276b7617bd081938dddd2fa5380284be2b16874b3739748d0aaa79c420d1a48a1ef860dec60e9a1ee0348854670eb289a36c6c844ec37164a2"
f()
COUNT = "12"
EntropyInput = "c648e453f220fd4568476502b7260069174cd037157de9021346e81695a0f310"
Nonce = "f38c95d2dd89f2f83a26125306249bce"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "43a9a34282ff596a085abba35356affec9178ede69c2abb61b6f697f8e88c1c89a1585a246e1ba6bab4f9ef2d886bf570e7e17b587bb5a65bdce7c23372eff0a56e66689a000c0d30620678accc0196eca5c3b28d2d7ab89e8919e8ca6cf646797b282062d7c61dc6bbb540b635117c75bc5184f821375b9a03a67f43675158a8a528b730ae0c1f35839a2301f38c229d40890efb10a68f727f8b92064d82dcabbceb764311a1ee66010b5e61cf1b68c2ccf20d15d8d50601f91bb75c5a86448eb230de12d598ddf15ba5ad9b65ddf9c3e6ffdc3708c1768a4cc2378e0c5dc16b9321a5929157473108ea4fc1d78825a6f8815d7a392572ac0e6334b496a218a"
f()
COUNT = "13"
EntropyInput = "19306c387a4da3de2f76013cd9c584dcf5e91a85a6dd35c0f25f2862a785bc0e"
Nonce = "ca0ef920312aa7c7dbcc510f9fd0c29a"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9e13d3d914923d8a6f3d182cb8b17bcaa961ac018af69a716fe9c95f091c7e15877892e001e2b6d656306cd8359a96638bb4a56f156b4a80a1ac65d2cd284c1374c7b54cce9718f364d40a6bf90ae9ed8b8fad347212cc4546b4ca8e19c3119b2723c190d705bc56e3b2b34e6340ffe919d94dc531d7ef5fd69e6aaacad96a1b2c5278c8735f2caebdd3ba69a779a3c8b53d03428221307eb026f9269d924d5db129c8b6c680000bf868cf65a6732975dfd31276cfd96bb98727b55470ec9391f345c1c2371b3333f5b4ebed9910f72e638dae62bab13caf126fd0e90de9c51709aa3c6975a915b34f97f0598cadf90aca49e961dc5b2b32afaf0801fe481561"
f()
COUNT = "14"
EntropyInput = "1436be35237c34bac5b5b36b24c998380883fb52621daa420112cb57bc84745c"
Nonce = "ed884f91a94c1b0a51f316df776283af"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c74ce568f0c465e79ef3700857cc8857b74ec8c075cada3f2698ff69569318b130b5b079ac5b69814d057097b0a107a546b011db601b2f7aa1708effd6479f383d7d484a5df76b63f1419eb360991475b2cd97590a1887487a76cd6fde7764cba5f101e4614c635ba7b1e18724a0a8fb39ca0948bffc441b6aa0216cf3c28ae6c06a24ad1bbe68970e06884d3b68325a3d7c1dce9a2fe87d565dccdcee7c62ed32b577763f510f0029a99530209628359bedf4bbfed1a13c222692d8cae60ca736df834a6e316db27642ed5839d2e11716a5c06e8d067e8548d7ac0687da801d292e2a6f414d7470d2e72261188347878d18e00fab3d4c15cb4c4a73cf963437"
f()
COUNT = "0"
EntropyInput = "c07c9e1d2a0f0b5dc0b4e9a0cd47caba5d2669e393656d3bbb8830e3a1d456f6"
Nonce = "c925484deeb0c02e1ec7a38ef5e36794"
PersonalizationString = "6252125662bf914498ec710dd31f0605278245e955e9533099ea9afb0ad6ef63"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ea3ee991336bf6581121965ff6a6283014f5c523d1dee5dc80e2721eb83a45b987d3a8abfa55ee72ed6cc2068588a6b8caf25fec88ab5f85ac642ba24e8414ca1e707e3d10f7908b186a82db2b68ce58fb47b670730bad51f8680d59e179f032de3a0f79723b933673264098fb1ec8f3793eceec7131cdd562898fa091571df4cd5e32026e7889fc8b659e90eab98baa2cb43096c352e58066ab913f05e728136a83d24e76b41c21ab6822c4ca4c04e14733a1dfd2b71a270b528346315609139005194b7f3d07bf28108af97f09fb374a57bb9aa7680cb9e78e2160c972e938ffcbabf12b971011ab7c1a91703d3c1c394463d907545c82623a3ae1d2af3667"
f()
COUNT = "1"
EntropyInput = "ef6b4f56c5db9f685e6ec380c464a4dbb95cf606f084586c58672b15d053d64a"
Nonce = "e16ff3c7a87dcefd6e10de7911ca6ed9"
PersonalizationString = "50802dacbd92284106b984a2e396fe6bb812d99854e400089aa90cd5f144269c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "879ebdba3b1b84207f6fec1a1634ca18367ceb5965f19e27e5ff68560a37604b9735adfc9afefe54a5fa2dad2518256d3c1df4df770f674bb7344b10930d1216af13a34605177f083b4e33709681def353db5af5a299736697222ce8b642e11c745ae8f0cd1b76f4ef769982defc93c1c70ca94ceb83f8886859ead2f726e3fe2f4bca26af14cc7709143c45a6a5b958d91660ff8963fe17ef2a8a9de834021298368291e2a84be1ab767b360d2c949a97261d69886d6ab0722f45c95598cf3080cd1c80afefdcc671cdc5ddc447342226f17579b49811bc247be11aabf9cf7ebb3c792ba2ea78bc0a790bd100389acdc0b4fcbdc207a90397ff3cc1797ba3c2"
f()
COUNT = "2"
EntropyInput = "dda85b63923ad8ce2bcb0b4b6b3a84a214b9002bb495c1ff8dd0c827e7a7666b"
Nonce = "5a8694dcc941d12b4d493c19cd570de9"
PersonalizationString = "2216173dfb01b06b657de3436d0664a388f808b60756149be8abdceee6f4cf2e"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9207bef177758af5c15d7d3966830b6ef24b4637b6add27942c6d424e2ea88f019c0461248d2617b9465a83b05dd41d7068a7a504c8db20ba0764e06b94b90c6bffa114fc60edd4800d5f58c423da2e50bf5da0726d33c26003711f12a7b0d6aed1011352a959d4bde66ab19102a18afd0a5fcfb609842592b91b00a287671d86779d53dc68e1d9cf60377319e338d3f55825b46bb5b7b98bd463ca8f15d2aca6085f213a51fb35d5dca650a27b4063089a354e6aa2e56898d638c2e344a3a0b4127a231236d2007a79e0020751f2b8a39319b98ec17b6c15a4223af59ea5c476f963fbf5169cbad65bb871819061df647a304fa3455efb7cb628c2dc208c208"
f()
COUNT = "3"
EntropyInput = "dd3ad19720c1d6c4879fa48ae23714bca5a1d66c0954931869185b48dbce099f"
Nonce = "48c5d647187ef550d19146ee9cb698f3"
PersonalizationString = "18f7902106c00d137e6b15a4bed0b4accfe6646128ee8823ac669e24179303df"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "98f4bf7e10872da726b3f51faeb78e7526dca37fb55a83b50b774e6104e451cbf7f369bc34373bc13812bbe7d85e0c1237ddd0d88894cc93610d9511b8c703aa337cb32a2a36f876cc262e2952fe9428b92c387705b6a0461e8b5c7674a69d6bc60db0566bf269c989ca014edf9e9a4b03179506cca38808f3f7cfadb64f3e803c343a86285fa12038acae76447185fd501d5a2e6d28fa115dee82b51dee3f3fbfe25e773d251a020f563aec137c70039b2fb19280dd6af9ff02b637bcbcd9e797f26106906f9592538f4c2a9dcd48f1ecb38f7c2ae448f21170ed80535ba1a8f54d75e4d716a848a27d49fd046862dda79f1988ba90e3ddf6b5986ff969488e"
f()
COUNT = "4"
EntropyInput = "5e2d0af8be964d1a61be969defc7f60a06814b957be5cd8ca15664f497794b71"
Nonce = "2eae930008a2aabe1f198c85b8a8d6c0"
PersonalizationString = "1199ca7cdaf509f81d91ffb82fde7c046ac4656d3b5dd0cf1074fb5038347e49"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "88daeabbe4e2a2569535426d288b9ccbad2cd69560575ab7a41059f59f8cfcfbcd0e2014407cdb6704b017778d5212cb1ce4e32d644c3b41202013f56853be5339df4213982c4af9ecf7159354277e03618b7e43d1f0598e8989820d523f656bf1fb337b50c983c90b05f87f4f758f0f087bc6699332efc4674661362f6a503374016808ad6f40497e4bb0e114d42015725d9b19f864fc3c5c5c0ec00b8053a578538da3e137c0b4be7bf851f106e2d95fcdd7ebcb1375ad3c73c9873e70081f699adaf7d84ab7030e3b223170c051b8483f23159e98ec9220e84c0077dd6953d407dfb1e3748b3eed11e50ca7a39f89a003ebf69e803ee20d60a6ac192195d4"
f()
COUNT = "5"
EntropyInput = "92ca3d101093735e51f6fd573831b25999b1a5ce1c097e4f77f4aafa6b4c80fe"
Nonce = "d72dbca1fee829ae441d39da0465e172"
PersonalizationString = "22e63e6682ce40e6680f2cc9d7a9ad1a596fc6415cf064e928bb1ab72df2db0d"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a5e34c0e957adb585c30195b1273b68d4cec0b345ed1bf59411733fc384d62d47ee2eede9fcd4e62781b7c2a03d5edc49d2d199f20a0942f26d97426e5c689bf7b6b81332ff8b4f9ec595e604a49c5752761c97b3d592ac04701c561a580460ff11351cb885c34834bc46d0584ff4fa9b449fbd9d03600dc1bd622c4e4940bb6a64f4ac7e71e8c23d52e1c348eff5b9b7f8b8f1b95682e53e8972238273956723dca7ba68e0e680d756d6acb4dab55d8a11e3c5b4c79d4b34905ab22c43c83dca629d84a14bb5bdaf18578b24d7c82b4661b4b17e77f733c9adbf798fbae707e7b73c812a60833d9c95d974e396cba4272f1310f6dc0ac1bf5d5a823f000d533"
f()
COUNT = "6"
EntropyInput = "e1d4f840d1a01cf5e3baf6eb6aab35c639f60571275f1c115eecad9ec2758f8b"
Nonce = "f5c70fdd75c0aafbf443d897d31f181b"
PersonalizationString = "1a4cc8a65d133ed5e0548f770277d0e3eadfff3c24f09e00f15f1f0ccee00d4f"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a194fa818179426cbd54eb333c2517054cdf917529d3a9e589f27dcdf99fe3c342b95f4f79806c236f786a38bbe110a8693563ab67ba6568b45e309a6d245b1f87ae2d48ab1d3ea36cae52eac12b44f4680f2d611ce9c72f56663fd1e36fe45aeaee8d4e996c1f7d38aaebb0b531e2d663108994ba31a2ce149d5a32452377e05dc4a413df8dfb10b3595df855e0e07c2a347331e871c0b00139bd0a2ecd715a4a5a4e85239f466c779d96f44de09142bc40f3a48390f9606d65386a214d99932b0ed3be2af18bb0de0d05e8a875334e62291ae6c0b91f39fc1586dded2d2fb318f2d26d843332218798faefe3e9e3425502efdf010d1dcbd32f6343f3c85f1b"
f()
COUNT = "7"
EntropyInput = "53f51d0b68808fb3624fa264a1fd9256f59c248dbd04f90e516638f95f91f58a"
Nonce = "67fe6aaf8f40159e194a0cff0162ded0"
PersonalizationString = "6aa803389ba0af55905fd1873fffc6c9453034a363dba07bee0cae6f73254fec"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "912f5656584c52f95a4a503e26c23b99fe2dd4b96fb03e8d86b29d780bb55a0086b3a77a67ab163c56abde4ceb6a68c4b06eba82371f587ed043739e12cd6e722a6d73d01495ed89e35dddc2b794ae7155179c609dc4f9a7edefcb4c92e1025aff94a9d24b7d84d70139051a5c1e6ecf2db9da2f6bbdfdcf613dc98f9008d444e5cb59b17dfa7caca4621568f897f77c77a5d85eb4f60465cf8f58cf5d37ffbab4d6b1a56136ad14543e015ff7a225bacf8781525e96c3e31b8da29c6805572620feef74b20360764fbbdd06233f1a94905c378c66ce86066c12cb92f8375fbf14f4fb205de70ef7ed38b28932fe186bc10f6dda1c73c20e18718bc6b59b39f5"
f()
COUNT = "8"
EntropyInput = "47369855076e8388e990cc50d9eabaccebb582e6c369a99b6060424fcc23494a"
Nonce = "afc19984384c07a8fcb59c8e63ba97e5"
PersonalizationString = "088a77b7655f59f2dba8fbb3aed15499e13342d66c7b0655cfb1b1395c725b44"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6f084fc8c0b936aaf49e1a98f3a96846735895ba71b246a837516b6c678b5f6a8b9a091fc6bab3307f428e97eaab850e5cd014e7fc356e2af6c8d673fa58c1bd201fd8be3f38759d109bd06d6452786d230700ceaccee38fb0de9dd05a5f9d0a64dc447ba63f92d93c58464f5a14026c4e2d83d8af8da039839552dac49fe50ca95fb38ef1dffd8ae4c1ba5640621c087118f8d71d69cca33cbcb58742a16eb90bdfa51238877e55bcdb018cba252e26f222272a6c267c28be26db945fb4f0cda1c0b4ca281fa2a85b2625504609fe86005b9e71237bf50c31cedf9e13ef022d6b348873d9f5eb3cb9a980e063d76c9e1baab412eafe3f6980e560fe6d8efcf8"
f()
COUNT = "9"
EntropyInput = "9770de601e4657b3746637e5599a79f4ba210bb03d8805fba3fa1f2f26737592"
Nonce = "148dc9db3e1e58a31fc21e596dec2324"
PersonalizationString = "5bffe17060a51fe205385ac70c9634873cee14fef7ce2fa8970f7e9ffba450f8"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "30339e731f1f4fc03c326affccc77c23678f6ddfda53b944d9ccf8429b4ff06b36f77e5e0fc378d083c9381e8de0a24285aa3b17dfe2ce7f3fe591afdc0e9a91e9a90f69566d104bac8086781e543487f652d77f836462b01a3c5f1e8208ec43f6f7aa78bced28b9de9b1de36a468630966c0762e31f6fb8b0d07a86210ec395aac19c5a4f3661c9f7de171106f656f705ef14e7f30d3bce37335ad53093f5dfc1971c39a0fece8259800d1b022de76cf250bf5d2a22ff62227a8a4176f9c8308bfae7fa68c1fbe7b2027254c39a161ba4280e38785f664afeaa3ab2df3c99c28939378c1864282715d16335c8e75a085d7f389aeda6c26c331683fce2d01ace"
f()
COUNT = "10"
EntropyInput = "381ec64f6818df09b9295dae3adabcd409e6302d5434f15f37ec9e5223f08a05"
Nonce = "deabba7b30c167c6e6876b63983163a9"
PersonalizationString = "698f68deb716fa4258dfa3869119bfa258b0645f9742bcc362988251276659fc"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3533a7cf3cc1aa7b16ce6be85d863b65734649b6668fd63dcbfa92a320af14b6f2bd01008e6a7a2232f36b4891a566723d63c4915ecc00915c96b0f50bc999d3ad4783b8e3d6157b5204d46b2d709479a2c5059ff8e78cc156fa8b57cd51ecde4551263397bf097a3d659bd257c9b1b3ace8d062007ef7595b2a25104aa50aeaa870714b47174e4553af3ae88be087e821bcf44ea0770cc8591a115f47d89a712fcc6707380c48a5b121c15cae84acff7adcf5fbc1d9abd47eade80e6eee46246a28b5da9ff4521ddfc1cb6b34d1ab4ee79fa18eba29a1bc7c10bde98653e732918b6176ad764f3ea31543240beb406c473f1e60f6b20ab383be850ddf581cab"
f()
COUNT = "11"
EntropyInput = "93c686ac3e6a7d9a4b70fa7152354f3eab1641bc3afa7b4fe4629d94613d359d"
Nonce = "2c0b9cfc3c188fd6e16721ab5186626b"
PersonalizationString = "86602b7ab3e2c375c39eb6419b3e43463ac13824ca92f138f8d4f774f81a93e8"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "47abfa2d8ae584ef51c493c4f852c9d198b64a6ab238ad10fad1ae468d4b79fdbd5f37b217e91992dfef34ecc1198218ab9d7cfdcafa7fd53aec3bf4c04be52f43d660805f559ac5d9a6b7a27fa6a9799bdc7a00adb6617816060691391070f102c134d0fd1687148413efd2d4215ea5e2fa18d270fba542069634f2255713466a4086c09318043934a884ee2a1dfea4a77017883402a222d5ac3bd4dbfefa1131cab7f2590d339e848065a82f6a3cb366cfa0d6a8582cf99d32e89473cf7a7d2db63e964e48557a1210499beddd73073028cabddf737a8ab9b7ea17f4ed7bfb94c80f03f5f0e5ea64f4b59eb4b3dfa0fc1701c3a2fa7e588b0d4e9586560256"
f()
COUNT = "12"
EntropyInput = "3aeefe3b75307aff285d3fe8907f123a9fbb748232a11ef6bda3c12c86f20228"
Nonce = "98de460f9c004152bf9920414759fc2f"
PersonalizationString = "e3c7a127cfd509cd8944f762c5991d9de53c7e37673f2208486c3bbf8ab50b98"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "10b72d019296b20db00cc383abdbaa2b69bb4cf3296c4fbf82fdcea190d09115455cbc79bc2a373dc04fa52758fd21e1012e86f4b4ff6ccad0dfa1e5a27b619e62fece2eb9b6e65c5aa5fe22867304d46971a6365e33f60821cbec79546010433c7771e911a15c2726ad039680011bba5b6779bf107b98c596e4acc36de55e8db936e512318c051950c60f1ff4273bae501b2b325f375c3ec10a4f0d076e6be9a146851e661465692170037b01c49d17ee9c8e42545c5d6ab58ba1fa2c7322e735bf70c1c8266673e8dad1cca8e6cfa1e601be95917184677b7534dfd2c6f1640821cc675794b29fcc71df517cee4ae6efe95d2fd866939aca4400ea374a8acd"
f()
COUNT = "13"
EntropyInput = "bee32aca74973a8b63b36cd8ac04a68f36484202c6249ba92cd33a1379ee2e6c"
Nonce = "a5d175205ef0278c9df481f882d482ad"
PersonalizationString = "ac5f8a3e150849a818d0170bcc772e0397b7c70cca37a466fb774bca78e4d708"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "22104a4798cdec3742e654aaca8122f69437867fad058e34e840bf94d460b61e2d7aeb653ce8c8723c00df1b4f77eff3a70345c1a2b3fd601075667b5cddeec75bdea28a5066833f40b50d7350b12a5cd93afcf19b353d06083acdd05f8c8b64542c3ab2b4ae1283df7fcdf747d3b0bbb3ec3345a0f8fcd156692a4a2e6d887c8f3da7289282865f4d75e0ac46cf06b4a93fc0f7ef19aab22290104095cc1f94b03688c7b3712491b9ab2990c204120a22e6b08e1bcb3ea7550262fca5bebf28b4e062e62085ca87f96d259fc17da8cc0f30236265668e2590a68e8028417e4ba0edc1622a6f1b4d8bdf9519aab87beb2f89888e8b3bd6a0d42107653a69427f"
f()
COUNT = "14"
EntropyInput = "cba112f4a75eb3dadb31a728f3ea66ee4671e971a313e6516ab3b3890f7432de"
Nonce = "70916df78dd9ea799230435b3e48686b"
PersonalizationString = "bf755696adb9c92839798798f836b063cbbe987f0163ef3f4a97222c888f5da0"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "411cd8e76e711447e8a93ca95aa3aac5e51f559d65a8385a15e71877ac8472a347d9d453bd6761655711ce2133900d28e41cfd1292d28848646e5cbdcac1e60e49e62aab169b1735e701e38d65ccc073f277972ca85444dea86c19c0c08317dbbeca4fbd5d4295c9da71b89623d0028cebf1ab68fd0aef5b37e76e2e0b3e7f72eee04c01b6afb180b1fa0c370975526b788ec4db076a16a798671451af3e20d323684e232a25d78aaa8ee43f734f1555bf0a324053c7c895dc3e098621e189962a914f486cd7a5ff330f39316afb762b1a06cf8b593ca00d7edf739e2e6827a7af662f33bb09fad09d6bdb3a565f2bd32512c79927d390c79a1cc6db968b13a0"
f()
COUNT = "0"
EntropyInput = "b8986abc6b50516023dec0e7781e93b4b03848dde5e52228d294554df1c2bb00"
Nonce = "f33c24a6daeac094c1ccd55cf361977e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "95b7f29293e4a8f8482708020c7ecd95dcf05cdb3df4a4483b686419c74582b9e98edebf5ddc6bbf9814f17f6d46eaa90cf3c13ee1747377a882483729b3adc9cfb3f7d4c0271347521aba7396f100bfd57083718effdc69930a6ab962afea0275c667c7152f088f2019c44b416eab94ff01c243b158676068e4fe44168073e30167a57a4ff8cf8010cb3bff991f4e93e70db1e37f40a7a82d4faccc3be32b9135d027d95ac543b632a310620a02e3b470a254e9dc98c4e99e0136a104312639809fe0dd94ab03a2eeeaa43ad232e3793b4aa7b0b78767d11c85d2f87f7849ee2d7189f1e4e5b8b08bac8464454350f1e06e7b7a5570071521a7b7b3b722b8a2"
f()
COUNT = "1"
EntropyInput = "91c55c82bbd72be09529ee915eb2c9cd13c7d2d892aa2d4bfefb01e427c348d7"
Nonce = "9d117b412eb74a7959bae27760f40e2f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "63ccf23c51a7a4b0c2ac4491b8d38ec2489236597a554da8436f5b4dc1eba5087f8bc8a4f01ae07bee9e98e571de0120b7b6d2f6dcce99993a669437e52b2b2c98b0f63db9f724b42dd182fadb69be98ace37f12e1d27ef95f8a3018d8948a20c6b45e3931f659a27ae20231ee323d45d8de5ac6d8464a2712d73cf5241d0040c87129be676689da5f90bd50f5617baf6986d1b9d2f691f6bec73508b82164384b65472ca5f0e6390bd983c8ec75a3707a9c019ab559a7a6e89ddcb9254a89bd413a037948b94e6de4b191a251366de1fd8813b5dad261545f868ec907d0525f1201c62bf1a673b901b3d9d44a362f3d2c7cc3a760b2c9948764f8504cb29a69"
f()
COUNT = "2"
EntropyInput = "dde440ac558146a64d1e2c2f87eb87478e0bbd74e136e689f3d265256e241477"
Nonce = "fff859ca9364614d9b5863eb66241c8d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "106f18c8ed2c030f51b4e93558dafe67172b90d87ec55cf2bbe05ae4e5b4aa1ccc48d8e394474c7df81a1c251fc7e3e6ab3c19dfce7c295f254bf11cd7b111b78ccd711fd87eb3befe8fd7eac04bc74c9c5973d4d1e49a6906fb89bcc7596a2d5068aeb44750029a2527ebca0be10a1a1cf6bfb07d76424fcaaff1a363723de6b4c0e5dc571479bfaf2867fa367d7d959b948f45b195ec62132223170f8fd4afcedc7a00d27e61fbf700f49d75dbecc39a9ae57e5f3912afcc5332e079474c4b9e378583c55e3b6f073701d887b2eca9bd847b6465318b1a449e3eb10b0471a7777253dd183c61805b0d8014467c6387fc32d96d4eb52ba83d3db2f28ee05a2b"
f()
COUNT = "3"
EntropyInput = "1345c9f6856380372ce69dfeac4ef92df722f03ecc518641706a051745da310c"
Nonce = "3bc180fbc657cef9407b75d1b54cb1e7"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c83d6366f2f83627b33b3c656a259007a0077cc81b898dd4d61df0c29a2373fa40437510f34a5752e25d70641936f47a37c760a653372e557220d2315815542b7146f4aeb3ee9f9ae20ffd438e252240d8b2e08b0797d4cb1e066003b76dcc678adb112a82b7a3ff1bf8c65452b302571d5fc02ad3f32272a6a386e3c977e756ecaf2d3d02e8cc093b862897ce2e5e948dd8f734d55fb17b07c16d6e709d79e6e5f55f9ecbe6e273a17d45822ecd0ffbc3c6c414a0f9e48e47a93fe851f95034bf26dcbbd1ceb9393eddd6af5532b4890b492217fe1f88befd804b6ee1dbd4deafe0d267ebb3d3b8811ef3a56cd6a3de86cce946640857a30f2f50bf2b49cd81"
f()
COUNT = "4"
EntropyInput = "d732d597e8a0422d76f6e50efa36e3730f59e3ecf79e315417a51f227541c05d"
Nonce = "def492adecfd386c3dd0182ffef8ffb4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ce4473c4d793faf305df6e140dc003789a07a30baf67ec1536f7aa9a7cc1f471a04bb9572136c171de8db565f2699136e27b99df40edda1feffcc2dc69105dc1cc28ed89b16043e11e4bb3d5d7f6a1c2af9a2682c50059ecfe1703aa75246f6e0f6059c3011c52a572851a9b6a833aeb9ccf2849dd17fbc9e83a038462ec9ba2237ae49abd362d3e8741bac32785296ddd9fdf65686123f8bdd880299a491e9236353321bb61251582c2a101a236b94656af99ea28697369e5e94b00945f8a78407b9a8271f3e2ab4c782c13a5e5be75537adc659ab2d163dc126460e9f6985dac8a43fdae67502239c85f634fe48064222ab8c3e74e71f8170a4c1c6c5f5951"
f()
COUNT = "5"
EntropyInput = "5c03a20629e0853b273a8c5e8f89203740133523221903a50b03ba6234d6625c"
Nonce = "45501a3fb480211f9d2b905ea7594986"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "5faf1daeb0830553498d82ac172c0772d8dd27da798244ab2c6757b52e0e0a296778fdd919b39878e97a22db985d2c6d68b67b73e6e43fa9fce011500aa9145ba44b118ceca3d563281fa4eee23f7664d07f1882ee5979974ad726d37f43bee6ee7a16e033116c4ccebf1f65a859754716c43b98021bd588c79bfb1926db0c0211f7461be4b273f1a762fa978b04151709734c8d6429c9cb2dfb25784c9576847c48433f7b97675acb5df1433509f074e0877bbbd4e85aee338c734e53f06ef895f62224333465c35e6edbe0075d9daf3c0c8e1bf690460bd716792a6f78f0f47a408734317f6ad5b1d48754c24faba2579bb49db0582dd4ea5e2b9ccfda0579"
f()
COUNT = "6"
EntropyInput = "ceb630090ef9282f160d091a8e72b664783dc3fb75991f3ae1f7c6f73a2af906"
Nonce = "7c00f71bdf80b23077f1f5b023c6e2d3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2c8416d3b2e9a4d1d613b5e15d8a11d47893a625cede12d0a72b2b3bc51a20898fa3ba2277b5a6aaf1533cf89de5bda5a4718a303a6e34ae7faa1ab282b96057459a743be70c4d966824ebdf872682ac4a28d24ccec49c5a8e001e33bf56f01a0d33c11669d75133e8711b763463e40462a78fec1f92859306c3515986a56aa3834dc6e9fb6adf4c59519f288c80519491f1c0f3ce10d06058ded3ac519918156427884b431bbc13d3aca7d10e0674733c55f727e18d84a5de635d92fed7bd08957434367e803fc2c8f33cf41068bbcba158bb28dc0913ad6456c3f5208413795909c47e375292b7d4e2e23a68df5ae3c5850b18b216991079ae32a211c95da0"
f()
COUNT = "7"
EntropyInput = "76b7040ddaf267ec9336ca11549bf3ca5b7bb0a8e5f9f5d8590ac8b6cf7ea1f1"
Nonce = "0dbc66c634c191cae0b2f868cd1e3ad6"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2895076c2ab15efb5ae7d61fe578f78301bd35cefd33f1e752a5bcb18a65c197479efee3b262277bc7af37bb6b3a2e18a2e801be374745eaffe26064d0dfdf7fcb173ab4ab5ad3bbf99c27a90cd4fc874b0dfb729981ec0d0087594d191f353f454e8e764b920630b4a9821f1137164f50f5d29a3b2d85c592d6a01bd3d3647cfa0e3b3c010039b91d567f8e8f71bf35b23bca871805ea6a3148189c28e703d4f87e34fe52d759019994b7ffd6aedfd4eee6f05c96a46bb7a3550967c7fd016538c6fd35708b4f74b6c4505e0af52a221af880d89be0ad1e077c94e9321608a11d4296c3d2506c6ed3dd7497934068604bc3f3d8dfc7590f78c88ee6bcac3ab9"
f()
COUNT = "8"
EntropyInput = "576e23bd76a4db151397ba4f88fdd359aa2bbfbde4d1f5faa3341ef472ca552b"
Nonce = "49e936bf613e20debe5dd21c69109806"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bc35bdf36345602ddc9659401358ac23b4077e3b27e2655d521c6c41ca8b3e895f572a175e6916a38a6844cd5b7004b5fd30972bb2ecaa1492c694fc951c84b782b3acbf5e4e492d200ff5f0e445d0a0a0e6c98a8b9af6e29dd22a4947bf3476c04112d157636acf3f01286bfa9326b0c6c1b150273434349a4e2fc4241d1c70e50c2b60552bb608b37825f5942467e407f8c97a0d41c6d6687b26a8518d3faf08fd2a2f2ad770d3111bc0d4feb84a17aa0e94fc21fcab1027c5dacb66c8b6a47d93aedfc2dd9736eeab146196f9f689627958886f2a59436f652e5385799cfd2a68b3fe7a9f5e3c3393113c07274d4779569dbc00ae688990354387c0bbd93d"
f()
COUNT = "9"
EntropyInput = "b1a179214be05736fa7347df9c48d5e232daa8bafb3d4f97200af85efcd4e3d7"
Nonce = "45e7d8d1df1cce8e4c7b8440497523b8"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "434171f3f7354d83fec4db3d3661c711af86509600390f65a9bba8e441012ac77fcdf571d8ccd0cfd251912ce649fc54635a058ae7ee7cb6f569b23f878ddba61a7697f460e38886b6c87748d681e92f0bf9fee069518c54e8ec68e97f8a37abb2ab3a52229486150d58d18d1adf04c0da18681aacffc5aa930c3917b363d5d09563a551d357c36f0a4cf8ae1ac19929483f38cdf6622e6920eb59f53f2adacc373d7de0d44fa850de05c8a6769cc62fa06b1613d8027d926858aac39b6caf61d2d29435aefd106910234b1cffc5cd44ea7c09980e0841c7de8cce4115d5aa570b842a66aef9e2fb79be1a5b80b4d8e16bf6580195d88855896a781f7818de65"
f()
COUNT = "10"
EntropyInput = "9246151f2e277d5a46b79d0974eee76bd6a47b4d0464e01c00155697bad29380"
Nonce = "43e6b81c6860e213f058e63d2f3104cd"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e72f3fc80993eb5c3cbd9b1f5012b53d33e7c7fb10cc4371ad20f1b80945e41b4e7114130fc5d86aa3a2869cc28c8401708d6a52fee5e8fa610ef5f1bed0b3e6392a9d238d714cb4d177858508b0623ca80d8458509b12e2b9bbb45482c68199a9fab0d3b3c9144d0685b88200720fc0a58095603851397ddfab4b1fdd014aa893fd3821680cfa9fdbd356a62cb59939401715cd2ac1f878fe78b4754a5f0c8860c6fbe554a95331264ae2b5f918fcaba26b32c1ee5dcd9722684e7f5d7f18c42a1855ab7e2b504c6af919d3fd2e3b0de2022afc88b8e9082fae2949389456f323ecf76ba43074de7256b00ecbc0ce278ecd8024c37e684c1af05814ee2ad34f"
f()
COUNT = "0"
EntropyInput = "edb77aba67caabf66d3c8d413dc36566b7dd33c73d63e960ada87cdad9dadbee"
Nonce = "c978a652b5e6ac2a190904bc40d6756e"
PersonalizationString = "9b383b001677ddaf1170ad611a6290243deeee5d66800c4df57d9eadea09a427"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "44c890c4ba73a795eedd9166cbde015048f77ff2c66fd44897f6336885bc7549e624f203ad2e89765859d1189d09658e19e4a30d929a896db54df1ad5c3fdd8b87b8e5f90bae3bd9e9810e3cefd816320a80aa8b2ddec800c422befceaaf438005ae24a35568047298b136f47d832fef5ef8a1d53e8a6f1f89ee49fc560f80112f7d40859ab8c7e2e4a4618da79b9968180e461a15e341a20f4e180ea4b2bf01815b161182a282c9524daa408fccad1e9801daa13f1d4804bdf396fa46bf3b0be4ca9405c7a637616212d96a47c484e15ee6e62293b2ddbfa1ce675c93e6d893ae33a66abb7f1a54f7bd23e53907c75297cac66317ad5abb00006de77bf9d9b7"
f()
COUNT = "1"
EntropyInput = "08f94b7b7ceebf999c850a6b83d499b045c421ba32569a81451d19ca4203d841"
Nonce = "9d59d755eae840fbbfd9a37e9e02ef07"
PersonalizationString = "d5550e16a863843f4cd187bfb650f683adbb44c86d50ccc21f3e7630db3335f0"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a2c62c753a64e44e34be03981037275ae9244b016d05a2c9a63b36fc611c82d4ecd819c1d3910147b25b7bfbee0236ed6711a4293825c5d57cc1c58af1ddcfb8df533d81b613864577936a84c88c267b02521e17b481d61ce19c70ac625952b4b7900bd3e21b66728406a7eded21499d7088aa60cd444a95915ce7767228c9bc4953d53f46d90f67e736bfd7dde2442ed01182253aeb8ea827f3049faff9c210e99c4b33ea6e623ef7b6d2c975c374ddce64f63860bc3c9db27015d23d97c27b90bef3088cec88a3d0d905eb1d11b32596b6b35281bedb3acf36f61feab9dd9ce9fb299f7d78e50404640827851222cfac558fcca1848da435bef281c739cd27"
f()
COUNT = "2"
EntropyInput = "3de25b41b5149c54af8241645c5b763c035217d727727bc3eb48dc50b2154192"
Nonce = "0da29b48baf4f732099e4eddd2fb96c7"
PersonalizationString = "abd5ea43928042b4618c2a8933185fd94801c6cc2e30f855e403cc403d306356"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8595e3dea6d7b4849c1280fa4ad3b99f78922ab1dae43869272396db1097045a66cca3234639798dd0e4e3cdc07154ebf4424de58627eb42724e0ced746bc7f87695d2c911d551bbf9270b9ccaa0b2903db71d75f6c3ad764e109d56d19d388da0b7d921fce449e8667814a9cf0c4115a01d81e49ea117ca1489b4f8c02961c9f9118b0f4159269b40fab430ac65d9fa924d0bf64499526807c8c917de331c519be4df2f1a653934fc6a3c39f4e2b4c8484d91bd5199a72655b9d54d813552eb55136d6821fbb4c48866a6ed9bc3ae1625b5ff5e7bc1d43a251972d2b397fb0c0e9def966f9760d98ee995acc744b9ddd707f42f27b8d8d91eed8bb0d4813f6d"
f()
COUNT = "3"
EntropyInput = "1752d86ba9b212382357f36854099c9b7f9cdc49324b5b1997bd89827d80009f"
Nonce = "7327fcb73b868a9cbfcff006887e24c7"
PersonalizationString = "00275a675d26641f1ab35a7528984a8dca8c97ebab8eb6eb28cb66fe84221ff2"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b81c15c53d887dcef3f883a7d59d4c9c9a0cc12e025dc35edac3bdfddc103075aef3f64a51082bb4192acd3506c485ef3860c3064c58189464540a81048492bbdd30bf008bedaf29c0da72f074dcd1de0a960ec0ba7bd14d9f2387a613c3c90b1641ddd7c3fab4dc87690d29d0e04ff239234f863d82411931e2ffaa1d145f659309ff4a812ebd0b42e73493236540a5f01eb1b16d9b708c096308696fe0e6ebf082b8056cd52fcc5c3dca38d63a6cac9c511bc868a4d66df93474ea8d2927edd1e82860de415aecb983891cc2fe543a2ace004049a9e093e04d4f70de538532665168811a460b266dd67bc690c85978be0a842b39d3b2dde330f2f9a73afb87"
f()
COUNT = "4"
EntropyInput = "beb782e041c9d9a5b139e53d8e08143e0068542cb2b7e5db08499b956eb8a886"
Nonce = "cb85d7488309f168aa876d0734d3ad5b"
PersonalizationString = "afc9951f1f4a984a9a8df813305d0fd3522bb403964bc59a74a81ed0c85c2310"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bfaa34c4fff641c7aaaddd740fba23c411e1d8b42fb3352c1727784880625d1e361c27aada86e9576769428746007526d5557e391dfdc780fe07ed6efc11867b09445ad1b7e2e2b0677347b9115af686e260f5d931b2018853120726670d5614c6baceaa5af00c0820ffc2a05ecf892f86ea228a8be5fedea5d92a8da790bc124dc9088e39c40ac841d10e2d62447be7d20148e4e82dfc84d5d43a47ed3720a4d3b2c2bad818d4a3aadd5cd82d8f7efe0b78f9968470f2e68dfe00c0d58f9c8d907b39416cbb649aae921e813991665b26cfb454065b0f29783509dfdddbc9ce44c117bb21a38c99ad566ff606fea27d2d9e67b4c052594922245e414c1e3275"
f()
COUNT = "5"
EntropyInput = "d5bf7d62d00accf87cd381fbd180da753d77295d2686363694a701c488ab0c41"
Nonce = "6b20f1e0dca4e33d41ad2e1e9c208f31"
PersonalizationString = "eaa87c33076d80188b5fad9b2a8a02bf86444c44da180b96d268b8cfb1542390"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "06526cd25183a00907d645d24335e149ca77df7f85e92748a7a87b61feba04664bcacc26bd3b1ea915ddb05efcc0afbfe9b0a589f059a8e683bf69223dd192bd88f3e2aef159d330bdcb594db1570d66efc1ce9815190e482dea0f49ade057e3877ffd9a09bcc026bf4e067f7c142b0745af14202172b20b22917d040d222aa88ab06258bc05bb9fc82127737f1469ec9a09adbade7a0633bd17b7fbebf6d77d49b53c1504fa1d4916dddaddf929481530d56b27d5380d102e922b359721e94d6fa3bd3f28246b9dd92c1008368c42bc62848a8d190ea63fd5564551576158ec1bddf335e3a4bf9b46766a187b3092b2992e1e6fdc946f037de5a8b2d4e90c4c"
f()
COUNT = "6"
EntropyInput = "5a85a9bf855fdcf49be93d2526a919a4894c0f3aeb309d40f207901ecc0fa28d"
Nonce = "602a3e7262dc08315232d907ad1f59a6"
PersonalizationString = "e5e345b3561349e4d63dd0fad99ee220d9e619c88d5cbdcb4450534346a34b27"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "349fde44edd84d380e8874188fa96cad5908b040c45555b819feefd74548efb4bdaf65d70d8df66ffd0ad8ed1164d45abc8d7d13a0e8e926223e154c21315dcf682d8ae7fbb4b1b3152b4bb847864935987a23b3598b1fff783bef3285d42ca902625e5512a579a221bc901ad42e256d4a6d9731ab506c31d4f415a3be31c1922812c4dada6aa41f2cc6b2093665233c67e9a4330972fdf37b388d8548ca0662e144032b4b6a2e0c2eec6aab7d7c0ba1358e2e0b301bbe416bae5acc79736f43668aa9e5371ce07c39779b2d13e25042db12d60e97fe1dbb5bb2c50d84fd1b151a3f2b1ab48a994354d2ca1f472904ea744cf58dd0b1319bf99a37da6f7fb994"
f()
COUNT = "7"
EntropyInput = "a2b343ca9c9f9529ff55e63ee3ae949a7b6b503746dbd8f7d6218ac80c0bf9b1"
Nonce = "75cf81e0cfc6e785f9726764aa4645e8"
PersonalizationString = "a59dd29cca65bd03afea186a4954ef29206731fa886a48206ebf7fb6927a3e48"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "d6cf433eca8f0666456bafc8aef685dd0e754809484c24ebe02540eb23aa1347b6c7a50e2dbefe708721b4faa6c789a1bd6713ee9cf90a1ebfea3c3aeeb140cc98632ed1243f54089c5a1ad6e417b07aa2fb6c499d4a61243174c710ddf884f6b4852150ca52b9b720e4695ae896fcce789bbdcdf46a294c745d87d396fa9672e7bcddc44bb3f60c311a188666cf8881372df9f8d5e9c043ec407f88c820efa189256d7c1c7cb80041ed2adb12bde1e0d6c859436c7477af255b142cebeb166e1620e90a7678065c4af0701b56076417723756929b11b2eff02db9c453ee8dddc972cbba1609582bda90a0ae87a66939937e4f77cb1d377232b4616239516ff3"
f()
COUNT = "8"
EntropyInput = "8ea56a01e2005c37c31497fd29737ea3b4526dc41437fa458f0b5832ac20eb62"
Nonce = "d943aa0cd94bd4978aad7c73780334fb"
PersonalizationString = "1a42ae9e19b372b72c1b531514a053ea1a78666c16923df2f2e79e6180006efc"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "d6a2ac0a8ad361cfd21fdaabbfa801a355b11b19a1ef8bb273c4467186df3950aded4e5da688d791b82480f8f153da515624273839c737e104d45546e3ecd93a6dd264632109c64514a54d6269e4b532451ab5858f5822e1f591dbff0e059b7f3d4008b568a4ad5da523310a5b26d8db5a567ab4c4a06152113ee8f36a219630391c5dff713f1533f5bc008799156260d6651a40d37ba3943beed438ca200c4ce9fa7ded15c7f603ef42525a44a11d58ee5822085d5b20ab20e7edec9e85b547bbd69bba771ab4c3ff826dc431d6989baf43c9b6290e49d03c8b9994f84f8a284c8cae9276dd0ff1f5b667557c23d6992ae9fa10331b7e9bae6a8b91522215a5"
f()
COUNT = "9"
EntropyInput = "519b1945befce5d1e96187884347ef9b3cd4e5071cec80fb51c98c67c453c442"
Nonce = "2fb7d601b274bbf70e993d28e0ed8e72"
PersonalizationString = "3b80d6282d60ddc94765a1bf565f7e852dc1f02fbdea78b69618adc620c1f40e"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "84dd67414dcf2958a46055de4fc10ca01c25e6cb267382474a5b9d2f1368a57304c33775099e503f95ff1210d4a67d2096c10f1ec3bf20d743fdd76ebdd256dcff2e0cdc5a33eeb53ba22ef8a4fe3ca9d6cbaf80827256b43817cba35a348b8c98030d0533137b503f32d3857aef2dbb28d77971795aba9c13083f60de3384a521b57492708a4acda3a7dc4b23186835f03692cb31e1de591f52e6e75e7859bceace3e1777ecc049f3998a70144db83ea86fc064e95efad6e35b4106c297bfb2755f7fb30addc540c89a5a8851174ce22fd1b7e836fa05e4808a1a407ba0afb3532c6cfa8f0e927d958a51a59c82cfad3f871d52e14347f156288f7993dbb6a0"
f()
COUNT = "10"
EntropyInput = "83cc514fa8ab6bdfb3336054192fcbbdf1ef556c3324934cb37ab2560fa335db"
Nonce = "af261aca6c9304f2da6aacae2dc03883"
PersonalizationString = "786925c06d3c492a86815236ccdcc4accef343c8f38ef3ba5faadfc85cb8cd14"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8d0e4fc80515d2e3eefb3502227dab5ee4351c91dd01044c7564fe8bae3a73dc08e9ffec5c8eb9f5445c2230956cffd13276dc2567026602a3f0e7ffb355073dfa01730800e6936425a8d26521e67fa309c426cf70a4929f49cf095e792727197ce0d3c9cc1ef4fae13f10893dd9746c7fb50b5e796dccf7cba63fa906a55d5dbf069fa62ebef09501dfce2f5256589cf51c36a01b14a81d0cac61d72c7a9b8d4af509ec7d950a137da62409a71c61328ff3c7494c6267c23a535f592e914ff17a6d9f5d0c8115373db101cec89f5bb8540e1156603ea965c8728c3c6f80728e5b998aa272941c06264605606b666b328dbe754f3f208b084cc7ad8ae7c7070b"
f()
COUNT = "11"
EntropyInput = "14f2f83aa5842c9320e1a3ff8dad7c5e4ba0862790e3558a2c72b2de80f7f79f"
Nonce = "74eace5391ea07e06086ac349312fd7f"
PersonalizationString = "42aad660a98483d4c1b67bd7e21d0bfb68ff19c6ea8f752e8083777e5f619bcc"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "babea6d83335979e5a00ce624eeb176c3cee353b0a54fc527b3e8a0cc50adf9ee0b1c593fc7eeb9172360c13269f352b589870275b19b653c486c1ec029c115e138d9f87a4dea41f68166f8d4f42c6c7db7240c43209fac2a6f4c51c942b5c660a04d39d9de739ab559f3ec36dfdb742a32af806d408da4f786fa2ed2035571a21084965c6d6954cc12cf222a94b6f38791bcb2add8318495c9acf19c7ef57e410d4abc49c290309a5dc7baed2b07cd6198e0790819bd9a877c5419c863e30ec51a761d042a9734a365d90795c24e26802d20ea0f716524cd4a0ff51d477d0576576edf380c19df4f02adeda7be181225af4531e8ab14507460604bb343cef74"
f()
COUNT = "12"
EntropyInput = "00fc95fa83856472b00b768fc708a33aa34f2ed9131806db181c866afd1462be"
Nonce = "d83ab71ea108ea16515709e570e254d3"
PersonalizationString = "fdbb2d6bbc8a928fe4517ee72aee729d0eb1271ca81af6a5088238431ceb7095"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c081d6b891989eb071bf0a0b71c474907265be63e377a09da9a960242031dd90975980facd28cd796a682204f82283748bbb5fae826fd9ca93aa1bd0defc349de351f7e6f20e21a0ab8136228698035aa25fcae2167118fb45209290df4e6913d0ab1c86d3c9fc6f6e0060888298fc66ee23654c084126579ec84695f3a186f5ebd25785cb46e9a59e255625e2818bad169e6f7cc74c534d12364370faa8a6361f9e7bf555d67e7242cdb938040a26ed80606fd06914e75195d534726318f07b8dba65cc62319e0888712ee6538689d59bea3d885e0726295f219d6592dac0789f804ad13ac299f740bb90fe4931015398a6dd5e9fda6341958111fce25e4041"
f()
COUNT = "13"
EntropyInput = "38dacb8077d4db34f11073e2eb9010dd02dc81ecb8ff3eb9b734f64c48e53fe2"
Nonce = "af14d0a2076e6a24f5ca02486ac730dd"
PersonalizationString = "28dc06090ccea62ffa3118dd24bf603ff69953c457dfdcdf1e9faced7d35e768"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "5c587214e8d8da5b7f02254ffb5a22010a67dc6bce57c87f0d0c06e055cab7ccb833f90eb0138a33c5fb4b0d0360004cc24fa15ae5dcec1338a8233479a31d9ee03f9ea28e78495e6abf4541b17ca14207beedde6055c7f2364564e62a91df25da12f61efbf2c22e88d75a678e4895cddface074fb2b516506d0d5fa65c84d2e839bf043a865065c79f11087f7aed7b116c99a4abb3766d73e0829a1c1ff1388629c1e323eef58c49a7e0a5755f81266a67214e56509b1bc46319f6c7ca9255125dc1befdb475ccb600a871ad705d69855db4a664ce644701f044630a57c2ed719335c5b45cc82e4c57e1408adeb7d748199a4ba60f56642c44090092d88c26e"
f()
COUNT = "14"
EntropyInput = "5f0d1e9762c2724d5f95c91ae417ec0bdc4646ffb3ed6a880f4380d514caae6e"
Nonce = "c600da30d68cddd9b823433845111880"
PersonalizationString = "8896ff67866ff1f59c8e5074d91e6b9112410c9b6a1eefbcf05a1b8c7123dc89"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ad8150de910a0bbdad0a674d032919ac3304d5977fc43ad5d5b1fa9be46f22e94f5c2747db228315b0d0505867fd97f9b1582f97b4693ed542c416df1847a85bcd4ad07d6348a4df78412e3df4e675def7f44b1895a8a2156c811040a46198a863c0107aebc3a426b4c2b9ac294b227d323879a70cdf7ceeee7f6f51f102c3ba4ae9a7343aff295b664c869f2c2d6e4396362fdae7d9b5eb0802f37ff7a3a7f1c944044b1bd9b21fbf23f191c6f538398164c2d1b67390e7b059b1c9f5bb031b89a23895ac65770182c8072fb0ad4a7be055d9a4653d08e6b22a61ebdfb66adec2629030f47aca70a06d68c9e1c041ceb2dc9bcd1ceaf61655ef7bbb1653f3d6"
f()
COUNT = "0"
EntropyInput = "b6218db4a23ba91812f0bcb425335dfa82535f62f580091442c9b84d13520512"
Nonce = "0af3420dcb3b3c9fcab87faa4b8d424d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4a7de883632c3994a36a9ddea329a9de611938d1ef7664d253e5521aaa8351fb2b0dfad134ce0265c244fe0bed3a3aa92f0d1a9c6acef83f7de0ab63f8f1c3d7fb0ba92789ccbea0d623d6c13fa105f6193899a01058581c75076fc3b3e4efab80a43bf44d001c04d8d506736ab1f89b19e56964d7963c05b9012eee267a724455ab95661b8264f617be5bf9cf3f802faef499e678f4ad60bd4d0ecdab530e509c3892e285796ffec16d86944d680f9798c1d3ee68723d027a30ac4a24cd786d4d831aa7d513304dace72161c247206c87a19138545abb73e9f3d152a633db771b8fc44a30ef80cf51b72cbb2f3c6aaa4d269d21ca261c4e37b738a150de07b0"
f()
COUNT = "1"
EntropyInput = "40136bc306788c4cefdb176bfece4f36a6394877701bffd97c3ab18bd612570a"
Nonce = "ffbc7fd2c6642875705ef4fd03626c48"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a285cafeac40e0f69ba54aad2ce4729c7dfce5986280394d21415ed3d01f42d058f6398cf8f0b66b1d106633485079ff222bc776320f545bd14dd1493558475c47bea679ed53bc467cfc074e80172ee4ee1a69219e9e0a363e0943bab755e321be51100f86c2699999ffd1e28c0a2cd5aaf39ef1a0650e0d2836ba8019b459f37c46a1aad8ebcb428212571d3311c5d62566786e802d8c332e23edf9520545b6862b9bd5c1c3956b469732ee9c613fdedcab0b549456ffefa53f861bb6b2a2b88ebcc6e0bdc46e599d71508029bd38da75dc3c25e72bcb005388928c65bbd95c1a5c998ccddd238f61cece503db24f29e7c9a8cf9e65ff6a1f3d1593212662e2"
f()
COUNT = "2"
EntropyInput = "a7b5fb892d79e492e2c8d71a0102ee88fe3f59b8e4ad9cd1d81b060fd8003971"
Nonce = "7cc6a54858c8cd55f2fae01c56697c6a"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a470511f2b6ccc5165bbbf869c310ce23938ab12c43a41f7948d33a82f11e80488908d06e2af77fb0f20afecdd0ea10066b620d31930a6bfaf6187957b6e6f81b55d2e1326961c9ca81652a9596dacb4902ff4884b58c5a36b8c05aa3c13b67d27b30ceddebcd53fd8b4378ccd8d6120542647b6890c4d02caa295d5ea456496113d3a08e3fac09111eda6a045a3772bdbc70a83493d32a3204247c616de698107aa903721fd735e9fc54192e7c8bf4a6cfd4c4f905a9378b4d675abf7767c49fbff7fede516f55a291023cbad78de62eda3626e31c1ea8cc59a675bacdd28c03aab810681ecb2e56304c238fe24a1c77c9e6e3418d037a775f6e92a70698fc8"
f()
COUNT = "3"
EntropyInput = "69b215896f256a733071f69845c6cdf74b9691e7763441de0e773a31e66443fe"
Nonce = "066baca0590baa636f46ef08f5a692a3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "01c9fe0a33ed105dca11803a2383c6d40b47a5eeaae652aca48a13e45ebada151ca8d67ddfa80695072eb6008265976e7a0ddb1433067d9f713f0a227c8790542a8fe78d7b22473e54bd4a8b5616db0201f1e9038beb957bfdad898b1c23e8af9c2b7fc2c9f96c6e6ffdd2dbf573cd78a6c340ec42d8be6025f86e873c596631bc3477848566ffbdcbd68b9e76cf38d96f4f01d8afd3962fde3da68a030daeb0034ee83fb292c1c869d9238af670a5dc4d6788205325068cf1656b4375687ab032a362deb0f80e6aa6ccfdefe4f98f77709bc8d6b6df8324a768dcba833f89538dfab26ed2e4ee631207000658343e45655ef5e75825c7810079c8092f905193"
f()
COUNT = "4"
EntropyInput = "6b1e50fbfab2832c10f5d700df82a557c65e02c76c93989f55440ef504323926"
Nonce = "2237e475dad8bf250e39186b8ea84c81"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1ceedd14783c8de93a55f78d671ab637df79aad2aa6c27a25e47adeeb972b70c03695bf3868e06651a58fd1bc9b1edd48d8a9f235d24dd6a75f62e70b27e8bf3e6e3f50bb86bff965c5e8825054ea8bc99b92f78daefbaff65ce19b509e502ae7e1c7d64780e9daa88e8080ead7d99da186c5862882b696159b9ebd3119cbd6d5f59d0ba28123c86bf9400a32f3328b11c1907d818c9d50686e3431b2787f0c1e5e193c2353f9ffaea36bec23a0b81e79d9421bcc7433218d4ace4fdf77afe3653557698bb1ec92cd92fd6e3e819b907b1d3b17108a119522d85b62cb78e52523ff53a8917f4794f2b588f20ef0e6d270900a67db64c06d074761220b9bae365"
f()
COUNT = "5"
EntropyInput = "569558ac4d144b413ccfd7190456fbb9774bfe794f87c8287fb1d9793c10f4e0"
Nonce = "3dac59142e1618546d5daf95d3fea0fa"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cb4a6120b3f246e8823342bb72b0e1fa96870c444046e9118626aae0e127f79a69895508a0e40b2adfe07ed0f92c2cf72787886298350983ba75577bc7c3ae4f30d66bb1c5da0a544d0e49edc45f2b7d89179e55c12708055340f1588f2b10ba3151e4bfe88cabbe5076a76b6c747064f770343ed9db035aa3ea659777cefd8c14f19711f2516b5d4ac4228e060f256c1824f795e194f9f19d828cff81c60368247bbbc343c72eefe28dc01d9cf15d81f47c0691d5ed67a4c499aee5ae7b09072bde7699f4eaacd8c4c2d1f6919021304027b1a513bb65f669b9451c234011184513b2703dc090461419c20c7fcd58ebc82de98335e0eb504008c0d30e8d7b0e"
f()
COUNT = "6"
EntropyInput = "27fce7d15031d5dd6880083d1ec5c2a3e8625b8c4c0dc0d7d438266ec7de5689"
Nonce = "c59e3bcdc1f6e31367e7b8b958eaa7d4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6da842ae1a45995da23d6e3b5ba2c0ec56b21624a2fdac824f3fb3b04fe416054796e2f06977838cc4f68d74d94410a1383d58c8a044429ee74e82fb4ece69a05e805e03965a757d58b66a9f4d224f41c35758a245d68889d60fe7651442b546bd34f8aa01dda206bb1b244d20243cf1e012b786b1992e0366145598ff19eb05a7e6386af08f41a77371bffa59bb69d5207c122b8ab6ed9efcc35e22bcaf7fa20725b642cc5384f261b6a853f3171f9782c50783ccf3d29bc699c565b8c380446bdd9b3591a60cfe455979de800af20b7b9b2014dc7d010a890c95c8bf41ae4144e5a764e0b067000e3a7ea325e387ff8915c13dc48874ab3399669c6580e42c"
f()
COUNT = "7"
EntropyInput = "0ca6f97189498ec6ac12e2e5cd37a07822b4477871483af627b4c765da5161d0"
Nonce = "f279ca8bb4ea4c7136f0ad8fca7b7d86"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cfa3865020689702cb30dde9f5901000146b9b3afa92b34a88ef926071c5f868c7e5006ae33dc38ed990006f3d7ff1b3d412a325527effd32f416e19394d435043d3bee05166f22b8505fdefb1f28053424be60457833f988cb426f4a8279742f16d2163a898ef6a08c85d5fc77a8b127efbb118d0b1a3c288c29e8e0a299c9e13d3935ab6ed39a8a2dc222ae897da1e34ab65a158f7bf01ec8654e39761fa3809a16aa6078e42bcf57562d213218849c27a929743e7b2c40f6fc72b2d78a3f11f9a7c1831f02593f36e0437dd6fbff652f7f0d956eb9579b6d178f5b34ecd29825028c04810fbff369fb0b65cd23205ba939bf78dbc0310ba15e20ac7b22d24"
f()
COUNT = "8"
EntropyInput = "2823011f32eabe40c1131b36c9f001cc28f7e86f15db184124c15e26b8d01914"
Nonce = "bd4af70749da0f3f64a915dfec31e50c"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a0198acbe891a7acbda52fbe35181c97d58d39844fb2975c96eb0dffd606092e691048ba65295bf2db16aac82b094a93667fd18c23ad5c0b564120237d3c56da6eba0d39cc4d8e023ef15e7ead8e241cbb8d0b2560bd444b84ab3c85c1eebce0ec40fccf680f2c4d440214125a2735d889da956dc3a895c7a69f07854f962f354e67524ed18863ed71d3e77816bf460b171fbd81b0a7c364c0f6ee18d32d7543a13cf5a7d7b992b8bca523e0de92fab578f980cac24d779f806565467702f75021652287a96adcc9f420e2acb22528ca77013501d9c7e5764f625f7edaa52a26b0ff184f343bf24477cc54c893c1434f7bf38d18efcf255c397b9a70fa0b64df"
f()
COUNT = "9"
EntropyInput = "15dbcb3de71426dc0aea3a0851e7390af9e3bac12e1db58dd931d4ed2d9682e2"
Nonce = "d87baa587e87d5b0c32d734dff92d9bd"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ec3246fca162a62512bc4ad2239270b2b0a98b25f6a7bf0aeaf80099c4c2da07e33fc1d58d41d85df68113c0d0decaa92a3838de2d99f807d615b2e969669422d9d52821315baccaf3a3630b2a7bf7f2c75a59948974759f6bb53d21ae9b981ee54261168d707eb45c0e0f7332ba702f1be30873a96f66f164ad4e78ba0ba3e5fbef4caf4b1d807e7233380f34a6d48013763bbbb5c6c16a83366dbe061b480ed45c8901804b117de73fc892c819ecc42951b130465e30f4c54f0112ad62f7b1193ec0c7725ab6489d343178b212e74ec147d3fd520a9ad9db384073b22a6a478f64b37a2e76cebea0e246660cf80536145719eff348558a72e84eb50245cc15"
f()
COUNT = "10"
EntropyInput = "6a36ca9ec24741c1389ad722a350c61008ce53432c24365cb6a60de26fff37a4"
Nonce = "50a4c1c05fc3893876e627976e1ea388"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c54305f7794a66781bbafcfcd1a5af259fa3a8b4d47c4e3ececcbbf80f885fb50dc93dcc507fa9109c238bc724289f5e3c765ffb4289ed0fd9bf7ae050c0154d11413997e61789c8bb806c61f4002a63bb2ca21bac9ca65abe92d0594da90c4e122b6ca9d0d4db29265783defa05ff40ff1e6c5089e8c1133d85d8de6f5cc20699659ba4d93e076086bcddb51bab709004e0391bb932440c951ee064de58795c14eddae19dc7ec8e2f2d168e90da41ea4892c348983ea07ff9b961f4a09f6a9aae232ce69760a2d240546b19c0fad337c764a480c9b6150b3db83f9c2b65ed4221433554e5cdc6bb18982c11755717c10f4f1c7cb7aa9d2f388e04a052f41474"
f()
COUNT = "11"
EntropyInput = "f42f1d6f989cf2df671516b14a9a5d72a4825ae220e52b058cd32d09802d9dac"
Nonce = "985aec205afa866c62d988545950f210"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "65b86867a230ae4abc0c4e4d8c6836a13c1b289145df5111dd75a2c863823e77fe68925696f51e9e9e3ecd8d81ef2717ba90a537f7f48d8c242e4494bda43857314893a53dfc887ea27a3f8fd809bc536e6bf484430ebe45ada15426b5d2d994549cd800280654b29ee75730b8d533c081fc63a97b1751f50a33914ed84f4037f3e9b41c2a6c7b6e438b89b08e55fbd1040d289c2068d9f7529fe459ae9667201e2c421abdfaeb52cf0f242040b6cc5c8ffb5d42f65c71d842c6c7549a4334afba7ddbb36cb98f7c02a985a54ed270b730949db4bfba95034caf778cc9e6ffc90dd9d151e12d62cb400a44e2d5d2cbeaa33814d61a2875396ab2d62f27caa380"
COUNT = "0"
EntropyInput = "f85649f8a8c01f8a2925f7e93e356be0fbc75206d1ce2f7e04a14257c3338a48"
Nonce = "01a8843b7a3dc0b1cab5f7c8b001598d"
PersonalizationString = "91022d072824cb580ac07555c90a31373f2dfc272de60d3bdbc0612e175874ab"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9f40affda9c797363a7b058d7f5b848f0ba366808e7a87ec94894091ca0818dc387a8ab249af3268a9b0c95f7a781d3c7ba613460a2a5f8ee4bf9ed237afaef69f046e163799794252d2c9708ea337b8bcc674c5016172c50d6de9d941f496cbde4a4e7abcdfd42a989119224ea7f3c4727179f42bbb54466f530e4394cf18c15b548ca610511800b39da69297a46ed1b237722c6d50248245f7e90f343617aca44b6245c99a714f719e324c2fd4b95e84b3f7d3212986dd7f51f60e38d1a077398f5af31adae8647bc920e6a0c865a297bffc88b407a24e2d2aead0e711fcf96b83bbede5bb35a5f9b0dc5e2376a693afa9070a4b1aa86dec23e6e597a74237"
f()
COUNT = "1"
EntropyInput = "58b81001b76e248d9a4eab5e7371a97dd0992bd4ed6de18084b2321b8c292b30"
Nonce = "d4e9df171d09a7b93949907ca65fd5b0"
PersonalizationString = "a36d996ecf48058ac850d66e56d812e8c58ec0d89a30dcf30475d3830c4a33c4"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "22d8e1f50c301208c5f198f29cf9f97704f2df46f662bfd7bd2883c22b49ab5d7bed1a2b6cf0c55a0aa0b695c52695b57919dbbe8381fc56e72553158e10ab59d4e682dfc3a07199876c266dcbe07735382d8ec079ab4ef5e622a2329092cde45c53f71aebe43b34990f55ad037eb33a87abbcd3ada3112ec43b9bb20b61bac549733222313de2bd91d532f1c17bc3de3fa34f7d3aebb2b59d6c8b90ce211e184fbe54ac0cb97d7a03e057a6bf69c4deb4f11cab49bcef323e9ca2eca1f4dec50a02ae1deea1d56f037d53da03da870dde13ac7a084d1e2aa4f095b3cbb1276a4f5815cde03a1ead7d5ff87fe7453cc603c0a1d1f6af1eaedec35835a6ce0c9b"
f()
COUNT = "2"
EntropyInput = "e2743de1bead33b91f0fa01a64e2dc2175749260d4475dc1c4652c6192ff65fb"
Nonce = "952e8d0d03b09130e4df1de0f8de4484"
PersonalizationString = "b187c33f16414734eb500c3c3230d3600c4b4251c2c44085b7a585c86dc713a3"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "7da54694edc364dcaf51bb239b82b3a8956264bd1279920b34f6a7a33395900b49180e38f0e97a2b1c5b7fb11bb1e4672275cae66a007ce88d0decfca929766c2c07e019eb94ed00094a5e72a82ddb00badada39d4eee8900dba0e71ba29750641908dc4b4eec95ecc3b49cc9df72ef5ecfbd1fa8c9eda509301222f9267abb4893470a75dfa86f793db4fea9bfc1de6c637c2a29d6c60272a521c10304bcbf595cfa632798701da4d50eb776d4dbe01865a8471c58e2cdbed14f083d6b4ed3cbafe1b2ccafe82e73151a8299c3a04d36eb713dd47c9f4d306c0e503026d7d6ab6c4789078c8c95ff5abe002b4bb86a369b91b4ef23c6afc0559a2cba4ff53ea"
f()
COUNT = "3"
EntropyInput = "aa1cfe4c9f03a9990c2dd55c0775ec36f3daf3d64873ef843692b5887b7d7a4c"
Nonce = "70484796fff90a01cfc2168d1d0f5ed9"
PersonalizationString = "21b468ff6f1e92ca410177941ec0bea74990555071cb7d7fc0844fb24cefd511"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "72ca74671d10f6aa0607c3abf4e86f022af34cd8c32cbc274eff9bd38bcd4b79c64b09e68f44a3b1c6592b7f458f743f99a3971becf6acd974792dd5812d473891766460b028f3724036496188bfd2fae5d3bf734d2503316db5c9b408496e9d99712dec355865c240d3209c1793fcc815df057ffe555d2bbf47e7370031893aefec6ef0e71d137e16c416dbe52df3b98f280f5e6b29636d7d9bb0999139fb5e46bfec53bb22c8fd68d2a15df7d4e1a2c813ae363bf3055e6def008ae16343ded598a0c08548801189ced03e6f81b31286dd8e3eab82d648b6a9fe5aa6fa1f951789cf4f5815e10188d2d9755e04f283373ce7da806cd92935aea243d6a566f9"
f()
COUNT = "4"
EntropyInput = "2625400a6130e77fa20f0b7c58cc0f9d0f22ef5ea54e5cfa6e6e648933d62322"
Nonce = "dff0eb02fc7ce93e4be2e294a24509b4"
PersonalizationString = "cdb1072fd83114ef83323ccb03d702f68a550d7a0e8b153a95eb9f771a271861"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4fa6071756afe972853072ba73e203773937f7d6e1dcd7982c37ef7566369e27add7889b32ed2e2c2669d00633c22d91fd98f2223789681fd3b1d93a16c2278b8e4007286dc1273e5abdce7845f87c066a59b0d8152f9c13230ce488f9cf00e7c3e1e0c3719e6087fa251e8bb4ddd3e778c6149a14db3217f172a8bfd656bfe6fe2c4960768adeca843f1f36671b722fcc62dde8b2e0c5765c6232ada6a4504b21f350786d0879408d8979e19a3aa16f0ec47df3d0836296fb88363d1fbc687bed75f14ccceafb185ce90c2b0f5cef3247f1573e822c19b1b9944204d42a6101326b127262b7023e89824a3f2d4fbc4c072ed3dbb7325e77eccc70cd82218f43"
f()
COUNT = "5"
EntropyInput = "4943e0c725cba7ac3bba16d1de3444eb367129fa38d1bd6e0032ec1b3e0b767c"
Nonce = "743775b879b22ba24d0b08ded6298ef0"
PersonalizationString = "1d8d1abc5f597648889bc220040cfe3bd49ad771ebf7ff2ffc9a7bb8ce2cb285"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1cd45a83f0236d70908291a0cb24e8af67268ba14492c0ee4f7f736e48a3da7c5bc80a0aafb54ab028907477463d7587a11c59cf2add25aa799fc39290c2284da916790985dd1d842421a24186aec5acad4ed5e511dab8c28f2a2a0b2449d1aaeb5265e5df2e708e761a42df5304dc92dd2c10028cbdabf5f21c1cf572cb0d55c194a273c166df5dce469ddaef537b3f5e72b6ec8c3f32e2a69d90a640ed3f219832117615c209251a467f7343df9a6fb891c6646f01f896d83319bec63cfb0e36d35d5b554f08a0635c3605d51f9e7cb8c32cf69cf3cbddb02f68c321ae08cd185de20256c9c78efd667a35a3c423e6a0d83213fe0acc1a11693b641037daec"
f()
COUNT = "6"
EntropyInput = "c90ef2a9a1cf4936689ec66acf771e3b0faaabbae4af866d4595d20823d04df7"
Nonce = "624caf43c3fb18b0a9b9b7b56245ce60"
PersonalizationString = "ef05d14650114038c30f441f8484301d2442f6b9167f57f1f2c0a77b5c91212a"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f89763a96ebbc1c4b5d5730501dd5a5910a9b907b1939442562ed880bca94724f9392d31eced9bb670cf355d5113a78f6b6993a85954c8e52d450f14815e8d25f3c5af5e0791fc9f94220994d58b7e3decdaa01993428bb597f1129c7c9a0643c413d0696df191ab0b18691c77e79d5705ed144a3b54ccb3e025f4f71d62cbbab9aca0804b15325d335a35b8ad9d06435ca2b847fcf45a2bd0afc95583cc11dd66f63596c9a81ec1244a58aee352b59cd4173e1b5b51e88f1d64ed887dc7c23efbf7ef49e34bc1324e91d17403052741dcd7e1e5a866ce3e2e424096a4c67ad818220a36a4ef8379f7650a2e49a953fe488202f1a95fb55a929b0e3261f181b7"
f()
COUNT = "7"
EntropyInput = "fc9e6a14f9614e1430dfc99640633f2195e35532342ccede226e0896d0c07319"
Nonce = "a43c19082988a2a1609150d903106415"
PersonalizationString = "ec6f5aea1cff91b0b798b1247a2e79bd62173d8ccdb5daf9492b3958ad82c48f"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "852a9d864504846fda05677c567bd9fff95221e620b8473c5e51580697ae193d7bf1f3237fd094363bef04f9231d95b8531a837ad43c7ff18d165acb2502f9e645460e06e2da19bd10c2df17ef2a6c0791921d74f72f91db4f80484f4fe3eb0aedac4e6417cef76e75c68c041be290f955a6121499842549ea9251bf892107614a1ee94110ca401c096c5a88adc4b39bfa5f821fb980b6e6455ee75cfdb8cfb31756565c3c836cc8e96b537080facd6c4c38c5d15c405e904a9d708e92a626cec63a5f88e3fb2b597348a7798559d612fce9013e6cda53b8eef61d5c874ea030d377639f93f3c83b5f7f634da201ce392d9799102ba9ca4c6126dd9fb77b33e1"
f()
COUNT = "8"
EntropyInput = "a5e0b94b0efb6e1df2b691bdd3e15d68ba602e25a4e1fa7b17fe124f280b722b"
Nonce = "3be26657fd44368efebe93c16b230e4f"
PersonalizationString = "652fce43407146c069c6d20e557eb75bbb7c72c10afeaffbdb9ff4bb6b2d0558"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bc9379fca8507d562434c8d54d35dfece72c18197593480bfa7b63b262d79667d8184c9026682b4a42b73ee237ce5ff46d8cf58df4cd7f145ba4ae3964838a787f353f82c7ba02f9680b0b72bd37473dc98fea004ba5f3b87c193170f00aba61d16eca612efc101c9db916d9ad9f34c20595a4df87106b952b9d3d47f3ee346f150e8e4e21d1d3892008ed163c0cde88a6d8d6d6ee7aa2511e15d583e3f286462f9d3d13966f955898d0c0c7a369e886caf2c3df6d41238ba85086e47fa78028f3dc01545834dc73b25509ee6577a6e8f159c70407bb7b05ca9bfe2580e8ab864543fbe67c286230dfb3c792ad050e79ce16ca3fabf73387e85a68faa44ee95d"
f()
COUNT = "9"
EntropyInput = "77f4fd085853b3b577b1b6e10190fe7f1aab5adbe80d8298b9c0c6d5bf695232"
Nonce = "d472daefa0831117e7b8f3f667c5508c"
PersonalizationString = "c52f79e56dda5affe2fc350e3b6aed9cf7de57f2005e1f2f003a90f1cb175974"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2b37c3d8c45efa020eb3f84284a93c5207b25b71c002d941528ca0d98f7ac42a72f55f1ecd13ea74a296d3e231e453511a496a0dc577252cda49b4e48056ff71cb4e309495d459d6c9fa2e6502f3ef39a06ec4dafc9f14405f14c3015b6ad7bdc9c1077aca97dc7974996c925c66a98b15fe8aa355ce3426b1af68df85491d46da2be2dc58e166edc60216520f18939cecb381d3d4efe70d89f4e4be3c93f11f5be68729f48ad9e501b327146087bb161ce7deaca44622bdbcb50efe8e076fd2e9cc3902cbaefc3abedbb60cbf24ce332a00bf7ff8ec7a2cc81d6669b9957d15d68c03e1308550b7041ce77c95de5cded1382124896b2dea1254af1e93ed7be7"
f()
COUNT = "10"
EntropyInput = "8b9e3283cc2316b6955171a2a3de5851a56ac2c3e6de14166fce6ce0d24421e4"
Nonce = "8f2caa11450b9c6676d35cfc83e3a1aa"
PersonalizationString = "55d98ce73f316177ca27dbaca3fa25111c19fac26fdc224adf71e46c33d9e076"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cac7b77c2664ab953a413557f03b73ba499a7ba627acd4bb81b1dd77198e17ffbab3393e83cf39a56353b387d312791f89df0cd9b4c3bb94eb43d8f34f95a4d2485609728f2fe4fbb4280c35c18a1bb5f5d4f7457eb4b79dd13ae5e3f39ea592028fc95f165cf7024813dbccb18651740146276293d8a45af3d7315978a610c4891134096701bb8cebd9a4bbe0685c06f12f8d98f825b84429ab7363a04043ae9aa5732274194db7bd6517029a92ce11d57710d2152fd877c563b9dbf773930a3e50326a84fd880b24bc142744b8a8b4d0661a008684bebe8d5dd682fab88b90247fea58ee911c6c8719dbc25bc95ec4440f50b34eeec9514264d05633a63862"
f()
COUNT = "11"
EntropyInput = "63740fe4ea180a767ee3ae551a0ba9f87fb93e511830188be1da2f5a3256db07"
Nonce = "2d7f7bbab9e17b0eed3d6fe126b49af7"
PersonalizationString = "dc61dc0b522a10dec7869d396deb1ef849bfa93604299519a520516d0e673098"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "85eeeb0897db47806534ca3cc1b700625e364196dd3dc4fb771bbec51b7e5aac09164d0cd6cd6f67bfe780b656d162cb8a9d9b5a9ddac9a3a38bd1fc23cfa41a17a4271239bbfd604845866f4b515fb0e9df75152d38251f5f50f6b4d99835eae72a518eb83c2e72501a3af9b4cdbd374134f6fbe6401cf592b444be6629af1bb1378b09038a01f459bf95daec141ca7639247776e44cf0ec36c8e494f91f4cf3bc0da212437279992f0986b8f5d592c8f64c5baf2e97ce04983af1639b90ac350a84a9bafd4e659d554dd29e5bd128468675e2c264aecc332a373655704e005144ec1d8efd8e1f5c915b78c2f8ce413242d788927aa8b3f66574750fac7fafa"
f()
COUNT = "12"
EntropyInput = "5be0278fdd81b7a4a0eebc3528bbe5982ba4084415152dee27649c6bae0a6b0b"
Nonce = "afac0cd0520ad32657e543c27bb01d73"
PersonalizationString = "265d72a4f0a1f93c91f72c755e9386626f1f0afb86e0bc341dbdc67859c176cb"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c056c7acec0c2fc67e8a66cfe62e26d63daf7dcc5bf1300f6ee44c818a35fd99ae13d16be2ed0b96ee98aead005d1b0c8ce10bd72a02045608129c12c02e6c0828717a60717bbd2238b88ce40c1255f7d41bc42f44276a140aa4f917ed22896480d81887b79f7e9bf066d28302816cd4c8493917de189caca99276b239f17fd040f98951ee2323601435f008a377fbc71dacbd1eabf80a55b5398a141201dd9ab2b8376ff39bc5ec15e21a260ec2445910dd2413b69dbb77883bb0b538afe8fed0e10ca5f195ee5365289b928b0d6c55f375b32f4e056ec7e0c3457ed9fd9ea8d8ec623b172b2ba5dc178e3f63c29765a5d793ff774030c41691791760cf3b7d"
f()
COUNT = "13"
EntropyInput = "a0bc0cd27d6d11f9fdbc9191f0ca551273742c3d83e0b10439326ae6458fc3d4"
Nonce = "08e08a673d0f1678b1564e7c6f1695d2"
PersonalizationString = "dc5c4cdf1531fcf69c55bece5c291a96ce9330a86737770fd5452c1e77d2a5aa"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e8d1173494b8f4f3066361ed8f16d75fecb9300df59ca8b1357db17f20e669166bfedc14f19aa7d492a92311ec01212b9bfb7cfe7ccb4834d22c0a14d8366b4adab29f2eed561ee261ed617fc3bc031c364e348b46579b2f4c9c2266e238168d9c20c8b353de83c2152e7865625661f7fe4f6c722fb6471127ca7b03af48cc107a1341cf9a40c2279a49cbcf6b4da179173dde4f217461aa118bf5a8a57f5ee4775a79995bd20d1895b71a18d8a373a29e53e286efe7e0db356e343816a114099bd1c621e14b2a44aec76ad84b572c6922c3bdbb4a606f09488061a8ab85c9e2032769f2ef444b5505b1a5c881350214faa716b7b0991e60b6d1076f16a2edfd"
f()
COUNT = "14"
EntropyInput = "2fa23531e11329997329d273d454ef186bffe879fdf95c8812533e4b8027df87"
Nonce = "0a6bef6b736129740978e31c3fa279e8"
PersonalizationString = "a5ca2491479bda16341b2c14339a5307fc2e2f5df4fa625e0ea351a95a14f588"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "df587647f8d440a6c8034e757cd47f28d0e58f8aad9a047cdc8a70a8b1cd0d8185240d47bc5d2f4657205ed218ec38307e68efad94714630cd490b939719a4a07ab994793112c021969a8c69872903315c74b00b677648673e5883b5f46e075550092914cfeab05454226ee3d2154698f368bfda0b8b99eff5d111c1649a0f7e67ec0f637c6d3466994d655066a95732590e521ca055b048dbafd219be1a04fcd047c3722c4adf29ebd8486e7171359292e11ac6b740b4d51093383d64d2a45e51115c689ae29357366f2013eb9b420c6bd069d22c2110182e842eccadae81797a5f57d9ff47311f094ea0a25d7e329fcccb93c28b92ed85ccc2d690a84f2b2a"
f()
console.log "exports.data = #{JSON.stringify out, null, 4};"
| 6698 | # Some DRBG-HMAC-SHA512 test vectors from here:
# http://csrc.nist.gov/groups/STM/cavp/documents/drbg/drbgtestvectors.zip
out = []
f = () ->
out.push { EntropyInput, Nonce, PersonalizationString, ReturnedBits }
COUNT = "0"
EntropyInput = "35049f389a33c0ecb1293238fd951f8ffd517dfde06041d32945b3e26914ba15"
Nonce = "f7328760be6168e6aa9fb54784989a11"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e76491b0260aacfded01ad39fbf1a66a88284caa5123368a2ad9330ee48335e3c9c9ba90e6cbc9429962d60c1a6661edcfaa31d972b8264b9d4562cf18494128a092c17a8da6f3113e8a7edfcd4427082bd390675e9662408144971717303d8dc352c9e8b95e7f35fa2ac9f549b292bc7c4bc7f01ee0a577859ef6e82d79ef23892d167c140d22aac32b64ccdfeee2730528a38763b24227f91ac3ffe47fb11538e435307e77481802b0f613f370ffb0dbeab774fe1efbb1a80d01154a9459e73ad361108bbc86b0914f095136cbe634555ce0bb263618dc5c367291ce0825518987154fe9ecb052b3f0a256fcc30cc14572531c9628973639beda456f2bddf6"
f()
COUNT = "1"
EntropyInput = "4cc8214cd7e85a76bfa735bbbfce926c0323fc348de6c05ed1800c2c8f58c6b1"
Nonce = "001eb1f6b29b35242a3f8fa2e90003f4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1efa15d644e1bdf34eade3ff2f5e9ca45203ccaa1e534ac9b4287a846b71292b03102286d99f2be64b898fe909238f540ebc25f49522f60ef723a4c428ead530a97c62405cd5d9ecc54ac5baa47ac4f6195d637833f462d21a659b4903d9cfa6c9fd4512445f9abb5782899a6bb64592f3c2b3c745b18645301fdb09a6a331e9fb6d9654fc79c14ed8<KEY>"
f()
COUNT = "2"
EntropyInput = "d046270e6b7997cd5f4e9ed1193e55382191f78547a660854cf60bb03d039a39"
Nonce = "50cd147a3445f6d32d14cbfb9da0c327"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cdfa9441aa5eb11fe3ba50528ed731c9ff9e70b78da075d00c52d0e281e3a868f66a53a2a6a272d7e0b1a32b6339f8afd108bb9e66b04c3d6bc069b7e01b69844322df7deac66e605a9e2f43665b7932c67c418a77a4c9a302782d0e735795755613a1c5e90089f759d780fb3a984dee4e06ba3dc5a8c652549587d975e586a98ac6aba6563e2767f1a379261b9dd37992ea9681881ea7933b5c64093234c849142ced85bbe5956f527d46ef091e4d18df2a6102621a91bca51bf7aa4b242414dc16e74ae59dfe560c19dbe315e7f98b11086bc26e336dcefcb91c4828682da90d3921336a45fcd36ea4d1213a13213a1<KEY>2bf20aa<KEY>a<KEY>991b60<KEY>6<KEY>de7ab9cc656"
f()
COUNT = "3"
EntropyInput = "<KEY>"
Nonce = "2d2dcd5c40b46fa553ca6a2f6be96991"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1658a7552e4cc98c228072801f9ba230123e7f1f7dca7ba839f440e5f7570fd29c38b86a2aaca04cc87a56205b41d19e3899<KEY>abb<KEY>1<KEY>2<KEY>0<KEY>e4d<KEY>22<KEY>20<KEY>8<KEY>0<KEY>66<KEY>0<KEY>6<KEY>dd33<KEY>ac<KEY>ed<KEY>20<KEY>3<KEY>d02<KEY>0<KEY>0bb52<KEY>4<KEY>3f001<KEY>1e21dfd3363229ed362f960d8a5fd06af5caa86018f9dce81ade6234a6992bfb9e2660d08a103dadd7d9ade4c45d691aa3799c1"
f()
COUNT = "4"
EntropyInput = "<KEY>"
Nonce = "fd2cbc87c79063db588d90b9cb1569f3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "7c4de5fa97362e63e<KEY>2<KEY>abe28559d5bd85691c3e3bd610e61e4c3b76e167526d1331459d8bf09ceb403062cc97e1229eb3a70af6049d291aadb002786e7d21b81c87fa68a51a1b9a89394788bab70783a88c883ca17eceaba455f357c611fb279e38f67e3c27c5ade5f95721fa79fc2da1bd44ca7f304161359da4e45d7b847672bc185ba502123a802535dbd167b2c93bf901626e23fcaba03c4f89625<KEY>930caaaa30400645680<KEY>5<KEY>31<KEY>0<KEY>6<KEY>6<KEY>1<KEY>ffb"
f()
COUNT = "5"
EntropyInput = "<KEY>14be417001030f6a9c543f82<KEY>715<KEY>075d0<KEY>8fa35acc7eed02a1401c6f59df"
Nonce = "c87b8b9255e62fcda6a35e52fa4a6f9d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ed29a49be56e081f5b6abcd2ca1a16dc096071989de72a39b8bd544d2a2a2db5c886c0c29ce454cf60addb56cb4f28f959ccb7163280ef81e48dd2a02024c34a120301d359f03844d1af01f485afbe7c9b17288cf345172290fdc44e124670c5ca9e8590df6f9f63d60849c62d3921003532dbe3e3e6bdd75d28211365f6c489598a99e605ca671ff91552b5916ea9e12259723c0e1a633be34932d0c816c30b519c79656a70368b28fadaf5eb32eb6e47e00b04f152ace2eafc9a3ebd3b1b3795ad85e0897e46ab57c361fef2908041d365f73180b505ae2426603decd0b7dd33e2f7ac885aced4194999602d4d62a984233d0696fff86f7fa7a6cf993fb7e5"
f()
COUNT = "6"
EntropyInput = "b8ceee088f3b13dbd1e7cf230449f246a456f504d63fd4288838a50ab76576a3"
Nonce = "f400502913cf57cb2341c5e6a63fe9fa"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b4fe3f6caedf4ac7b93fb1c2f316bafa58487f28a37b8400fd1f32c963b04cb3c7eb601d0dd8a7e4538b14030fb0e97794c617366ca827e3afdb0f714983a6a72b261db8bf98d5fc48fb55158661f987d08e952913212717cf204a3e8cf1177f63e2a46d920ffcec4b580a1361253a689bf765200f4e90dc6b34a56e10cfdbf932fbc3b75da1d55cba0c5287f552d883763b83acdfc7fc9d762f79774701f7ace701f0b26c67217e022bf6b6e0602e0d68cb1377b5ebccb9a8e41188dd1dea662663e8aa093787d6490a4e887a34a27309c64c40e4ab2f0acfec4a1b8d419d99fb578aaa82da9166a7d7873e27226db20d313e868bcfa4fe3854d6fb34def7d6"
f()
COUNT = "7"
EntropyInput = "3c1e8a0199786fc268ee0ca0c0446d7363bd781069cf3a3faef2592cba06ce1e"
Nonce = "70c7c691af73d6d59addbd6e3f646d64"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "06f44bebc2c1736b5cee283e530bb877b28651d70983c272a10efa80e3794ee428644048d67245dd3ca8b769b6bb192c9468a9fcf2b71c417283713d39e800225ba659c3273022f5177fd7867173f457f3bb66ff2c2e7bb2574dfee54438e35c98506c178d35259b04e7c541016f5c2d980074b4ea865203ae2e8935d745a02ab5cce04d233cbc18719b1900f2e7e98229b851d19fac02fa6e5ac1bc973b20a17509739bd989d4ef5a66fd9e19e3ceef2<KEY>b<KEY>db<KEY>cb<KEY>db<KEY>bdc<KEY>dcb<KEY>bf<KEY>fd<KEY>eba<KEY>"
f()
COUNT = "8"
EntropyInput = "e8a0925bfce66dee7e6a54fe0311d259bd7f7a22b8576d64840cc51c731212cb"
Nonce = "1763365deab3ab82de9996e5c8570eb9"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "63ddfd70508cfa247408ec231d56df7905f65b62e5e5a8309fff5239620faa0f055d7b8fdbc648ded78fd567c3141e1723d197296c92d43fdc18af0c4a54fcd52613286c78ba7bdfd0fcacc7b11b374739088323ba95f30872d77b6aad21228253133d76d29d0d742ba349956fe71e8bbf3fc7186a3f85f144a9040ceb0529a713583c1fcdee756d0130b38df<KEY>"
f()
COUNT = "9"
EntropyInput = "c<KEY>6bb<KEY>0b2<KEY>0bd<KEY>b<KEY>b<KEY>bfd<KEY>bc<KEY>"
Nonce = "b6d6197f432c8597163feb9c5439525d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "764d3e4459504b490eb1db7b5ab8e6413601e449750534f4c4f70025026f87217010eb14705eae6e513796c7f20ecace32a063238824b3fd6956810066930bf425a1c585221c8f61ac64aeccfe8a3e33d164d02d5434e9e594b7ff451601874d268a2fd8de9922c36e67d8146fe553889a15f624d499a22f5109896758f30bb98f70eac11da1ad48e99bb4422acc5b97295094324eecf530525c1ba150886d053c84004c265693a4419602e5e59bf120de6ff054d0c7c96bc14e9b5fe1290c08ebebcda21744c04a2e78964cb2b52f8e6a70930fd1ded1f0edbda4deff91a3310019e967df3fdbfa228bec9897412a748201649328b7d784851fcb5ac1251f8b"
f()
COUNT = "10"
EntropyInput = "1e868c5fe4b59e6d4249854226bf1120a74386ea590e9c35c58d7ccdfad56d71"
Nonce = "dbf557da684289e96cbdd66cbd9cb879"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2032963be29c0d24c2631b1cd895124b9801a4d5c14c28fb34cbfb1c2467134f499153e2a3ec817cc4b2e4e06068ae78f5696dcee99334b0b51e9f29e56a3d3fd5c65c4cc70e10f9e0cea2572c28ec4afe0896d7689322d3afd931ff836be4<KEY>5<KEY>78aa179100d43d910564dd1adfedcd32e3e7e53b06c0a46a90b1173e4a5152<KEY>8aa38f2a7<KEY>329<KEY>01<KEY>0b<KEY>1<KEY>62<KEY>6<KEY>"
f()
COUNT = "11"
EntropyInput = "<KEY>"
Nonce = "dbab14240cf59fcc8a7007553ac480eb"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6a9d30d4ca97dbfc2d2852bef044bbfb95ac253b27e5<KEY>06<KEY>8<KEY>7ed399b10b995b3<KEY>55586519e5730e52ee8880ef0e63c476f2a80d77c6ba802c47e9174297b27520fb027d134e17cfa6f99d59cc5f53737cdc2e663e1ac59bf74a87ab1064e9acd4811c0406ec5a29a081bd0efd1e557d6b6c9c7fe6131c5c00fae82339<KEY>1fb90d3be2<KEY>6<KEY>"
f()
COUNT = "12"
EntropyInput = "<KEY>"
Nonce = "776c5ea9838c4c34f39f12c1a9df6700"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ba23f7aa0b7f6a93bc0df32e68e78786fffb5acd7fbc2864468568753e3ddf31fc2187b20c229d0d0b261510f6442816d2226024b57306b474079c92c66a00be482fc104cdbccef0450b3f2ce94f6bb6a5125e0774a28a2a083f802d3c45e9d4253295f80ca4bc439f539a7f82eec6fd450bd196ab468ec6902752dced44ab557fcd3f6a72c47c0f18cec6545ac669cf432e2db308d70a7394ec772a34f14f26d7bf7d0bd7e4437248618efa2c08adc7de9231ddcc976ef8bcbd11be54dd17ca9fa515fee6827bf5efb602fe8f1cf5d67078b17601803c5be05c24edccad2837d0be191f918d6dc62742241728a8690db5836c2045ec9f8bfa87b768f4febf2f"
f()
COUNT = "13"
EntropyInput = "17facdf2fca2e1134674ea8e8daa609b4477f415c6a13a5c157f3fb7727dda6d"
Nonce = "3c1dd89ad63e781588e4b3f8cb1f2f6e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f472b4c20bf07c170b3c8eb682469e88680d1fa5561d72b864c5c438c95c4c8a3e61f89fc30d5fb4e843e5ed1230778b48c467fa46ebfb7b56220a610483827f3f7f8ac307f8aa57a68922a06c8fa5de732a0d05835cd48690a2b3f734e4b7e74799ad774579a9eb296112f3e2bb68551af0e9e0e5e0bbb219ccb6c78459dc68a3663987156a50e72aebb219a1e43b5603dbd8055bf1e76a4468caee86489ac9a1a9a66ee7b193484ff3bea84341b62dab124a43e38945cfc99f2c4c15590fe180bb3e6eac544483aef710278213a83da85a38b6d140f33654c9d4f6b8ab3eacef1c57fd2237dbe8adf23b3aef6ab30327ca119b9e1e95ecd068aafae0d07a08"
f()
COUNT = "14"
EntropyInput = "2c13e44674e89aa105fc11b05e8526769a53ab0b4688f3d0d9cf23af4c8469bb"
Nonce = "700ac6a616c1d1bb7bd8ff7e96a4d250"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f778161306fc5f1d9e649b2a26983f31266a84bc79dd1b0016c8de53706f9812c4cebdbde78a3592bc7752303154acd7f4d27c2d5751fc7b1fee62677a71fc90e259dfb4b6a9c372515fac6efe01958d199888c360504ffa4c7cf4517918c430f5640fedc738e0cc1fcec33945a34a62ca61a71a9067298d34ac4a93751ddcd9a0f142748a1f0a81a948c6c6a16179e70b6f13633fd03b838da20f81450b4fdc1752e98e71296f1941ca58e71b73ea93e99a98f58d0892fa16de6a16c602036ac857dd75f9ac2c9185932103db5430e80cde9131e814a0bf3f3e7a2200a7152424472fd27f791a854f29aecc448f8d3fca3f93290266df3193d9e13e08907ab2"
f()
COUNT = "0"
EntropyInput = "73529bba71a3d4b4fcf9a7edeed269dbdc3748b90df68c0d00e245de54698c77"
Nonce = "22e2d6e24501212b6f058e7c54138007"
PersonalizationString = "e2cc19e31595d0e4de9e8bd3b236dec2d4b032c3dd5bf9891c284cd1bac67bdb"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1a73d58b7342c3c933e3ba15eedd8270988691c3794b45aa358570391571881c0d9c4289e5b198db5534c3cb8466ab48250fa67f24cb19b7038e46af56687bab7e5de3c82fa7312f54dc0f1dc93f5b03fcaa6003cae28d3d4707368c144a7aa46091822da292f97f32caf90ae3dd3e48e808ae12e633aa0410106e1ab56bc0a0d80f438e9b3492e4a3bc88d73a3904f7dd060c48ae8d7b12bf89a19551b53b3f55a511d2820e941640c845a8a0466432c5850c5b61bec5272602521125addf677e949b96782bc01a904491df08089bed004ad56e12f8ea1a200883ad72b3b9fae12b4eb65d5c2bacb3ce46c7c48464c9c29142fb35e7bc267ce852296ac042f9"
f()
COUNT = "1"
EntropyInput = "e72d696d4dcb41a42d89037487b3eb01d2ddcf0407e4daa0b8ff562461eb6f83"
Nonce = "b2b01fb9732601f3573c6831aef09ac3"
PersonalizationString = "8bbb235642f8caed49700463168ced9971a0204b981025bee41c72b76a965d51"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8e5cd2a91ea113072623b787ed37454fae2c1905a725be3b124bb243057794dd68325a5d8bba5d6c7796d91cf682587ebe91f6beb33c5cd60b00940bf6de5<KEY>c7fb082b<KEY>ba0e5b44e021be6d45099ea59367291a733ca50334f0315d52ed267af1b98e5be59359a0b9965727d92aafe4c92fda2c915cfb5a378c7a717f743a3524fddf5a48b1e7e113fa6e94b76f4e13fce3cc18b970f2ed1c34bd622611c979b6a9712c4447c3e50<KEY>7bb<KEY>ae<KEY>8bbf<KEY>dd<KEY>bb<KEY>"
f()
COUNT = "2"
EntropyInput = "<KEY>"
Nonce = "2e2b74490e062044975d6b1885f61ec7"
PersonalizationString = "b5f819154ed5442d5547771af76cb6333d7f35e6f3e1cb03b22d09e601eb8eec"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9cb<KEY>57ba9d77b95e<KEY>bb<KEY>3054<KEY>4<KEY>6eedc<KEY>6<KEY>e<KEY>d<KEY>eec<KEY>c<KEY>cf<KEY>cdf<KEY>"
f()
COUNT = "3"
EntropyInput = "138a1a9408cd7de6c1796910145263e5816d377cb9949bad0927f9c61e7fd18c"
Nonce = "71eb585159831189707ac6b8b6f80100"
PersonalizationString = "9c0ca722c55c19694df96e70f941b5b230efb1fccc7a7abe0c471dde92a39272"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "976e1a19af964502177d27b09458e3beca6e9082ce21721d31b7241795886213894f2e3f9acc23af6aa5eae7218d00871dac9e237cde1dd9654c1e893bac47e9444f4dabd26d3dcd9f11a68b297956f135df32fc3470f7b01383c506e2a2fbdf1c387c4ce684592fd4e5be0469a29c8031cd1ccd002edae3bea44c93695241296d472783df68e5ac7a62e33a5a74f70fe45252f88309b7f3603f43a5a0a823cf6f3bd8670d50663ecc326aed709224b60fe67ed29860b31c8161d416dc5cbca1c16e69cd7ce41a77cd465cb810f2b5963d15e352715fd5e6175c68125fc8e107d6573ea89db8b34fdf93e2e173cef77746e6142c8e5c44dc288ce86c0710a04b"
f()
COUNT = "4"
EntropyInput = "f4010441edc99d524f6caa660c180e25afdd09315f2a495ec003471e1f79bf0a"
Nonce = "13bc6f04d81b25f4d4c9321aa3fa58b4"
PersonalizationString = "37fbbb3fc5aa698084184ecc8e8b45212dcf851e6e4f2db8f775d3f759ef0c4c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cb3a853a930cce84703c47719f6d609fce15f903a887f646c0781606f6f926765afd7411b4fc44be350b14cfff04383e4930eb36f94329033cd5f21d467fa74ca1a3c61c94a290bf6753809d8e7b75431d9450361613b16d6be55c392cbcb3d4212ea42cb341878cb268f3daa87c73297a807e35b82458cab693ec9bf<KEY>"
f()
COUNT = "5"
EntropyInput = "64179b56a75ce27513f0353e10a5107b935293af96799112448fb5787d9949d0"
Nonce = "f38d2f6e523ca3ef7429621db65a37d6"
PersonalizationString = "f0cfd2400dd8d5e857e5878fc811a5c9ce5e0097184ccdc57c0f96d5a66020c3"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b79591df35bf97c7f4731ded3eefcaaf9d0033bbb0741c0c28aca622e211491107ba9b9645ed325ae18a7aac6160cee4e3<KEY>7<KEY>9<KEY>0<KEY>481<KEY>3<KEY>1d2026<KEY>34c44f67<KEY>9c01ff<KEY>44<KEY>0<KEY>5eaea00<KEY>0<KEY>0<KEY>2ef4<KEY>"
f()
COUNT = "6"
EntropyInput = "<KEY>"
Nonce = "961df3048132b35d39bc1f96e21672b3"
PersonalizationString = "d040489ad6f484b13be395fd99fff34706cbf96867e614cd6c91554d61231eee"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "<KEY>91bc36569a590e5dba3b64e896b21625a8555f71ab77f6f348d2d787e195<KEY>046<KEY>5<KEY>6<KEY>bee7<KEY>1<KEY>00<KEY>db3<KEY>e3<KEY>d<KEY>6fcdd<KEY>ebc1<KEY>3<KEY>da<KEY>0<KEY>0<KEY>d<KEY>d<KEY>d<KEY>cd<KEY>db<KEY>dc<KEY>bf<KEY>bd<KEY>d<KEY>cb<KEY>d<KEY>fbd<KEY>cce<KEY>0fb<KEY>bb<KEY>bd<KEY>d<KEY>faa<KEY>8aaf6"
f()
COUNT = "7"
EntropyInput = "b3679d82e8a26b602835fa5b780e9678d8a84cbcac2cd6a66174a9c6f68d86cb"
Nonce = "c4b1bcdcc20888953f8ff22363fa8a5e"
PersonalizationString = "c35fe47a7a0c8f82af93ec7dd162aeb423af44aa71b35d299d561b65640e43a1"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4fb91c1ac25546550d914c1bca10943f0bc2d6785d11eb28eef7b138b42a248b7866eeedee2a00772d3ea216430344af63e896fd0731e93ed7e06e96024385af563cc80cbb27df9285219b1abc57949c580b3d7b7b2e956ec2375ea5069c89ca50602494fbaf80b06424fda851a7576806dd18cb8c96e11c746b71e272c09eae0d3e1a5e14d46a4f09ce1520c36aee0e565f3093e703786bb109a4362620eec6108c0ae71abcb8e3a46e9907fa74522cf47f81d743ff4766b7ecf81982340e573a2893636ea8072373a628abe72e78fa22785e607d4fd6941b6b58da5d77517e3cd6d228b67b49b408b7b67c76ff126da818ba19e4dc36ab647f3b3bdb3c9e19"
f()
COUNT = "8"
EntropyInput = "d120f00e06be42483e026e4be88267ca2f8c1b92f3a8342fd460ee5f2f162bf9"
Nonce = "e851a711e87dd4ce719d660de2988754"
PersonalizationString = "28b9fd7cbe714602be7d7d8a159db5e72cfdc8ad8f25cd18023da801466bcd2b"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6912a14bbddf7b5fee9d8df4e06662b8856bcb85ed0dc70061c0951b46ff4a6d9fc49eed01f71a9155b3f03ec31d2bf96d0cd5b961a36cb702c9cbb4a938f3a5cdbbd22d4a94f12434a706362897617f25953d6f62243cb3b8cb21877cf74899d5285a5b7fdc8fe18f49bc7f0fa4d200e8c98ee38884e4ab56ff8e31dd2420<KEY>"
f()
COUNT = "9"
EntropyInput = "256eabcc37aed36ee6a5e288f6a96c28b8554ae987eea487a87f7f1a3c93052c"
Nonce = "9dceeb5a5749f26f4dfde9ce42908d33"
PersonalizationString = "0aeb442729544bdfdaf0a0997e12da31187d92e5491eeb19a9d0a5b8142f4017"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "729f91d238cbbcb0001d55967c9e33765db722ee3c1acfb58d67f630b24ed6ea612d45b12db152f082bef94fdf1e370bbf1388c26ccb6e5d2567340<KEY>"
f()
COUNT = "10"
EntropyInput = "<KEY>"
Nonce = "26346eb244156cbc6cb297d3f57ceb43"
PersonalizationString = "8f75e9cb9dbf8636d5ca1a08e5def41e9c773de65bda450e025b3947d198fc0c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "952ecf7252536ef906e1c4a9d4d0fbe5696a574487a9192445b9730d96ec2bebf57c9fb3ff1203011ef221625f95721611b10ff4eca17833ce11c4ae6f2155d1954dcdcf17d4d9252a739c99e085c3a6169585fe1b2523388f0690392d30f153d2fa75d8dc12fb8f235cbd83d5d1d0f883bf2f0dff0bc3ecb490fbee2dd09be21cd63e56c90dc92552a7819da8682c1676ee432e1e6c85cb8928b9997ea4af23e7d5dcceaba634cfc31541133c2d11cda92aa858d7fc98940fe4bb6865f8986b27ccbe9889f94cfefdf5e7d7c9667dcb91ef9095daa86a27df13a4bb8afb32d4bc5273247c29a93b4eb53c0189308585bb83baf9b6ce76d995838e035aeee907"
f()
COUNT = "11"
EntropyInput = "b18f4e2614719779660fdfbd342f37b944141c5adc2346c4e37733a4da6fd2ba"
Nonce = "d849c315f51034df3c7bd39ce4f4ddf7"
PersonalizationString = "7b6c82ea24ddf29ae2fbea9c9e284506288abff2059c07246689618d3e6ecfc2"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2cbf77930162fd93a9becce1b29e5b37a9b401b8e7875f650204cce39ce74592686e274372be83c1ede3e7901d4e9fadc5d1b9f58e03e7db208feca9573dd3e0f39967922309fc7e065591b59e6cd7cd4aaf836882d1230320e22f0326c629afada478708125c4ad140b3054c9d4a660811a40df01d6f3d0acd7a16b69b10f388ce317fd795b8336a141a3c3cf95f30035567a58c66a08806c8523984bf18d75bcdd67a6c1f9fc464e939c913ba02d28fa465042e1151adb914bce52048544ff6835d1f81aec6c42f005f592772e751bc7f64ccadc276a1754c382e1355958e435fe2a096818171b644084c702ed4740bbad7f536aad0bf47b3c1fffdb3e214e"
f()
COUNT = "12"
EntropyInput = "14c817683e8013e1a3a56e46bcca485cbf386cf85bc45d11817264b0809919dc"
Nonce = "9fecddd4a2d910ff5ee139f436af231b"
PersonalizationString = "13145848e593be74e8d9730be55c9b98fa551eab55c364127b16b4a295ca15ad"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4a16be29fd77ac3e0b0754ef030b0702209be0bed2e2292059d5d9a07322050991991d482689e71921fb4f0d189be688fffd4eff001d78e2fa28075101c55ac98f4af065b9fb34df0a1db10ba41c5efb241e2acdf9bb65fa5051c6d01cb8a0d683b001c034cce35dae98197b3a6945b31f3eb1342cf1a8bb6e528dac01c7f0350253029a1ad0899801bca276bc5eb3dd92a712f2e99<KEY>dead<KEY>ed<KEY>fd<KEY>ffe<KEY>115291f999059109f2ef4a1299798d2d04bada29088e9b886cf83<KEY>c71cdae58b<KEY>4d1<KEY>1<KEY>ecc0<KEY>dfa0<KEY>d<KEY>3<KEY>4<KEY>1<KEY>abe0e6<KEY>"
f()
COUNT = "13"
EntropyInput = "<KEY>"
Nonce = "b37e0aa74649ab01627fe3663d28fef0"
PersonalizationString = "e49c8fd4b2d1676096f937a0674ce41f2b960eb53e4b35d01212adb6b1ded917"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f5dd013f8eea8fc48a2a77600cac576dbab7919c91f2d360749ae7369f184fdb428d3575ff97574b8727ad20dceb04d116030b8c3ad2ee54c69e6e01fa1580cedca2949641067a2845f6fffd1909ae2e520b9<KEY>"
f()
COUNT = "14"
EntropyInput = "e9e4f59e1a5fd43acbe20923907227b2790efd1a2118106b1e4823588c525423"
Nonce = "fff1f2e2ac117af8b2cb023f0dd6c6ea"
PersonalizationString = "0<KEY>69d6c69<KEY>0<KEY>9c<KEY>8<KEY>c<KEY>"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ae35e947a538e7da73f944b4dea689c064b144b753fe597369e58ec4868099c0f000995949e82dc3e5c00555a2cfe48c8a87e87ae5e7402e2b1679e413cc556f08796269ef3ea83d6a49116349a31710964fb2f936cccf249472eab3267cc1ca0073ff4d964eefc82dd1559c3737661f8b206757a64c756680fb7ab6be8cb433b93f21a04c1e99c777ac26c1f34918794085ee593ca27ae991c53d141e52f90e7872bbb036dce78e6a33e2d638360f9c15d5746d6ff13c1bcdff1cd01749fa51c3c72e68c0ce57423d4915abe84c15cfb3301d0c3b8ffc6a1962c1fd981790fa2a3da60d70e8e8557e4b2e7458ad85f5141ad46e1db751893e8327c8197571e8"
f()
COUNT = "0"
EntropyInput = "dc01767ed6527b8775e99fd5d46dd33db0ec2ebb393acf59b080510a657954ba"
Nonce = "174e0ed454d1b57021fa980f4597ea25"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3de906b138662897b8a5aa00d8cfaa364bf70143d1de088a6f38b610c8f4d2a20c107c9f6d277850fa5f50007744f90cda0e20e3b140f9aac249a43ece99c574245ced90e6023ff5bf5bacee6656866db3fd72a209c79fd9829e3c63a7f46f0d31398e189331f93ec97ff1554bf0739c18abc1cc1dca1d8a8a5ab243b7355223ea6eeaddccc0972f23a03291b28af9303c21c0a1417529471c6adeaacc659554e8619b03fe6112de5c72162dc6e1039cf05141fa88be6abddcd2f312167e86773e52e73336c6404b44820bdc14ffa6f0e8f7149da33743fbd2c89dbd0e75b6bd9ce7703b337031ab51f5137fe1508567340fd11bf4b51f34032385f1287d4af1"
f()
COUNT = "1"
EntropyInput = "197c8b09c20500b2ff9095142c4629becd3a131ed17b99940ab31a53762226ba"
Nonce = "4579a3858564901928fed2a75c98f32f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c33b2418bf4d66f49ad1c05102686c65613cc3602d74aa4e5c611873a337c0fffc4c8ccba9c5ab56c3c9cdfd9be3c0da039bf08442cf2ed4af5a9fdbedf0d66001192bca2a2a5dd5a49cf159e2a5ff00066eec08b99312f84033e6e6f24bc5d908cd9d19e6314bfebb98bdf431c9779d0ee7d15cf9ee7e9baefddc6c6625500911d2810a0ec794e28eefcd0fd76590419933e1a1e077cb2860975762926eb206e1eee8f1a6eeba762d7ff6056a37c56649b034af7c976432cc63e672dfd4b564bfd4898de6ae7944789199e700c64a78ecd1b841d206a7c523040f240001829363809569dc5e90762c5c63a5147fdcf6f31beb60151ed54637c73d6df4a93aed"
f()
COUNT = "2"
EntropyInput = "dfe546e4148a5d0107f3dc9f735936d87f5ffbd694158d140ff04fce96785e93"
Nonce = "943f71ec131f0d6abe5098a00a93321f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8290a703f35fcec670b1239fee36a0059fa0b3a355cda9bc1f824ec616107edf4f101d9d8e7979892ae17a3cedfbc9c13a938335d61414f20308a4afb94846bc8ef1729cd35fca10f0bb975cfb554f8723cc51e9356d13c083fd5954a0e4346823dcd5b5ebcb0e21b788609bd88fe40354dfcdecbdd97d08af772351cb919e3d19ee65444f1269dd790cdac4ee88b026770eaf75c8018cfb7526a1c4efbb9a870287e6a0ed8dc8e67124feba54baefe721ce87da82743e4f185b7f591ef67506ad43c50df769dcb68965808d246f294461d4a55c9a148998572e6ab52bf574a50cc60129b1bbadde86695e3c5d4d21ba7f9e4beb432a39ba85dce836b16452a2"
f()
COUNT = "3"
EntropyInput = "f81566d48684aa031fa29e7a8c759dd08f6666b13692776361ece56e92bc3c2a"
Nonce = "40b04432b8979914f3e0e19b9d3c01b6"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1799a737c4436d32e8ea5662541c2ff628c2f293aaa7a463f6566e52d78782c88a34c505e36f29f351d2063880b5b8c3fc99ed9e02ee62496649e1401b1e151fcdbb3dc76f13b209044fa205d050603fb1197da58e7a1a3c3edc8c4b6adc230239a120b71baa6a272624c67f0eafbe6daa71c681eaa67b47227daa1ba058f399440c421dde47ec1b8211d5c57c7bb82c7448a3491b6209a450ac1e0856363fff9afecdb065051021c6b9f0e7a010d1022af4ad396ad1d164894e1c077fd83b71d55c12f9b41bfec2023998f43a2457cd55bd0fdf0a68258fde7a6fa13beb1070a5183145a2d7b88786b443deabd15e594dea1f1eb72d556178e0c74701773739"
f()
COUNT = "4"
EntropyInput = "36afbb34419c0396505235be6de69861e8902bf1c70a3e2836b97998cbac8b38"
Nonce = "d45450d4c1e1c3cc4be7379b0938cc37"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e1dc7fb2c7d11f53a88520928b127cc0e234c1ce3d593bb05967ab2600a1d66b0fb32e70b9985db2f6c14999f3b9faccb72c318e07f9d7770f3a0ed33f2f822e36a5db463cfadbaaab7ec75e773e8d4b5497ac104e23e199e1284c4f1f9e75322ebecbe659bd564ed808f815ed2<KEY>"
f()
COUNT = "5"
EntropyInput = "5<KEY>"
Nonce = "54b1b9129eca3d2db0c63e4467a495b9"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2fa8957e56449eeb60e0cb78e9a00a31842b821ac67e8c883f6be54e8134666b30011f6ca692f4694d663e8542ec824369faeedd281ad710110687092cff0f72990ed35cd942fc5626bd58bd4ca6<KEY>5043cce<KEY>8d<KEY>e1dec<KEY>1<KEY>1<KEY>36<KEY>e3e<KEY>3<KEY>6<KEY>0<KEY>33e9<KEY>d<KEY>84205<KEY>93<KEY>6c34d3e52f244efcb0e0b6335d1<KEY>dbc4941bad32a8c69d750a7a91509a0ac714d80b2a0e28e14e02e5e5785906b94fa153b7abd1e0dec4b4fd00c073ab6acb6f705c07f8d7239caf3809109c78461d7ddb334edd0ef9902861ef98b7d7ac418ed9c24d2fb7c4414e25794ee5165feac3611caab8945541af42f77cbd0d7c118a077ade186972"
f()
COUNT = "6"
EntropyInput = "42f551fb6533137f<KEY>0<KEY>"
Nonce = "2cee96d6c3eef1c9ed1485cca77725a7"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3fd4f97eedccf2e2eddb37caaaae3433e5585c9fddf32aa601c68338554ec84f16aadb8e808e194c4f0<KEY>e<KEY>1<KEY>ac650fbce449e79db7842815beac2137d57b6edcf121389861d85b9ffe68143cc06e4afa9cd9639b45b310acac933160d7f0699a6df9e04b156acb02c43d5d729474bd28559de2f02192dacdd790ac550bd6c9afefae91ae3924494dfae1ce356<KEY>7bcb188da65be4eb0c356516246ef1<KEY>4<KEY>031d6247<KEY>61<KEY>0<KEY>6<KEY>dbf<KEY>cda<KEY>ce<KEY>"
f()
COUNT = "7"
EntropyInput = "<KEY>"
Nonce = "b01fe9f159783d29824bf8055c646c93"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "60d46361f9b1834<KEY>85296bf3ca101e9bab6bd4f03b2adcc870ff9987afeddd9e6ba1edcba09f79192adef6b561c5c36dbe8aeb196da9a2384259583f6d40aeb54197f0291e5b70a34aa559558358b88f5786cd5822a1523dbbed83314882c5083aead0ef17c2ca94e7322142706cac212a5521f6d4f881ac61128b13e327f4b5e81c6bf2649b01b40645edb9aca61ebc58290db9f46eac6cb475b5c3a9e481a80cd98f548031c99<KEY>46f41d85456fa87f824e8164b408dcf1aa14<KEY>3f9<KEY>36<KEY>11<KEY>1ebc<KEY>3<KEY>0<KEY>"
f()
COUNT = "8"
EntropyInput = "<KEY>"
Nonce = "b5d170cc69ee34ee7ba73f35646512cf"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ce<KEY>54bd42cfe4<KEY>fbb8<KEY>0283cff<KEY>dbd56da<KEY>6<KEY>7c<KEY>cfd<KEY>fbd<KEY>"
f()
COUNT = "9"
EntropyInput = "9ec905ee3602c95906f6084b8cf69a8be76d268652035370cfdf13a871a85f86"
Nonce = "a7764c145e668435e219dd8cf9cab23f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1996b8d7bf0d43454d61239147a8b32a27d73e0b1c1d8bbf8ab5b751bba9cc813d8be80c0ac7d71ce30bbd5ff5b1b17c12413a169af3d081f8ab1739048a0d2c1c2e24c5e44b0dd7225eeb227610af83a4a271fc31da57213eb6d938edcc2da5e712210202a09020ae24967e271677adeb2dfe6347cb6573e413dc20ae7ebd151acc91a255dc5153be1f6dfbaa4f2b7704d557592961d9847c5d8302469b02e3ca07cf331b9e61b9ec64efd32f3405319506b772fee3aa1d2ac2d70303d47e193e0e1ac9c8565861a5d7f62e515d61f770e2ab3fed00b3f9e713058322586914d69491fb4515cb2c5d21cf07c710cbc4ce362383d084c857e73f62c58f76567b"
f()
COUNT = "10"
EntropyInput = "8dbf9b093d9a190ea8d588a16b5ff2f72caa500a3cd55e0a0b7aea0ca5c41731"
Nonce = "a5087104d6327761d61843ef45cbbe88"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4b4ed879c2b1980112e0f4e627eff8f8c7d210f2606aaa2f7d26422c3e4dd3a66623ee501b702ae194b7ac258613e87f248bf49b40d0df4427142185d2e94b8e14570a00efcaf59ed542454f250475cfda7a98d1c1450978336f613f704dd9cb87b132ab60f24a51a1e1d815ab7e1d96967bb255dc5ac351238053602fd774b9223e7f079a423ef7b0a8ec9a71e222825ebe3c817ded31c2e6c68e9ae26feec7e75fd04157f60a25ad6c13734ea8ffcbf426dd61f4adc1a15e0693b420afc3035f7c847766430792b4fc78a32377a808c82ca7a2abc3c8370a3ff192014ffc819b5e842596cfc46d0c79546ea429f744f5b1acf603e65fc472d592ca07c8d19e"
f()
COUNT = "11"
EntropyInput = "222e8db3a1b1a95497aa0a141277d9c9c643d0cae5f47d1f58cc15c8120cefc4"
Nonce = "5836e4a886163ee0b2966ae82117b48e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e28b5015a08bb7b427bb90d734089a277eb749803280d5edd578fd4ab6bf48c3c6ad69176c116b3d98452e377c08bc4c2d06f552db3258c0c4062a498e22c438114dd312353e47444f4a3e393109fa4a33fd183b599ac0f7290726f9589f24a266e6214dbd0a165e22b277c88047ce9aba14f0b0912920560c89c658997590b4e18e7bd5989e9<KEY>b<KEY>0<KEY>3<KEY>0a5064fa134276b7617bd081<KEY>3<KEY>dddd2fa53<KEY>0<KEY>be<KEY>aaa<KEY>dec<KEY>eb<KEY>"
f()
COUNT = "12"
EntropyInput = "c648e453f220fd4568476502b7260069174cd037157de9021346e81695a0f310"
Nonce = "f38c95d2dd89f2f83a26125306249bce"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "43a9a34282ff596a085abba35356affec9178ede69c2abb61b6f697f8e88c1c89a1585a246e1ba6bab4f9ef2d886bf570e7e17b587bb5a65bdce7c23372eff0a56e66689a000c0d30620678accc0196eca5c3b28d2d7ab89e8919e8ca<KEY>"
f()
COUNT = "13"
EntropyInput = "19306c387a4da3de2f76013cd9c584dcf5e91a85a6dd35c0f25f2862a785bc0e"
Nonce = "ca0ef920312aa7c7dbcc510f9fd0c29a"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9e13d3d914923d8a6f3d182cb8b17bcaa961ac018af69a716fe9c95f091c7e15877892e001e2b6d656306cd8359<KEY>"
f()
COUNT = "14"
EntropyInput = "<KEY>"
Nonce = "ed884f91a94c1b0a51f316df776283af"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c74ce568f0<KEY>4<KEY>3<KEY>25a3d7c1<KEY>9a2fe87d565dccdcee7c62ed32b577763f510f0029a99530209628359bedf4bbfed1a13c222692d8cae60ca736df834a6e316db27642ed5839d2e11716a5c06e8d067e8548d7ac0687da801<KEY>292<KEY>2<KEY>6<KEY>4<KEY>"
f()
COUNT = "0"
EntropyInput = "<KEY>0e3a1d456f6"
Nonce = "c925484deeb0c02e1ec7a38ef5e36794"
PersonalizationString = "6252125662bf914498ec710dd31f0605278245e955e9533099ea9afb0ad6ef63"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ea3ee991336bf6581121965ff6a6283014f5c523d1dee5dc80e2721eb83a45b987d3a8abfa55ee72ed6cc2068588a6b8caf25fec88ab5f85ac642ba24e8414ca1e707e3d10f7908b186a82db2b68ce58fb47b670730bad51f8680d59e179f032de3a0f79723b933673264098fb1ec8f3793eceec7131cdd562898fa091571df4cd5e32026e7889fc8b659e90eab98baa2cb43096c352e58066ab913f05e728136a83d24e76b41c21ab6822c4ca4c04e14733a1dfd2b71a270b528346315609139005194b7f3d07bf28108af97f09fb374a57bb9aa7680cb9e78e2160c972e938ffcbabf12b971011ab7c1a91703d3c1c394463d907545c82623a3ae1d2af3667"
f()
COUNT = "1"
EntropyInput = "ef6b4f56c5db9f685e6ec380c464a4dbb95cf606f084586c58672b15d053d64a"
Nonce = "e16ff3c7a87dcefd6e10de7911ca6ed9"
PersonalizationString = "50802dacbd92284106b984a2e396fe6bb812d99854e400089aa90cd5f144269c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "879ebdba3b1b84207f6fec1a1634ca18367ceb5965f19e27e5ff68560a37604b9735adfc9afefe54a5fa2dad2518256d3c1df4df770f674bb7344b10930d1216af13a34605177f083b4e33709681def353db5af5a299736697222ce8b642e11c745ae8f0cd1b76f4ef769982defc93c1c70ca94ceb83f8886859ead2f726e3fe2f4bca26af14cc7709143c45a6a5b958d91660ff<KEY>"
f()
COUNT = "2"
EntropyInput = "<KEY>"
Nonce = "5a8694dcc941d12b4d493c19cd570de9"
PersonalizationString = "2216173dfb01b06b657de3436d0664a388f808b60756149be8abdceee6f4cf2e"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9207bef177758af5c15d7d3966830b6ef24b4637b6add27942c6d424e2ea88f019c0461248d2617b9465a83b05dd41d7068a7a504c8db20ba0764e06b94b90c6bffa114fc60edd4800d5f58c423da2<KEY>"
f()
COUNT = "3"
EntropyInput = "dd3ad19720c1d6c4879fa48ae23714bca5a1d66c0954931869185b48dbce099f"
Nonce = "48c5d647187ef550d19146ee9cb698f3"
PersonalizationString = "18f7902106c00d137e6b15a4bed0b4accfe6646128ee8823ac669e24179303df"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "98<KEY>9e9a4b03179506cca38808f3f7cfadb64f3e803c343a86285fa12038acae76447185fd501d5a2e6d28fa115dee82b51dee3f3fbfe25e773d251a020f563aec137c70039b2fb19280dd6af9ff02b637bcbcd9e797f26106906f9592538f4c2a9dcd48f1ecb38f7c2ae448f21170ed80535ba1a8f54d75e4d716a848a27d49fd046862dda79f1988ba90e3ddf6b5986ff969488<KEY>"
f()
COUNT = "4"
EntropyInput = "5e2d0af8be964d1a61be969defc7f60a06814b957be5cd8ca15664f497794b71"
Nonce = "2eae930008a2aabe1f198c85b8a8d6c0"
PersonalizationString = "1199ca7cdaf509f81d91ffb82fde7c046ac4656d3b5dd0cf1074fb5038347e49"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "88daeabbe4e2a2569535426d288b9ccbad2cd69560575ab7a41059f59f8cfcfbcd0e2014407cdb6704b017778d5212cb1ce4e32d644c3b41202013f56853be5339df4213982c4af9ecf7159354277e03618b7e43d1f0598e8989820d523f656bf1fb337b50c983c90b05f87f4f758f0f087bc6699332efc4674661362f6a503374016808ad6f40497e4bb0e114d42015725d9b19f864fc3c5c5c0ec00b8053a578538da3e137c0b4be7bf851f106e2d95fcdd7ebcb1375ad3c73c9873e70081f699adaf7d84ab7030e3b223170c051b8483f23159e98ec9220e84c0077dd6953d407dfb1e3748b3eed11e50ca7a39f89a003ebf69e803ee20d60a6ac192195d4"
f()
COUNT = "5"
EntropyInput = "92ca3d101093735e51f6fd573831b25999b1a5ce1c097e4f77f4aafa6b4c80fe"
Nonce = "d72dbca1fee829ae441d39da0465e172"
PersonalizationString = "22e63e6682ce40e6680f2cc9d7a9ad1a596fc6415cf064e928bb1ab72df2db0d"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a5e34c0e957adb585c30195b1273b68d4cec0b345ed1bf59411733fc384d62d47ee2eede9fcd4e62781b7c2a03d5edc49d2d199f20a0942f26d97426e5c689bf7b6b81332ff8b4f9ec595e604a49c5752761c97b3d592ac04701c561a580460ff11351cb885c34834bc46d0584ff4fa9b449fbd9d03600dc1bd622c4e4940bb6a64f4ac7e71e8c23d52e1c348eff5<KEY>"
f()
COUNT = "6"
EntropyInput = "e1d4f840d1a01cf5e3baf6eb6aab35c639f60571275f1c115eecad9ec2758f8b"
Nonce = "f5c70fdd75c0aafbf443d897d31f181b"
PersonalizationString = "1a4cc8a65d133ed5e0548f770277d0e3eadfff3c24f09e00f15f1f0ccee00d4f"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a194fa818179426cbd54eb333c2517054cdf917529d3a9e589f27dcdf99fe3c342b95f4f79806c236f786a38bbe110a8693563ab67ba6568b45e309a6d245b1f87ae2d48ab1d3ea36cae52eac12b44f4680f2d611ce9c72f56663fd1e36fe45aeaee8d4e996c1f7d38aaebb0b531e2d663108994ba31a2ce149d5a32452377e05dc4a413df8dfb10b3595df855e0e07c2a347331e871c0b00139bd0a2ecd715a4a5a4e85239f466c779d96f44de09142bc40f3a48390f9606d65386a214d99932b0ed3be2af18bb0de0d05e8a875334e62291ae6c0b91f39fc1586dded2d2fb318f2d26d843332218798faefe3e9e3425502efdf010d1dcb<KEY>32f6343f3c85f1b"
f()
COUNT = "7"
EntropyInput = "<KEY>"
Nonce = "67fe6aaf8f40159e194a0cff0162ded0"
PersonalizationString = "6aa803389ba0af55905fd1873fffc6c9453034a363dba07bee0cae6f73254fec"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "912f5656584c52f95a4a503e26c23b99fe2dd4b96fb03e8d86b29d780bb55a0086b3a77a67ab163c56abde4ceb6a68c4b06eba82371f587ed043739e12cd6e722a6d73d01495ed89e35dddc2b794ae7155179c609dc4f9a7edefcb4c92e1025aff94a9d24b7d84d<KEY>01<KEY>db<KEY>bbdfd<KEY>dc<KEY>cb<KEY>d<KEY>eb4f6046<KEY>cf8f58cf5d37ffbab4d6b1a56136ad14543e015ff7a225bacf8781525e96c3e31b8da29c6805572620feef74b20360764fbbdd06233f1a94905c378c66ce86066c12cb92f8375fbf14f4fb205de70ef7ed38b28932fe186bc10f6dda1c73c20e18718bc6b59b39f5"
f()
COUNT = "8"
EntropyInput = "47369855076e8388e990cc50d9eabaccebb582e6c369a99b6060424fcc23494a"
Nonce = "afc19984384c07a8fcb59c8e63ba97e5"
PersonalizationString = "088a77b7655f59f2dba8fbb3aed15499e13342d66c7b0655cfb1b1395c725b44"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6f084fc8c0b936aaf49e1a98f3a96846735895ba71b246a837516b6c678b5f6a8b9a091fc6bab3307f428e97eaab850e5cd014e7fc356e2af6c8d673fa58c1bd201fd8be3f38759d109bd06d6452786d230700ceaccee38fb0de9dd05a5f9d0a64dc447ba63f92d93c58464f5a14026c4e2d83d8af8da039839552dac49fe50ca95fb38ef1dffd8ae4c1ba5640621c087118f8d71d69cca33cbcb58742a16eb90bdfa51238877e55bcdb018cba252e26f222272a6c267c28be26db945fb4f0cda1c0b4ca281fa2a85b2625504609fe86005b9e71237bf50c31cedf9e13ef022d6b348873d9f5eb3cb9a980e063d76c9e1baab412eafe3f6980e560fe6d8efcf8"
f()
COUNT = "9"
EntropyInput = "9770de601e4657b3746637e5599a79f4ba210bb03d8805fba3fa1f2f26737592"
Nonce = "148dc9db3e1e58a31fc21e596dec2324"
PersonalizationString = "5bffe17060a51fe205385ac70c9634873cee14fef7ce2fa8970f7e9ffba450f8"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "30339e731f1f4fc03c326affccc77c23678f6ddfda53b944d9ccf8429b4ff06b36f77e5e0fc378d083c9381e8de0a24285aa3b17dfe2ce7f3fe591afdc0e9a91e9a90f69566d104bac8086781e543487f652d77f836462b01a3c5f1e8208ec43f6f7aa78bced28b9de9b1de36a468630966c0762e31f6fb8b0d07a86210ec395aac19c5a4f3661c9f7de171106f656f705ef14e7f30d3bce37335ad53093f5dfc1971c39a0fece8259800d1b022de76cf250bf5d2a22ff62227a8a4176f9c8308bfae7fa68c1fbe7b2027254c39a161ba4280e38785f664afeaa3ab2df3c99c28939378c1864282715d16335c8e75a085d7f389aeda6c26c331683fce2d01ace"
f()
COUNT = "10"
EntropyInput = "381ec64f6818df09b9295dae3adabcd409e6302d5434f15f37ec9e5223f08a05"
Nonce = "deabba7b30c167c6e6876b63983163a9"
PersonalizationString = "698f68deb716fa4258dfa3869119bfa258b0645f9742bcc362988251276659fc"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3533a7cf3cc1aa7b16ce6be85d863b65734649b6668fd63dcbfa92a320af14b6f2bd01008e6a7a2232f36b4891a566723d63c4915ecc00915c96b0f50bc999d3ad4783b8e3d6157b5204d<KEY>80<KEY>6<KEY>46246a28<KEY>5<KEY>9<KEY>4521<KEY>fc1<KEY>6b34d1<KEY>4ee79<KEY>18eba29a1bc7c10bde98653e732918b6176ad764f3ea31543240beb406c473f1e60f6b20ab383be850ddf581cab"
f()
COUNT = "11"
EntropyInput = "93c686ac3e6a7d9a4b70fa7152354f3eab1641bc3afa7b4fe4629d94613d359d"
Nonce = "2c0b9cfc3c188fd6e16721ab5186626b"
PersonalizationString = "<KEY>"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "47abfa2d8ae584ef5<KEY>d<KEY>84<KEY>06<KEY>82f6a3cb366cfa0d6a8582cf99d32e89473cf7a7d2db63e964e48557a1210499beddd73073028cabddf737a8ab9b7ea17f4ed7bfb94c80f03f5f0<KEY>64f<KEY>b5<KEY>dfa0fc<KEY>"
f()
COUNT = "12"
EntropyInput = "<KEY>"
Nonce = "98de460f<KEY>"
PersonalizationString = "<KEY>"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "10b72d019296b20db00cc383abdbaa2b69bb4cf3<KEY>6c4fbf8<KEY>fdcea1<KEY>0d0<KEY>cbc<KEY>3dc<KEY>fd<KEY>1e10<KEY>e86f4b4ff6ccad0dfa1e5a27b619e62fece2eb9b6e65c5aa5fe22867304d46971a6365e33f60821cb<KEY>5460<KEY>0<KEY>33c7771e<KEY>1<KEY>6<KEY>00<KEY>6<KEY>bf<KEY>0c1c8266673e8dad1cca8e6cfa1e601be95917184677b7534dfd2c6f1640821cc675794b29fcc71df517cee4ae6efe95d2fd866939aca4400ea374a8acd"
f()
COUNT = "13"
EntropyInput = "bee32aca74973a8b63b36cd8ac04a68f36484202c6249ba92cd33a1379ee2e6c"
Nonce = "a5d175205ef0278c9df481f882d482ad"
PersonalizationString = "ac5f8a3e150849a818d0170bcc772e0397b7c70cca37a466fb774bca78e4d708"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "22104a4798cdec3742e654aaca8122f69437867fad058e34e840bf94d460b61e2d7aeb653ce8c8723c00df1b4f77eff3a70345c1a2b3fd601075667b5cddeec75bdea28a5066833f40b50d7350b12a5cd93afcf19b353d06083acdd05f8c8b64542c3ab2b4ae1283df7fcdf747d3b0bbb3ec3345a0f8fcd156692a4a2e6d887c8f3da7289282865f4d75e0ac46cf06b4a93fc0f7ef19aab22290104095cc1f94b03688c7b3712491b9ab2990c2041<KEY>0a22e6b0<KEY>e1bcb3ea75<KEY>0<KEY>62fca5bebf<KEY>b<KEY>e06<KEY>e620<KEY>ca<KEY>96d<KEY>fc<KEY>da8cc0<KEY>3023626<KEY>66<KEY>e2590a68e8028417e4ba0edc1622a6f1b4d8bdf9519aab87beb2f89888e8b3bd6a0d42107653a69427f"
f()
COUNT = "14"
EntropyInput = "cba112f4a75eb3dadb31a728f3ea66ee4671e971a313e6516ab3b3890f7432de"
Nonce = "70916df78dd9ea799230435b3e48686b"
PersonalizationString = "bf755696adb9c92839798798f836b063cbbe987f0163ef3f4a97222c888f5da0"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "411cd8e76e711447e8a93ca95aa3aac5e51f559d65a8385a15e71877ac8472a347d9d453bd6761655711ce2133900d28e41cfd1292d28848646e5cbdcac1e60e49e62aab169b1735e701e38d65ccc073f277972ca85444dea<KEY>af<KEY>2<KEY>d32<KEY>2<KEY>2<KEY>d<KEY>aaa<KEY>ee43f73<KEY>1<KEY>bf0<KEY>3240<KEY>3<KEY>7c8<KEY>5dc3e0<KEY>62<KEY>62<KEY>91<KEY>f486cd7<KEY>5ff330f3<KEY>316afb762b1a06cf8b593ca00d7edf739e2e6827a7af662f33bb09fad09d6bdb3a565f2bd32512c79927d390c79a1cc6db<KEY>68b13<KEY>0"
f()
COUNT = "0"
EntropyInput = "b8986abc6b50516023dec0e7781e93b4b03848dde5e52228d294554df1c2bb00"
Nonce = "f33c24a6daeac094c1ccd55cf361977e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "95b7f29293e4a8f8482708020c7ecd95dcf05cdb3df4a4483b686419c74582b9e98edebf5ddc6bbf9814f17f6d46eaa90cf3c13ee1<KEY>e4fe<KEY>1<KEY>73e3<KEY>167a57a4ff8cf8010cb3bff991f4e93e70db1e37f40a7a82d4faccc3be32b9135d027d95ac543b632a310620a02e3b470a254e9dc98c4e99e0136a104312639809fe0dd94ab03a2eeeaa43ad232e3793b4aa7b0b78767d11c85d2f87f7849ee2d7189f1e4e5b8b08bac8464454350<KEY>1e06e7<KEY>7<KEY>5570071521<KEY>7<KEY>7<KEY>3<KEY>2<KEY>8<KEY>2"
f()
COUNT = "1"
EntropyInput = "<KEY>"
Nonce = "9d117b412eb74a7959bae27760f40e2f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "63ccf23c51a7a4b0<KEY>"
f()
COUNT = "2"
EntropyInput = "dde440ac558146a64d1e2c2f87eb87478e0bbd74e136e689f3d265256e241477"
Nonce = "fff859ca9364614d9b5863eb66241c8d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "106f18c8ed2c030f51b4e93558dafe67172b90d87ec55cf2bbe05ae4e5b4aa1ccc48d8e394474c7df81a1c251fc7e3e6ab3c19dfce7c295f254bf11cd7b111b78ccd711fd87eb3befe8fd7eac04bc74c9c5973d4d1e49a6906fb89bcc7596a2d5068aeb44750029a2527ebca0be10a1a1cf6bfb07d76424fcaaff1a363723de6b4c0e5dc571479bfaf2867fa367d7d959b948f45b195ec62132223170f8fd4afcedc7a00d27e61fbf700f49d75dbecc39a9ae57e5f3912afcc5332e079474c4b9e378583c55e3b6f073701d887b2eca9bd847b6465318b1a449e3eb10b0471a7777253dd183c61805b0d8014467c6387fc32d96d4eb52ba83d3db2f28ee05a2b"
f()
COUNT = "3"
EntropyInput = "1345c9f6856380372ce69dfeac4ef92df722f03ecc518641706a051745da310c"
Nonce = "3bc180fbc657cef9407b75d1b54cb1e7"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c83d6366f2f83627b33b3c656a259007a0077cc81b898dd4d61df0c29a2373fa40437510f34a5752e25d70641936f47a37c760a653372e557220d2315815542b7146f4aeb3ee9f9ae20ffd438e252240d8b2e08b0797d4cb1e066003b76dcc678adb112a82b7a3ff1bf8c65452b302571d5fc02ad3f32272a6a386e3c977e756ecaf2d3d02e8cc093b862897ce2e5e948dd8f734d55fb17b07c16d6e709d79e6e5f55f9ecbe6e273a17d45822ecd0ffbc3c6c414a0f9e48e47a93fe851f95034bf26dcbbd1ceb9393eddd6af5532b4890b492217fe1f88befd804b6ee1dbd4deafe0d267ebb3d3b8811ef3a56cd6a3de86cce946640857a30f2f50bf2b49cd81"
f()
COUNT = "4"
EntropyInput = "d732d597e8a0422d76f6e50efa36e3730f59e3ecf79e315417a51f227541c05d"
Nonce = "def492adecfd386c3dd0182ffef8ffb4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ce4473c4d793faf305df6e140dc003789a07a30baf67ec1536f7aa9a7cc1f471a04bb9572136c171de8db565f2699136e27b99df40edda1feffcc2dc69105dc1cc28ed89b16043e11e4bb3d5d7f6a1c2af9a2682c50059ecfe1703aa75246f6e0f6059c3011c52a572851a9b6a833aeb9ccf2849dd17fbc9e83a038462ec9ba2237ae49abd362d3e8741bac32785296ddd9fdf65686123f8bdd880299a491e9236353321bb61251582c2a101a236b94656af99ea28697369e5e94b00945f8a78407b9a8271f3e2ab4c782c13a5e5be75537adc659ab2d163dc126460e9f6985dac8a43fdae67502239c85f634fe48064222ab8c3e74e71f8170a4c1c6c5f5951"
f()
COUNT = "5"
EntropyInput = "5c03a20629e0853b273a8c5e8f89203740133523221903a50b03ba6234d6625c"
Nonce = "45501a3fb480211f9d2b905ea7594986"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "5faf1daeb0830553498d82ac172c0772d8dd27da798244ab2c6757b52e0e0a296778fdd919b39878e97a22db985d2c6d68b67b73e6e43fa9fce011500aa9145ba44b118ceca3d563281fa4eee23f7664d07f1882ee5979974ad726d37f43bee6ee7a16e033116c4ccebf1f65a859754716c43b98021bd588c79bfb1926db0c0211f746<KEY>aee<KEY>be<KEY>"
f()
COUNT = "6"
EntropyInput = "ceb630090ef9282f160d091a8e72b664783dc3fb75991f3ae1f7c6f73a2af906"
Nonce = "7c00f71bdf80b23077f1f5b023c6e2d3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2c8416d3b2e9a4d1d613b5e15d8a11d47893a625cede12d0a72b2b3bc51a20898fa3ba2277b5a6aaf1533cf89de5bda5a4718a303a6e34ae7faa1ab282b96057459a743be70c4d966824ebdf872682ac4a28d24ccec49c5a8e001e33bf56f01a0d33c11669d75133e8711b763463e40462a78fec1f92859306c3515986a56aa3834dc6e9fb6adf4c59519f288c80519491f1c0f3ce10d06058ded3ac519918156427884b431bbc13d3aca7d10e0674733c55f727e18d84a5de635d92fed7bd08957434367e803fc2c8f33cf41068bbcba158bb28dc0913ad6456c3f5208413795909c47e375292b7d4e2e23a68df5ae3c5850b18b216991079ae32a211c95da0"
f()
COUNT = "7"
EntropyInput = "76b7040ddaf267ec9336ca11549bf3ca5b7bb0a8e5f9f5d8590ac8b6cf7ea1f1"
Nonce = "0dbc66c634c191cae0b2f868cd1e3ad6"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2895076c2ab15efb5ae7d61fe578f78301bd35cefd33f1e752a5bcb18a65c197479efee3b262277bc7af37bb6b3a<KEY>0<KEY>52<KEY>221af880d89be0ad1e077c94e9321608a11d4296c3d2506c6ed3dd7497934068604bc3f3d8dfc75<KEY>0f<KEY>8c88ee6bc<KEY>"
f()
COUNT = "8"
EntropyInput = "<KEY>"
Nonce = "49e936bf613e20debe5dd21c69109806"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bc35bdf36345602<KEY>"
f()
COUNT = "9"
EntropyInput = "<KEY>5efcd4e3d7"
Nonce = "45e7d8d1df1cce8e4c7b8440497523b8"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "434171f3f7354d83fec4db3d3661c711af86509600390f65a9bba8e441012ac77fcdf571d8ccd0cfd251912ce649fc54635a058ae7ee7cb6f569b23f878ddba61a7697f460e38886b6c87748d681e92f0bf9fee069518c54e8ec68e97f8a37abb2ab3a52229486150d58d18d1adf04c0da18681aacffc5aa930c3917b363d5d09563a551d357c36f0a4cf8ae1ac19929483f38cdf6622e6920eb59f53f2adacc373d7de0d44fa850de05c8a6769cc62fa06b1613d8027d926858aac39b6caf61d2d29435aefd106910234b1cffc5cd44ea7c09980e0841c7de8cce4115d5aa570b842a66aef9e2fb79be1a5b80b4d8e16bf6580195d88855896a781f7818de65"
f()
COUNT = "10"
EntropyInput = "9246151f2e277d5a46b79d0974eee76bd6a47b4d0464e01c00155697bad29380"
Nonce = "43e6b81c6860e213f058e63d2f3104cd"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e72f3fc80993eb5c3cbd9b1f5012b53d33e7c7fb10cc4371ad20f1b80945e41b4e7114130fc5d86aa3a2869cc28c8401708d6a52fee5e8fa610ef5f1bed0b3e6392a9d238d714cb4d177858508b0623ca80d8458509b12e2b9bbb45482c68199a9fab0d3b3c9144d0685b88200720fc0a58095603851397ddfab4b1fdd014aa893fd3821680cfa9fdbd356a62cb59939401715cd2ac1f878fe78b4754a5f0c8860c6fbe554a95331264ae2b5f918fcaba26b32c1ee5dcd9722684e7f5d7f18c42a1855ab7e2b504c6af919d3fd2e3b0de2022afc88b8e9082fae2949389456f323ecf76ba43074de7256b00ecbc0ce278ecd8024c37e684c1af05814ee2ad34f"
f()
COUNT = "0"
EntropyInput = "edb77aba67caabf66d3c8d413dc36566b7dd33c73d63e960ada87cdad9dadbee"
Nonce = "c978a652b5e6ac2a190904bc40d6756e"
PersonalizationString = "9b383b001677ddaf1170ad611a6290243deeee5d66800c4df57d9eadea09a427"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "44c890c4ba73a795eedd9166cbde015048f77ff2c66fd44897f6336885bc7549e624f203ad2e89765859d1189d09658e19e4a30d929a896db54df1ad5c3fdd8b87b8e5f90bae3bd9e9810e3cefd816320a80aa8b2ddec800c422befceaaf438005ae24a35568047298b136f47d832fef5ef8a1d53e8a6f1f89ee49fc560f80112f7d40859ab8c7e2e4a4618da79b996818<KEY>4<KEY>4<KEY>c<KEY>1<KEY>ee6<KEY>62<KEY>3<KEY>ddbfa<KEY>ce6<KEY>abb<KEY>"
f()
COUNT = "1"
EntropyInput = "<KEY>"
Nonce = "9d59d755eae840fbbfd9a37e9e02ef07"
PersonalizationString = "d5550e16a863843f4cd187bfb650f683adbb44c86d50ccc21f3e7630db3335f0"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a2c62c753a64e44e34be03981037275ae9244b016d05a2c9a63b36fc611c82d4ecd819c1d3910147b25b7bfbee0236ed6711a4293825c5d57cc1c58af1ddcfb8df533d81b6138645<KEY>2<KEY>2840<KEY>a7eded21499d7088aa60cd444a95915ce7767228c9bc4953d53f46d90f67e736bfd7dde2442ed01182253aeb8ea827f3049faff9c210e99c4b33ea6e623ef7b6d2c975c374ddce64f63860bc3c9db27015d23d97c27b90bef3088cec88a3d0d905eb1d11b32596b6b35281bedb3acf36f61feab9dd9ce9fb299f7d78e50404640827851222cfac558fcca1848da435bef281c739cd27"
f()
COUNT = "2"
EntropyInput = "<KEY>"
Nonce = "0da29b48baf4f732099e4eddd2fb96c7"
PersonalizationString = "<KEY>39<KEY>"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "<KEY>"
f()
COUNT = "3"
EntropyInput = "<KEY>5b1997bd89827d80009f"
Nonce = "7327fcb73b868a9cbfcff006887e24c7"
PersonalizationString = "00275a675d26641f1ab35a7528984a8dca8c97ebab8eb6eb28cb66fe84221ff2"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b81c15c53d887dcef3f883a7d59d4c9c9a0cc12e025dc35edac3bdfddc103075aef3f64a51082bb4192acd3506c485ef3860c3064c58189464540a81048492bbdd30bf008bedaf29c0da72f074dcd1de0a960ec0ba7bd14d9f2387a613c3c90b1641ddd7c3fab4dc87690d29d0e04ff239234f863d82411931e2ffaa1d145f659309ff4a812ebd0b42e73493236540a5f01eb1b16d9b708c096308696fe0e6ebf082b8056cd52fcc5c3dca38d63a6cac9c511bc868a4d66df93474ea8d2927edd1e82860de415aecb983891cc2fe543a2ace004049a9e093e04d4f70de538532665168811a460b266dd67bc690c85978be0a842b39d3b2dde330f2f9a73afb87"
f()
COUNT = "4"
EntropyInput = "beb782e041c9d9a5b139e53d8e08143e0068542cb2b7e5db08499b956eb8a886"
Nonce = "cb85d7488309f168aa876d0734d3ad5b"
PersonalizationString = "afc9951f1f4a984a9a8df813305d0fd3522bb403964bc59a74a81ed0c85c2310"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bfaa34c4fff641c7aaaddd740fba23c411e1d8b42fb3352c1727784880625d1e361c27aada86e9576769428746007526d5557e391dfdc780fe07ed6efc11867b09445ad1b7e2e2b0677347b9115af686e260f5d931b2018853120726670d5614c6baceaa5af00c0820ffc2a05ecf892f86ea228a8be5fedea5d92a8da790bc124dc9088e39c40ac841d10e2d62447be7d201<KEY>"
f()
COUNT = "5"
EntropyInput = "d5bf7d62d00accf87cd381fbd180da753d77295d2686363694a701c488ab0c41"
Nonce = "6b20f1e0dca4e33d41ad2e1e9c208f31"
PersonalizationString = "eaa87c33076d80188b5fad9b2a8a02bf86444c44da180b96d268b8cfb1542390"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "06526cd25183a00907d645d24335e149ca77df7f85e92748a7a87b61feba04664bcacc26bd3b1ea915ddb05efcc0afbfe9b0a589f059a8e683bf69223dd192bd88f3e2aef159d330bdcb594db1570d66efc1ce9815190e482dea0f49ade057e3877ffd9a09bcc026bf<KEY>e067f7c14<KEY>b07<KEY>bdd<KEY>"
f()
COUNT = "6"
EntropyInput = "5a85a9bf855fdcf49be93d2526a919a4894c0f3aeb309d40f207901ecc0fa28d"
Nonce = "602a3e7262dc08315232d907ad1f59a6"
PersonalizationString = "<KEY>"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "349fde4<KEY>"
f()
COUNT = "7"
EntropyInput = "<KEY>"
Nonce = "75cf81e0cfc6e785f9726764aa4645e8"
PersonalizationString = "a59dd29cca65bd03afea186a4954ef29206731fa886a48206ebf7fb6927a3e48"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "d6cf433eca8f0666456bafc8aef685dd0e754809484c24ebe02540eb23aa1347b6c7a50e2dbefe708721b4faa6c789a1bd6713ee9cf90a1ebfea3c3aeeb140cc98632ed1243f54089c5a1ad6e417b07aa2fb6c499d4a61243174c710ddf884f6b4852150ca52b9b720e4695ae896fcce789bbdcdf46a294c745d87d396fa9672e7bcddc44bb3f60c311a188666cf8881372df9f8d5e9c043ec407f88c820efa189256d7c1c7cb80041ed2adb12bde1e0d6c859436c7477af255b142cebeb166e1620e90a7678065c4af0701b56076417723756929b11b2eff02db9c453ee8dddc972cbba1609582bda90a0ae87a66939937e4f77cb1d377232b4616239516ff3"
f()
COUNT = "8"
EntropyInput = "8ea56a01e2005c37c31497fd29737ea3b4526dc41437fa458f0b5832ac20eb62"
Nonce = "d943aa0cd94bd4978aad7c73780334fb"
PersonalizationString = "1a42ae9e19b372b72c1b531514a053ea1a78666c16923df2f2e79e6180006efc"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "d6a2ac0a8ad361cfd21fdaabbfa801a355b11b19a1ef8bb273c4467186df3950aded4e5da688d791b82480f8f153da515624273839c737e104d45546e3ecd93a6dd264632109c64514a54d6269e4b532451ab5858f5822e1f591dbff0e059b7f3d4008b568a4ad5da523310a5b26d8db5a567ab4c4a06152113ee8f36a219630391c5dff713f1533f5bc008799156260d6651a40d37ba3943beed438ca200c4ce9fa7ded15c7f603ef42525a44a11d58ee5822085d5b20ab20e7edec9e85b547bbd69bba771ab4c3ff826dc431d6989baf43c9b6290e49d03c8b9994f84f8a284c8cae9276dd0ff1f5b667557c23d6992ae9fa10331b7e9bae6a8b91522215a5"
f()
COUNT = "9"
EntropyInput = "519b1945befce5d1e96187884347ef9b3cd4e5071cec80fb51c98c67c453c442"
Nonce = "2fb7d601b274bbf70e993d28e0ed8e72"
PersonalizationString = "3b80d6282d60ddc94765a1bf565f7e852dc1f02fbdea78b69618adc620c1f40e"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "84dd67414dcf2958a46055de4fc10ca01c25e6cb267382474a5b9d2f1368a57304c33775099e503f95ff1210d4a67d2096c10f1ec3bf20d743fdd76ebdd256dcff2e0cdc5a33eeb53ba22ef8a4fe3ca9d6cbaf80827256b4<KEY>2cb<KEY>1de591f52e6e75e7859bceace3e1777ecc049f3998a70144db83ea86fc064e95efad6e35b4106c297bfb2755f7fb30addc540c89a5a8851174ce22fd1b7e836fa05e4808a1a407ba0afb3532c6cfa8f0e927d958a51a59c82cfad3f8<KEY>d<KEY>2e1<KEY>6<KEY>88<KEY>7<KEY>9<KEY>dbb6a0"
f()
COUNT = "10"
EntropyInput = "83cc514fa8ab6bdfb33360<KEY>fcbbdf<KEY>cb<KEY>0<KEY>"
Nonce = "af261aca6c9304f2da6aacae2dc03883"
PersonalizationString = "786925c06d3c492a86815236ccdcc4accef34<KEY>c8f38ef3<KEY>faadfc<KEY>cb8cd<KEY>4"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8d0e4fc80515d2e3eefb3502227dab5ee4351c91dd01044c<KEY>"
f()
COUNT = "11"
EntropyInput = "<KEY>"
Nonce = "74eace5391ea07e06086ac34<KEY>"
PersonalizationString = "<KEY>"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "babea6d83335979e5a00ce624eeb176c3cee353b0a54fc527b3e8a0cc50adf9ee0b1c593fc7eeb9172360c13269f<KEY>2b<KEY>98<KEY>27<KEY>b1<KEY>b6<KEY>486<KEY>1<KEY>0<KEY>11<KEY>1<KEY>d<KEY>dea<KEY>6<KEY>2a9734a365d90795c24e26802d20ea0f716524cd4a0ff51d477d0576576edf380c19df4f02adeda7be181225af4531e8ab14507460604bb343cef74"
f()
COUNT = "12"
EntropyInput = "00fc95fa83856472b00b768fc708a33aa34f2ed9131806db181c866afd1462be"
Nonce = "d83ab71ea108ea16515709e570e254d3"
PersonalizationString = "fdbb2d6bbc8a928fe4517ee72aee729d0eb1271ca81af6a5088238431ceb7095"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c081d6b891989eb071bf0a0b71c474907265be63e377a09da9a960242031dd90975980facd28cd796a682204f82283748bbb5fae826fd9ca93aa1bd0defc349de351f7e6f20e21a0ab8136228698035aa25fcae2167118fb45209290df4e6913d0ab1c86d3c9fc6f6e0060888298fc66ee23654c084126579ec84695f3a186f5ebd25785cb46e9a59e255625e2818bad169e6f7cc74c534d12364370faa8a6361f9e7bf555d67e7242cdb938040a26ed80606fd06914e75195d534726318f07b8dba65cc62319e0888712ee6538689d59bea3d885e0726295f219d6592dac0789f804ad13ac299f740bb90fe4931015398a6dd5e9fda6341958111fce25e4041"
f()
COUNT = "13"
EntropyInput = "38dacb8077d4db34f11073e2eb9010dd02dc81ecb8ff3eb9b734f64c48e53fe2"
Nonce = "af14d0a2076e6a24f5ca02486ac730dd"
PersonalizationString = "28dc06090ccea62ffa3118dd24bf603ff69953c457dfdcdf1e9faced7d35e768"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "5c587214e8d8da5b7f02254ffb5a22010a67dc6bce57c87f0d0c06e055cab7ccb833f90eb0138a33c5fb4b0d0360004cc24fa15ae5dcec1338a8233479a31d9ee03f9ea28e78495e6abf4541b17ca14207beedde6055c7f2364564e62a91df25da12f61efbf2c<KEY>1c1ff1388629c1e323eef58c4<KEY>7e0<KEY>5755f81266<KEY>6721<KEY>e56<KEY>1<KEY>6<KEY>6<KEY>2<KEY>db4<KEY>ccb600<KEY>871ad705d69855db4a664ce644701f044630a57c2ed719335c5b45cc82e4c57e1408adeb7d748199a4ba60f56642c44090092d88c26e"
f()
COUNT = "14"
EntropyInput = "5f0d1e9762c2724d5f95c91ae417ec0bdc4646ffb3ed6a880f4380d514caae6e"
Nonce = "c600da30d68cddd9b823433845111880"
PersonalizationString = "8896ff67866ff1f59c8e5074d91e6b9112410c9b6a1eefbcf05a1b8c7123dc89"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ad8150de910a0bbdad0a674d032919ac3304d5977fc43ad5d5<KEY>"
f()
COUNT = "0"
EntropyInput = "<KEY>"
Nonce = "0af3420dcb3b3c9fcab87faa4b8d424d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4a7de883632c3994a36a9ddea329a9de611938d1ef7664d253e5521aaa8351fb2b0dfad134ce0265c244fe0bed3a3aa92f0d1a9c6acef83f7de0ab63f8f1c3d7fb0ba92789ccbea0d623d6c13fa105f6193899a01058581c75076fc3b3e4efab80a43bf44d001c04d8d506736ab1f89b19e56964d7963c05b9012eee267a724455ab95661b8264f617be5bf9cf3f802faef499e678f4ad60bd4d0ecdab530e509c3892e285796ffec16d86944d680f9798c1d3ee68723d027a30ac4a24cd786d4d831aa7d513304dace72161c247206c87a19138545abb73e9f3d152a633db771b8fc44a30ef80cf51b72cbb2f3c6aaa4d269d21ca261c4e37b738a150de07b0"
f()
COUNT = "1"
EntropyInput = "40136bc306788c4cefdb176bfece4f36a6394877701bffd97c3ab18bd612570a"
Nonce = "ffbc7fd2c6642875705ef4fd03626c48"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a285cafeac40e0f69ba54aad2ce4729c7dfce5986280394d21415ed3d01f42d058f6398cf8f0b66b1d106633485079ff222bc776320f545bd14dd1493558475c47bea679ed53bc467cfc074e80172ee4ee1a69219e9e0a363e0943bab755e321be51100f86c2699999ffd1e28c0a2cd5aaf39ef1a0650e0d2836ba8019b459f37c46a1aad8ebcb428212571d3311c5d62566786e802d8c332e23edf9520545b6862b9bd5c1c3956b469732ee9c613fdedcab0b549456ffefa53f861bb6b2a2b88ebcc6e0bdc46e599d71508029bd38da75dc3c25e72bcb005388928c65bbd95c1a5c998ccddd238f61cece503db24f29e7c9a8cf9e65ff6a1f3d1593212662e2"
f()
COUNT = "2"
EntropyInput = "a7b5fb892d79e492e2c8d71a0102ee88fe3f59b8e4ad9cd1d81b060fd8003971"
Nonce = "7cc6a54858c8cd55f2fae01c56697c6a"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a470511f2b6ccc5165bbbf869c310ce23938ab12c43a41f7948d33a82f11e80488908d06e2af77fb0f20afecdd0ea10066b620d31930a6bfaf6187957b6e6f81b55d2e1326961c9ca81652a9596dacb4902ff4884b58c5a36b8c05aa3c13b67d27b30ceddebcd53fd8b4378ccd8d6120542647b6890c4d02caa295d5ea456496113d3a08e3fac09111eda6a045a3772bdbc70a83493d32a3204247c616de698107aa903721fd735e9fc54192e7c8bf4a6cfd4c4f905a9378b4d675abf7767c49fbff7fede516f55a291023cbad78de62eda3626e31c1ea8cc59a675bacdd28c03aab810681ecb2e56304c238fe24a1c77c9e6e3418d037a775f6e92a70698fc8"
f()
COUNT = "3"
EntropyInput = "69b215896f256a733071f69845c6cdf74b9691e7763441de0e773a31e66443fe"
Nonce = "066baca0590baa636f46ef08f5a692a3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "01c9fe0a33ed105dca11803a2383c6d40b47a5eeaae652aca48a13e45ebada151ca8d67ddfa80695072eb6008265976e7a0ddb1433067d9f713f0a227c8790542a8fe78d7b22473e54bd4a8b5616db0201f1e9038beb957bfdad898b1c23e8af9c2b7fc2c9f96c6e6ffdd2dbf573cd78a6c340ec42d8be6025f86e873c596631bc3477848566ffbdcbd68b9e76cf38d96f4f01d8afd3962fde3da68a030daeb0034ee83fb292c1c86<KEY>d9238af6<KEY>0<KEY>5dc4d6<KEY>820532<KEY>0<KEY>cf<KEY>6b<KEY>ab03<KEY>3<KEY>2deb0<KEY>80e6<KEY>6ccfdefe4f<KEY>09bc8d6b6df8324a768dcba833f89538dfab26ed2e4ee631207000658343e45655ef5e75825c7810079c8092f905193"
f()
COUNT = "4"
EntropyInput = "6b1e50fbfab2832c10f5d700df82a557c65e02c76c93989f55440ef504323926"
Nonce = "2237e475dad8bf250e39186b8ea84c81"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1ceedd14783c8de93a55f78d671ab637df79aad2aa6c27a25e47adeeb972b70c03695bf3868e06651a58fd1bc9b1edd48d8a9f235d24dd6a75f62e70b27e8bf3e6e3f50bb86bff965c5e8825054ea8bc99b92f78daefbaff65ce19b509e502ae7e1c7d64780e9daa88e8080ead7d99da186c5862882b696159b9<KEY>"
f()
COUNT = "5"
EntropyInput = "<KEY>"
Nonce = "3dac59142e1618546d5daf95d3fea0fa"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cb4a6120b3f246e8823342bb72b0e1fa96870c444046e9118626aae0e127f79a69895508a0e40b2adfe07ed0f92c2cf72787886298350983ba75577bc7c3ae4f30d66bb1c5da0a544d0e49edc45f2b7d89179e55c1<KEY>0<KEY>0<KEY>3<KEY>ba3<KEY>cabbe<KEY>ed<KEY>db0<KEY>6<KEY>cefd<KEY>bb<KEY>dc<KEY>ed<KEY>c<KEY>aee<KEY>bde<KEY>6<KEY>f<KEY>acd<KEY>d<KEY>bb<KEY>dc<KEY>ebc<KEY>0<KEY>0e"
f()
COUNT = "6"
EntropyInput = "27fce7d15031d5dd6880083d1ec5c2a3e8625b8c4c0dc0d7d438266ec7de5689"
Nonce = "c59e3bcdc1f6e31367e7b8b958eaa7d4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6da842ae1a45995da23d6e3b5ba2c0ec56b21624a2fdac824f3fb3b04fe416054796e2f06977838cc<KEY>f<KEY>8d74d<KEY>410<KEY>1<KEY>8c<KEY>ee<KEY>e<KEY>e<KEY>e<KEY>"
f()
COUNT = "7"
EntropyInput = "<KEY>"
Nonce = "f279ca8bb4ea4c7136f0ad8fca7b7d86"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cfa3865020689702cb30dde9f5901000146b9b3afa92b34a88ef926071c5f868c7e5006ae33dc38ed990006f3d7ff1b3d412a325527effd32f416e19394d435043d3bee05166f22b8505fdefb1f28053424be60457833f988cb426f4a8279742f16d2163a898ef6a08c85d5fc77a8b127efbb118d0b1a3c288c29e8e0a299c9e13d3935ab6ed39a8a2dc<KEY>2<KEY>ae897da<KEY>e3<KEY>ab65<KEY>1<KEY>bf0<KEY>ec<KEY>6<KEY>e3<KEY>6<KEY>0<KEY>6aa60<KEY>bcf<KEY>dd<KEY>fb<KEY>b<KEY>b<KEY>fb<KEY>fb<KEY>cd<KEY>bf<KEY>dbc<KEY>4"
f()
COUNT = "8"
EntropyInput = "2823011f32eabe40c1131b36c9f001cc28f7e86f15db184124c15e26b8d01914"
Nonce = "bd4af70749da0f3f64a915dfec31e50c"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a0198acbe891a7acbda52fbe35181c97d58d39844fb2975c96eb0dffd606092e691048ba65295bf2db16aac82b094a93667fd18c23ad5c0b564120237d3c56da6eba0d39cc4d8e023ef15e7ead8e241cbb8d0b2560bd444b84ab3c85c1eebce0ec40fccf680f2c4d440214125a2735d889da956dc3a895c7a69f07854f962f354e67524ed18863ed71d3e77816bf460b171fbd81b0a7c364c0f6ee18d32d7543a13cf5a7d7b992b8bca523e0de92fab578f980cac24d779f806565467702f75021652287a96adcc9f420e2acb22528ca77013501d9c7e5764f625f7edaa52a26b0ff184f343bf24477cc54c893c1434f7bf38d18efcf255c397b9a70fa0b64df"
f()
COUNT = "9"
EntropyInput = "15dbcb3de71426dc0aea3a0851e7390af9e3bac12e1db58dd931d4ed2d9682e2"
Nonce = "d87baa587e87d5b0c32d734dff92d9bd"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ec3246fca162a62512bc4ad2239270b2b0a98b25f6a7bf0aeaf80099c4c2da07e33fc1d58d41d85df68113c0d0decaa92a3838de2d99f807d615b2e969669422d9d52821315baccaf3a3630b2a7bf7f2c75a59948974759f6bb53d21ae9b981ee54261168d707eb45c0e0f7332ba702f1be30873a96f66f164ad4e78ba0ba3e5fbef4caf4b1d807e7233380f34a6d48013763bbbb5c6c16a83366dbe061b480ed45c8901804b117de73fc892c819ecc42951b130465e30f4c54f0112ad62f7b1193ec0c7725ab6489d343178b212e74ec147d3fd520a9ad9db384073b22a6a478f64b37a2e76cebea0e246660cf80536145719eff348558a72e84eb50245cc15"
f()
COUNT = "10"
EntropyInput = "6a36ca9ec24741c1389ad722a350c61008ce53432c24365cb6a60de26fff37a4"
Nonce = "50a4c1c05fc3893876e627976e1ea388"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c54305f7794a66781bbafcfcd1a5af259fa3a8b4d47c4e3ececcbbf80f885fb50dc93dcc507fa9109c238bc724289f5e3c765ffb4289ed0fd9bf7ae050c0154d11413997e61789c8bb806c61f4002a63bb2ca21bac9ca65abe92d0594da90c4e122b6ca9d0d4db29265783defa05ff40ff1e6c5089e8c1133d85d8de6f5cc20699659ba4d93e076086bcddb51bab709004e0391bb932440c951ee064<KEY>"
f()
COUNT = "11"
EntropyInput = "f42f1d6f989cf2df671516b14a9a5d72a4825ae220e52b058cd32d09802d9dac"
Nonce = "985aec205afa866c62d988545950f210"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "65b86867a230ae4abc0c4e4d8c6836a13c1b289145df5111dd75a2c863823e77fe68925696f51e9e9e3ecd8d81ef2717ba90a537f7f48d8c242e4494bda43857314893a53dfc887ea27a3f8fd809bc536e6bf484430ebe45ada15426b5d2d994549cd800280654b29ee75730b8d53<KEY>"
COUNT = "0"
EntropyInput = "f85649f8a8c01f8a2925f7e93e356be0fbc75206d1ce2f7e04a14257c3338a48"
Nonce = "01a8843b7a3dc0b1cab5f7c8b001598d"
PersonalizationString = "91022d072824cb580ac07555c90a31373f2dfc272de60d3bdbc0612e175874ab"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9f40affda9c797363a7b058d7f5b848f0ba366808e7a87ec94894091ca0818dc387a8ab24<KEY>0<KEY>3<KEY>8647bc920e6a0c865a297bffc88b407a24e2d2aead0e711fcf96b83bbede5bb35a5f9b0dc5e2376a693afa9070a4b1aa86dec23e6e597<KEY>74237"
f()
COUNT = "1"
EntropyInput = "<KEY>"
Nonce = "d4e9df171d09a7b93949907ca65fd5b0"
PersonalizationString = "a36<KEY>"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2<KEY>0<KEY>d<KEY>ff<KEY>cc<KEY>d<KEY>f<KEY>af<KEY>dec<KEY>a6ce0c<KEY>b"
f()
COUNT = "2"
EntropyInput = "e2743de1bead33b91f0fa01a64e2dc2175749260d4475dc1c4652c6192ff65fb"
Nonce = "952e8d0d03b09130e4df1de0f8de4484"
PersonalizationString = "b187c33f16414734eb500c3c3230d3600c4b4251c2c44085b7a585c86dc713a3"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "7da54694edc364dcaf51bb239b82b3a8956264bd1279920b34f6a7a33395900b49180e38f0e97a2b1c5b7fb11bb1e4672275cae66a007ce88d0decfca929766c2c07e019eb94ed00094a5e72a82ddb00badada39d4eee8900dba0e71ba29750641908dc4b4eec95ecc3b49cc9df72ef5ecfbd1fa8c9eda509301222f9267abb4893470a75dfa86f793db4fea9bfc1de6c637c2a29d6c60272a521c10304bcbf595cfa632798701da4d50eb776d4dbe01865a8471c58e2cdbed14f083d6b4ed3cbafe1b2ccafe82e73151a8299c3a04d36eb713dd47c9f4d306c0e503026d7d6ab6c4789078c8c95ff5abe002b4bb86a369b91b4ef23c6afc0559a2cba4ff53ea"
f()
COUNT = "3"
EntropyInput = "aa1cfe4c9f03a9990c2dd55c0775ec36f3daf3d64873ef84369<KEY>b<KEY>887b7d<KEY>a<KEY>c"
Nonce = "70484796fff90a01cfc2168d1d0f5ed9"
PersonalizationString = "21b468ff6f1e92ca410177941ec0bea74990555071cb7d7fc0844fb24cefd511"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "72ca74671d10f6aa0607c3abf4e86f022af34cd8c32cbc274eff9bd38bcd4b79c64b09e68f44a3b1c6592b7f458f743f99a3971becf6acd974792dd5812d473891766460b028f3724036496188bfd2fae5d3bf734d2503316db5c9b408496e9d99712dec355865c240d3209c1793fcc815df057ffe555d2bbf47e7370031893aefec6ef0e71d137e16c416dbe52df3b98f280f5e6b29636d7d9bb0999139fb5e46bfec53bb22c8fd68d2a15df7d4e1a2c813ae363bf3055e6def008ae16343ded598a0c08548801189ced03e6f81b31286dd8e3eab82d648b6a9fe5aa6fa1f951789cf4f5815e10188d2d9755e04f283373ce7da806cd92935aea243d6a566f9"
f()
COUNT = "4"
EntropyInput = "2625400a6130e77fa20f0b7c58cc0f9d0f22ef5ea54e5cfa6e6e648933d62322"
Nonce = "dff0eb02fc7ce93e4be2e294a24509b4"
PersonalizationString = "cdb1072fd83114ef83323ccb03d702f68a550d7a0e8b153a95eb9f771a271861"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4fa6071756afe972853072ba73e203773937f7d6e1dcd7982c37ef7566369e27add7889b32ed2e2c2669d00633c22d91fd98f2223789681fd3b1d93a16c2278b8e4007286dc1273e5abdce7845f87c066a59b0d8152f9c13230ce488f9cf00e7c3e1e0c3719e6087fa251e8bb4ddd3e778c6149a14db3217f172a8bfd656bfe6fe2c4960768adeca843f1f36671b722fcc62dde8b2e0c5765c6232ada6a4504b21f350786d0879408d8979e19a3aa16f0ec47df3d0836296fb88363d1fbc687bed75f14ccceafb185ce90c2b0f5cef3247f1573e822c19b1b9944204d42a6101326b127262b7023e89824a3f2d4fbc4c072ed3dbb7325e77eccc70cd82218f43"
f()
COUNT = "5"
EntropyInput = "<KEY>"
Nonce = "743775b879b22ba24d0b08ded6298ef0"
PersonalizationString = "1d8d1abc5f597648889bc220040cfe3bd49ad771ebf7ff2ffc9a7bb8ce2cb285"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1cd45a83f0236d70908291a0cb24e8af67268ba14492c0ee4f7f736e48a3da7c5bc80a0aafb54ab028907477463d7587a11c59cf2add25aa799fc39290c2284da916790985dd1d842421a24186aec5acad4ed5e511dab8c28f2a2a0b2449d1aaeb5265e5df2e708e761a42df5304dc92dd2c10028cbdabf5f21c1cf572cb0d55c194a273c166df5dce469ddaef537b3f5e72b6ec8c3f32e2a69d90a640ed3f219832117615c209251a467f7343df9a6fb891c6646f01f896d83319bec63cfb0e36d35d5b554f08a0635c3605d51f9e7cb8c32cf69cf3cbddb02f68c321ae08cd185de20256c9c78efd667a35a3c423e6a0d83213fe0acc1a11693b641037daec"
f()
COUNT = "6"
EntropyInput = "c90ef2a9a1cf4936689ec66acf771e3b0faaabbae4af866d4595d20823d04df7"
Nonce = "624caf43c3fb18b0a9b9b7b56245ce60"
PersonalizationString = "ef05d14650114038c30f441f8484301d2442f6b9167f57f1f2c0a77b5c91212a"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f89763a96ebbc1c4b5d5730501dd5a5910a9b907b1939442562ed880bca94724f9392d31eced9bb670cf355d5113a78f6b6993a85954c8e52d450f14815e8d25f3c5af5e0791fc9f94220994d58b7e3decdaa01993428bb597f1129c7c9a0643c413d0696df191ab0b18691c77e79d5705ed144a3b54ccb3e025f4f71d62cbbab9aca0804b15325d335a35b8ad9d06435ca2b847fcf45a2bd0afc95583cc11dd66f63596c9a81ec1244a58aee352b59cd4173e1b5b51e88f1d64ed887dc7c23efbf7ef49e34bc1324e91d17403052741dcd7e1e5a866ce3e2e424096a4c67ad818220a36a4ef8379f7650a2e49a953fe488202f1a95fb55a929b0e3261f181b7"
f()
COUNT = "7"
EntropyInput = "fc9e6a14f9614e1430dfc99640633f2195e35532342ccede226e0896d0c07319"
Nonce = "a43c19082988a2a1609150d903106415"
PersonalizationString = "ec6f5aea1cff91b0b798b1247a2e79bd62173d8ccdb5daf9492b3958ad82c48f"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "852a9d864504846fda05677c567bd9fff95221e620b8473c5e51580697ae193d7bf1f3237fd094363bef04f9231d95b8531a837ad43c7ff18d165acb2502f9e645460e06e2da19bd10c2df17ef2a6c0791921d74f72f91db4f80484f4fe3eb0aedac4e6417cef76e75c68c041be290f955a6121499842549ea9251bf892107614a1ee94110ca401c096c5a88adc4b39bfa5f821fb980b6e6455ee75cfdb8cfb31756565c3c836cc8e96b537080facd6c4c38c5d15c405e904a9d708e92a626cec63a5f88e3fb2b597348a7798559d612fce9013e6cda53b8eef61d5c874ea030d377639f93f3c83b5f7f634da201ce392d9799102ba9ca4c6126dd9fb77b33e1"
f()
COUNT = "8"
EntropyInput = "a5e0b94b0efb6e1df2b691bdd3e15d68ba602e25a4e1fa7b17fe124f280b722b"
Nonce = "3be26657fd44368efebe93c16b230e4f"
PersonalizationString = "<KEY>"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bc9379fca8507d562434c8d54d35dfece72c18197593480bfa7b63b262d79667d8184c9026682b4a42b73ee237ce5ff46d8cf58<KEY>4df8710<KEY>b952b9d3d47f3ee346f150e8e4e21d1d3892008ed163c0cde88a6d8d6d6ee7aa2511e15d583e3f286462f9d3d13966f955898d0c0c7a369e886caf2c3df6d41238ba85086e47fa78028f3dc01545834dc73b25509ee6577a6e8f159c70407bb7b05ca9bfe2580e8ab864543fbe67c286230dfb3c792ad050e79ce16ca3fabf73387e85a68faa44ee95d"
f()
COUNT = "9"
EntropyInput = "<KEY>"
Nonce = "d472daefa0831117e7b8f3f667c5508c"
PersonalizationString = "c52f79e56dda5affe2fc350e3b6aed9cf7de57f2005e1f2f003a90f1cb175974"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2b37c3d8c45efa020eb3f84284a93c5207b25b71c002d941528ca0d98f7ac42a72f55f1ecd13ea74a296d3e231e453511a496a0dc577252cda49b4e48056ff71cb4e309495d459d6c9fa2e6502f3ef39a06ec4dafc9f14405f14c3015b6ad7bdc9c1077aca97dc7974996c925c66a98b15fe8aa355ce3426b1af68df85491d46da2be2dc58e166edc60216520f18939cecb381d3d4efe70d89f4e4be3c93f11f5be68729f48ad9e501b327146087bb161ce7deaca44622bdbcb50efe8e076fd2e9cc3902cbaefc3abedbb60cbf24ce332a00bf7ff8ec7a2cc81d6669b9957d15d68c03e1308550b7041ce77c95de5cded1382124896b2dea1254af1e93ed7be7"
f()
COUNT = "10"
EntropyInput = "8b9e3283cc2316b6955171a2a3de5851a56ac2c3e6de14166fce6ce0d24421e4"
Nonce = "8f2caa11450b9c6676d35cfc83e3a1aa"
PersonalizationString = "55d98ce73f316177ca27dbaca3fa25111c19fac26fdc224adf71e46c33d9e076"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cac7b77c2664ab953a413557f03b73ba499a7ba627acd4bb81b1dd77198e17ffbab3393e83cf39a56353b387d312791f89df0cd9b4c3bb94eb43d8f34f95a4d2485609728f2fe4fbb4280c35c18a1bb5f5d4f7457eb4b79dd13ae5e3f39ea592028fc95f165cf7024813dbccb18651740146276293d8a45af3d7315978a610c4891134096701bb8cebd9a4bbe0685c06f12f8d98f825b84429ab7363a04043ae9aa5732274194db7bd6517029a92ce11d57710d2152fd877c563b9dbf773930a3e50326a84fd880b24bc142744b8a8b4d0661a008684bebe8d5dd682fab88b90247fea58ee911c6c8719dbc25bc95ec4440f50b34eeec9514264d05633a63862"
f()
COUNT = "11"
EntropyInput = "63740fe4ea180a767ee3ae551a0ba9f87fb93e511830188be1da2f5a3256db07"
Nonce = "2d7f7bbab9e17b0eed3d6fe126b49af7"
PersonalizationString = "dc61dc0b522a10dec7869d396deb1ef849bfa93604299519a520516d0e673098"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "85eeeb0897db47806534ca3cc1b700625e364196dd3dc4fb771bbec51b7e5aac09164d0cd6cd6f67bfe780b656d162cb8a9d9b5a9ddac9a3a38bd1fc23cfa41a17a4271239bbfd604845866f4b515fb0e9df75152d38251f5f50f6b4d99835eae72a518eb83c2e72501a3af9b4cdbd374134f6fbe6401cf592b444be6629af1bb1378b09038a01f459bf95daec141ca7639247776e44cf0ec36c8e494f91f4cf3bc0da212437279992f0986b8f5d592c8f64c5baf2e97ce04983af1639b90ac350a84a9bafd4e659d554dd29e5bd128468675e2c264aecc332a373655704e005144ec1d8efd8e1f5c915b78c2f8ce413242d788927aa8b3f66574750fac7fafa"
f()
COUNT = "12"
EntropyInput = "5be0278fdd81b7a4a0eebc3528bbe5982ba4084415152dee27649c6bae0a6b0b"
Nonce = "afac0cd0520ad32657e543c27bb01d73"
PersonalizationString = "265d72a4f0a1f93c91f72c755e9386626f1f0afb86e0bc341dbdc67859c176cb"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c056c7acec0c2fc67e8a66cfe62e26d63daf7dcc5bf1300f6ee44c818a35fd99ae13d16be2ed0b96ee98aead005d1b0c8ce10bd72a02045608129c12c02e6c0828717a6<KEY>2<KEY>2<KEY>2<KEY>413<KEY>883<KEY>0<KEY>8afe8fed0e10<KEY>5f195ee5365289b928b0d6c55f375b32f4e056ec7e0<KEY>4<KEY>7ed9<KEY>8<KEY>"
f()
COUNT = "13"
EntropyInput = "<KEY>"
Nonce = "08e08a673d0f1678b1564e7c6f1695d2"
PersonalizationString = "dc5c4cdf1531fcf69c55bece5c291a96ce9330a86737770fd5452c1e77d2a5aa"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "<KEY>"
f()
COUNT = "14"
EntropyInput = "2fa23531e11329997329d273d454ef186bffe879fdf95c8812533e4b8027df87"
Nonce = "0a6bef6b736129740978e31c3fa279e8"
PersonalizationString = "a5ca2491479bda16341b2c14339a5307fc2e2f5df4fa625e0ea351a95a14f588"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "df587647f8d440a6c8034e757cd47f28d0e58f8aad9a047cdc8a70a8b1cd0d8185240d47bc5d2f4657205ed218ec38307e68efad94714630cd490b939719a4a07ab994793112c021969a8c69872903315c74b00b677648673e5883b5f46e075550092914cfeab05454226ee3d2154698f368bfda0b8b99eff5d111c1649a0f7e67ec0f637c6d3466994d655066a95732590e521ca055b048dbafd219be1a04fcd047c3722c4adf29ebd8486e7171359292e11ac6b740b4d51093383d64d2a45e51115c689<KEY>"
f()
console.log "exports.data = #{JSON.stringify out, null, 4};"
| true | # Some DRBG-HMAC-SHA512 test vectors from here:
# http://csrc.nist.gov/groups/STM/cavp/documents/drbg/drbgtestvectors.zip
out = []
f = () ->
out.push { EntropyInput, Nonce, PersonalizationString, ReturnedBits }
COUNT = "0"
EntropyInput = "35049f389a33c0ecb1293238fd951f8ffd517dfde06041d32945b3e26914ba15"
Nonce = "f7328760be6168e6aa9fb54784989a11"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e76491b0260aacfded01ad39fbf1a66a88284caa5123368a2ad9330ee48335e3c9c9ba90e6cbc9429962d60c1a6661edcfaa31d972b8264b9d4562cf18494128a092c17a8da6f3113e8a7edfcd4427082bd390675e9662408144971717303d8dc352c9e8b95e7f35fa2ac9f549b292bc7c4bc7f01ee0a577859ef6e82d79ef23892d167c140d22aac32b64ccdfeee2730528a38763b24227f91ac3ffe47fb11538e435307e77481802b0f613f370ffb0dbeab774fe1efbb1a80d01154a9459e73ad361108bbc86b0914f095136cbe634555ce0bb263618dc5c367291ce0825518987154fe9ecb052b3f0a256fcc30cc14572531c9628973639beda456f2bddf6"
f()
COUNT = "1"
EntropyInput = "4cc8214cd7e85a76bfa735bbbfce926c0323fc348de6c05ed1800c2c8f58c6b1"
Nonce = "001eb1f6b29b35242a3f8fa2e90003f4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1efa15d644e1bdf34eade3ff2f5e9ca45203ccaa1e534ac9b4287a846b71292b03102286d99f2be64b898fe909238f540ebc25f49522f60ef723a4c428ead530a97c62405cd5d9ecc54ac5baa47ac4f6195d637833f462d21a659b4903d9cfa6c9fd4512445f9abb5782899a6bb64592f3c2b3c745b18645301fdb09a6a331e9fb6d9654fc79c14ed8PI:KEY:<KEY>END_PI"
f()
COUNT = "2"
EntropyInput = "d046270e6b7997cd5f4e9ed1193e55382191f78547a660854cf60bb03d039a39"
Nonce = "50cd147a3445f6d32d14cbfb9da0c327"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cdfa9441aa5eb11fe3ba50528ed731c9ff9e70b78da075d00c52d0e281e3a868f66a53a2a6a272d7e0b1a32b6339f8afd108bb9e66b04c3d6bc069b7e01b69844322df7deac66e605a9e2f43665b7932c67c418a77a4c9a302782d0e735795755613a1c5e90089f759d780fb3a984dee4e06ba3dc5a8c652549587d975e586a98ac6aba6563e2767f1a379261b9dd37992ea9681881ea7933b5c64093234c849142ced85bbe5956f527d46ef091e4d18df2a6102621a91bca51bf7aa4b242414dc16e74ae59dfe560c19dbe315e7f98b11086bc26e336dcefcb91c4828682da90d3921336a45fcd36ea4d1213a13213a1PI:KEY:<KEY>END_PI2bf20aaPI:KEY:<KEY>END_PIaPI:KEY:<KEY>END_PI991b60PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIde7ab9cc656"
f()
COUNT = "3"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "2d2dcd5c40b46fa553ca6a2f6be96991"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1658a7552e4cc98c228072801f9ba230123e7f1f7dca7ba839f440e5f7570fd29c38b86a2aaca04cc87a56205b41d19e3899PI:KEY:<KEY>END_PIabbPI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PIe4dPI:KEY:<KEY>END_PI22PI:KEY:<KEY>END_PI20PI:KEY:<KEY>END_PI8PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI66PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIdd33PI:KEY:<KEY>END_PIacPI:KEY:<KEY>END_PIedPI:KEY:<KEY>END_PI20PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PId02PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI0bb52PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI3f001PI:KEY:<KEY>END_PI1e21dfd3363229ed362f960d8a5fd06af5caa86018f9dce81ade6234a6992bfb9e2660d08a103dadd7d9ade4c45d691aa3799c1"
f()
COUNT = "4"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "fd2cbc87c79063db588d90b9cb1569f3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "7c4de5fa97362e63ePI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PIabe28559d5bd85691c3e3bd610e61e4c3b76e167526d1331459d8bf09ceb403062cc97e1229eb3a70af6049d291aadb002786e7d21b81c87fa68a51a1b9a89394788bab70783a88c883ca17eceaba455f357c611fb279e38f67e3c27c5ade5f95721fa79fc2da1bd44ca7f304161359da4e45d7b847672bc185ba502123a802535dbd167b2c93bf901626e23fcaba03c4f89625PI:KEY:<KEY>END_PI930caaaa30400645680PI:KEY:<KEY>END_PI5PI:KEY:<KEY>END_PI31PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PIffb"
f()
COUNT = "5"
EntropyInput = "PI:KEY:<KEY>END_PI14be417001030f6a9c543f82PI:KEY:<KEY>END_PI715PI:KEY:<KEY>END_PI075d0PI:KEY:<KEY>END_PI8fa35acc7eed02a1401c6f59df"
Nonce = "c87b8b9255e62fcda6a35e52fa4a6f9d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ed29a49be56e081f5b6abcd2ca1a16dc096071989de72a39b8bd544d2a2a2db5c886c0c29ce454cf60addb56cb4f28f959ccb7163280ef81e48dd2a02024c34a120301d359f03844d1af01f485afbe7c9b17288cf345172290fdc44e124670c5ca9e8590df6f9f63d60849c62d3921003532dbe3e3e6bdd75d28211365f6c489598a99e605ca671ff91552b5916ea9e12259723c0e1a633be34932d0c816c30b519c79656a70368b28fadaf5eb32eb6e47e00b04f152ace2eafc9a3ebd3b1b3795ad85e0897e46ab57c361fef2908041d365f73180b505ae2426603decd0b7dd33e2f7ac885aced4194999602d4d62a984233d0696fff86f7fa7a6cf993fb7e5"
f()
COUNT = "6"
EntropyInput = "b8ceee088f3b13dbd1e7cf230449f246a456f504d63fd4288838a50ab76576a3"
Nonce = "f400502913cf57cb2341c5e6a63fe9fa"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b4fe3f6caedf4ac7b93fb1c2f316bafa58487f28a37b8400fd1f32c963b04cb3c7eb601d0dd8a7e4538b14030fb0e97794c617366ca827e3afdb0f714983a6a72b261db8bf98d5fc48fb55158661f987d08e952913212717cf204a3e8cf1177f63e2a46d920ffcec4b580a1361253a689bf765200f4e90dc6b34a56e10cfdbf932fbc3b75da1d55cba0c5287f552d883763b83acdfc7fc9d762f79774701f7ace701f0b26c67217e022bf6b6e0602e0d68cb1377b5ebccb9a8e41188dd1dea662663e8aa093787d6490a4e887a34a27309c64c40e4ab2f0acfec4a1b8d419d99fb578aaa82da9166a7d7873e27226db20d313e868bcfa4fe3854d6fb34def7d6"
f()
COUNT = "7"
EntropyInput = "3c1e8a0199786fc268ee0ca0c0446d7363bd781069cf3a3faef2592cba06ce1e"
Nonce = "70c7c691af73d6d59addbd6e3f646d64"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "06f44bebc2c1736b5cee283e530bb877b28651d70983c272a10efa80e3794ee428644048d67245dd3ca8b769b6bb192c9468a9fcf2b71c417283713d39e800225ba659c3273022f5177fd7867173f457f3bb66ff2c2e7bb2574dfee54438e35c98506c178d35259b04e7c541016f5c2d980074b4ea865203ae2e8935d745a02ab5cce04d233cbc18719b1900f2e7e98229b851d19fac02fa6e5ac1bc973b20a17509739bd989d4ef5a66fd9e19e3ceef2PI:KEY:<KEY>END_PIbPI:KEY:<KEY>END_PIdbPI:KEY:<KEY>END_PIcbPI:KEY:<KEY>END_PIdbPI:KEY:<KEY>END_PIbdcPI:KEY:<KEY>END_PIdcbPI:KEY:<KEY>END_PIbfPI:KEY:<KEY>END_PIfdPI:KEY:<KEY>END_PIebaPI:KEY:<KEY>END_PI"
f()
COUNT = "8"
EntropyInput = "e8a0925bfce66dee7e6a54fe0311d259bd7f7a22b8576d64840cc51c731212cb"
Nonce = "1763365deab3ab82de9996e5c8570eb9"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "63ddfd70508cfa247408ec231d56df7905f65b62e5e5a8309fff5239620faa0f055d7b8fdbc648ded78fd567c3141e1723d197296c92d43fdc18af0c4a54fcd52613286c78ba7bdfd0fcacc7b11b374739088323ba95f30872d77b6aad21228253133d76d29d0d742ba349956fe71e8bbf3fc7186a3f85f144a9040ceb0529a713583c1fcdee756d0130b38dfPI:KEY:<KEY>END_PI"
f()
COUNT = "9"
EntropyInput = "cPI:KEY:<KEY>END_PI6bbPI:KEY:<KEY>END_PI0b2PI:KEY:<KEY>END_PI0bdPI:KEY:<KEY>END_PIbPI:KEY:<KEY>END_PIbPI:KEY:<KEY>END_PIbfdPI:KEY:<KEY>END_PIbcPI:KEY:<KEY>END_PI"
Nonce = "b6d6197f432c8597163feb9c5439525d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "764d3e4459504b490eb1db7b5ab8e6413601e449750534f4c4f70025026f87217010eb14705eae6e513796c7f20ecace32a063238824b3fd6956810066930bf425a1c585221c8f61ac64aeccfe8a3e33d164d02d5434e9e594b7ff451601874d268a2fd8de9922c36e67d8146fe553889a15f624d499a22f5109896758f30bb98f70eac11da1ad48e99bb4422acc5b97295094324eecf530525c1ba150886d053c84004c265693a4419602e5e59bf120de6ff054d0c7c96bc14e9b5fe1290c08ebebcda21744c04a2e78964cb2b52f8e6a70930fd1ded1f0edbda4deff91a3310019e967df3fdbfa228bec9897412a748201649328b7d784851fcb5ac1251f8b"
f()
COUNT = "10"
EntropyInput = "1e868c5fe4b59e6d4249854226bf1120a74386ea590e9c35c58d7ccdfad56d71"
Nonce = "dbf557da684289e96cbdd66cbd9cb879"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2032963be29c0d24c2631b1cd895124b9801a4d5c14c28fb34cbfb1c2467134f499153e2a3ec817cc4b2e4e06068ae78f5696dcee99334b0b51e9f29e56a3d3fd5c65c4cc70e10f9e0cea2572c28ec4afe0896d7689322d3afd931ff836be4PI:KEY:<KEY>END_PI5PI:KEY:<KEY>END_PI78aa179100d43d910564dd1adfedcd32e3e7e53b06c0a46a90b1173e4a5152PI:KEY:<KEY>END_PI8aa38f2a7PI:KEY:<KEY>END_PI329PI:KEY:<KEY>END_PI01PI:KEY:<KEY>END_PI0bPI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI62PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI"
f()
COUNT = "11"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "dbab14240cf59fcc8a7007553ac480eb"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6a9d30d4ca97dbfc2d2852bef044bbfb95ac253b27e5PI:KEY:<KEY>END_PI06PI:KEY:<KEY>END_PI8PI:KEY:<KEY>END_PI7ed399b10b995b3PI:KEY:<KEY>END_PI55586519e5730e52ee8880ef0e63c476f2a80d77c6ba802c47e9174297b27520fb027d134e17cfa6f99d59cc5f53737cdc2e663e1ac59bf74a87ab1064e9acd4811c0406ec5a29a081bd0efd1e557d6b6c9c7fe6131c5c00fae82339PI:KEY:<KEY>END_PI1fb90d3be2PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI"
f()
COUNT = "12"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "776c5ea9838c4c34f39f12c1a9df6700"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ba23f7aa0b7f6a93bc0df32e68e78786fffb5acd7fbc2864468568753e3ddf31fc2187b20c229d0d0b261510f6442816d2226024b57306b474079c92c66a00be482fc104cdbccef0450b3f2ce94f6bb6a5125e0774a28a2a083f802d3c45e9d4253295f80ca4bc439f539a7f82eec6fd450bd196ab468ec6902752dced44ab557fcd3f6a72c47c0f18cec6545ac669cf432e2db308d70a7394ec772a34f14f26d7bf7d0bd7e4437248618efa2c08adc7de9231ddcc976ef8bcbd11be54dd17ca9fa515fee6827bf5efb602fe8f1cf5d67078b17601803c5be05c24edccad2837d0be191f918d6dc62742241728a8690db5836c2045ec9f8bfa87b768f4febf2f"
f()
COUNT = "13"
EntropyInput = "17facdf2fca2e1134674ea8e8daa609b4477f415c6a13a5c157f3fb7727dda6d"
Nonce = "3c1dd89ad63e781588e4b3f8cb1f2f6e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f472b4c20bf07c170b3c8eb682469e88680d1fa5561d72b864c5c438c95c4c8a3e61f89fc30d5fb4e843e5ed1230778b48c467fa46ebfb7b56220a610483827f3f7f8ac307f8aa57a68922a06c8fa5de732a0d05835cd48690a2b3f734e4b7e74799ad774579a9eb296112f3e2bb68551af0e9e0e5e0bbb219ccb6c78459dc68a3663987156a50e72aebb219a1e43b5603dbd8055bf1e76a4468caee86489ac9a1a9a66ee7b193484ff3bea84341b62dab124a43e38945cfc99f2c4c15590fe180bb3e6eac544483aef710278213a83da85a38b6d140f33654c9d4f6b8ab3eacef1c57fd2237dbe8adf23b3aef6ab30327ca119b9e1e95ecd068aafae0d07a08"
f()
COUNT = "14"
EntropyInput = "2c13e44674e89aa105fc11b05e8526769a53ab0b4688f3d0d9cf23af4c8469bb"
Nonce = "700ac6a616c1d1bb7bd8ff7e96a4d250"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f778161306fc5f1d9e649b2a26983f31266a84bc79dd1b0016c8de53706f9812c4cebdbde78a3592bc7752303154acd7f4d27c2d5751fc7b1fee62677a71fc90e259dfb4b6a9c372515fac6efe01958d199888c360504ffa4c7cf4517918c430f5640fedc738e0cc1fcec33945a34a62ca61a71a9067298d34ac4a93751ddcd9a0f142748a1f0a81a948c6c6a16179e70b6f13633fd03b838da20f81450b4fdc1752e98e71296f1941ca58e71b73ea93e99a98f58d0892fa16de6a16c602036ac857dd75f9ac2c9185932103db5430e80cde9131e814a0bf3f3e7a2200a7152424472fd27f791a854f29aecc448f8d3fca3f93290266df3193d9e13e08907ab2"
f()
COUNT = "0"
EntropyInput = "73529bba71a3d4b4fcf9a7edeed269dbdc3748b90df68c0d00e245de54698c77"
Nonce = "22e2d6e24501212b6f058e7c54138007"
PersonalizationString = "e2cc19e31595d0e4de9e8bd3b236dec2d4b032c3dd5bf9891c284cd1bac67bdb"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1a73d58b7342c3c933e3ba15eedd8270988691c3794b45aa358570391571881c0d9c4289e5b198db5534c3cb8466ab48250fa67f24cb19b7038e46af56687bab7e5de3c82fa7312f54dc0f1dc93f5b03fcaa6003cae28d3d4707368c144a7aa46091822da292f97f32caf90ae3dd3e48e808ae12e633aa0410106e1ab56bc0a0d80f438e9b3492e4a3bc88d73a3904f7dd060c48ae8d7b12bf89a19551b53b3f55a511d2820e941640c845a8a0466432c5850c5b61bec5272602521125addf677e949b96782bc01a904491df08089bed004ad56e12f8ea1a200883ad72b3b9fae12b4eb65d5c2bacb3ce46c7c48464c9c29142fb35e7bc267ce852296ac042f9"
f()
COUNT = "1"
EntropyInput = "e72d696d4dcb41a42d89037487b3eb01d2ddcf0407e4daa0b8ff562461eb6f83"
Nonce = "b2b01fb9732601f3573c6831aef09ac3"
PersonalizationString = "8bbb235642f8caed49700463168ced9971a0204b981025bee41c72b76a965d51"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8e5cd2a91ea113072623b787ed37454fae2c1905a725be3b124bb243057794dd68325a5d8bba5d6c7796d91cf682587ebe91f6beb33c5cd60b00940bf6de5PI:KEY:<KEY>END_PIc7fb082bPI:KEY:<KEY>END_PIba0e5b44e021be6d45099ea59367291a733ca50334f0315d52ed267af1b98e5be59359a0b9965727d92aafe4c92fda2c915cfb5a378c7a717f743a3524fddf5a48b1e7e113fa6e94b76f4e13fce3cc18b970f2ed1c34bd622611c979b6a9712c4447c3e50PI:KEY:<KEY>END_PI7bbPI:KEY:<KEY>END_PIaePI:KEY:<KEY>END_PI8bbfPI:KEY:<KEY>END_PIddPI:KEY:<KEY>END_PIbbPI:KEY:<KEY>END_PI"
f()
COUNT = "2"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "2e2b74490e062044975d6b1885f61ec7"
PersonalizationString = "b5f819154ed5442d5547771af76cb6333d7f35e6f3e1cb03b22d09e601eb8eec"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9cbPI:KEY:<KEY>END_PI57ba9d77b95ePI:KEY:<KEY>END_PIbbPI:KEY:<KEY>END_PI3054PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI6eedcPI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIePI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIeecPI:KEY:<KEY>END_PIcPI:KEY:<KEY>END_PIcfPI:KEY:<KEY>END_PIcdfPI:KEY:<KEY>END_PI"
f()
COUNT = "3"
EntropyInput = "138a1a9408cd7de6c1796910145263e5816d377cb9949bad0927f9c61e7fd18c"
Nonce = "71eb585159831189707ac6b8b6f80100"
PersonalizationString = "9c0ca722c55c19694df96e70f941b5b230efb1fccc7a7abe0c471dde92a39272"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "976e1a19af964502177d27b09458e3beca6e9082ce21721d31b7241795886213894f2e3f9acc23af6aa5eae7218d00871dac9e237cde1dd9654c1e893bac47e9444f4dabd26d3dcd9f11a68b297956f135df32fc3470f7b01383c506e2a2fbdf1c387c4ce684592fd4e5be0469a29c8031cd1ccd002edae3bea44c93695241296d472783df68e5ac7a62e33a5a74f70fe45252f88309b7f3603f43a5a0a823cf6f3bd8670d50663ecc326aed709224b60fe67ed29860b31c8161d416dc5cbca1c16e69cd7ce41a77cd465cb810f2b5963d15e352715fd5e6175c68125fc8e107d6573ea89db8b34fdf93e2e173cef77746e6142c8e5c44dc288ce86c0710a04b"
f()
COUNT = "4"
EntropyInput = "f4010441edc99d524f6caa660c180e25afdd09315f2a495ec003471e1f79bf0a"
Nonce = "13bc6f04d81b25f4d4c9321aa3fa58b4"
PersonalizationString = "37fbbb3fc5aa698084184ecc8e8b45212dcf851e6e4f2db8f775d3f759ef0c4c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cb3a853a930cce84703c47719f6d609fce15f903a887f646c0781606f6f926765afd7411b4fc44be350b14cfff04383e4930eb36f94329033cd5f21d467fa74ca1a3c61c94a290bf6753809d8e7b75431d9450361613b16d6be55c392cbcb3d4212ea42cb341878cb268f3daa87c73297a807e35b82458cab693ec9bfPI:KEY:<KEY>END_PI"
f()
COUNT = "5"
EntropyInput = "64179b56a75ce27513f0353e10a5107b935293af96799112448fb5787d9949d0"
Nonce = "f38d2f6e523ca3ef7429621db65a37d6"
PersonalizationString = "f0cfd2400dd8d5e857e5878fc811a5c9ce5e0097184ccdc57c0f96d5a66020c3"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b79591df35bf97c7f4731ded3eefcaaf9d0033bbb0741c0c28aca622e211491107ba9b9645ed325ae18a7aac6160cee4e3PI:KEY:<KEY>END_PI7PI:KEY:<KEY>END_PI9PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI481PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI1d2026PI:KEY:<KEY>END_PI34c44f67PI:KEY:<KEY>END_PI9c01ffPI:KEY:<KEY>END_PI44PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI5eaea00PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI2ef4PI:KEY:<KEY>END_PI"
f()
COUNT = "6"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "961df3048132b35d39bc1f96e21672b3"
PersonalizationString = "d040489ad6f484b13be395fd99fff34706cbf96867e614cd6c91554d61231eee"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "PI:KEY:<KEY>END_PI91bc36569a590e5dba3b64e896b21625a8555f71ab77f6f348d2d787e195PI:KEY:<KEY>END_PI046PI:KEY:<KEY>END_PI5PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIbee7PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI00PI:KEY:<KEY>END_PIdb3PI:KEY:<KEY>END_PIe3PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PI6fcddPI:KEY:<KEY>END_PIebc1PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PIdaPI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIcdPI:KEY:<KEY>END_PIdbPI:KEY:<KEY>END_PIdcPI:KEY:<KEY>END_PIbfPI:KEY:<KEY>END_PIbdPI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIcbPI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIfbdPI:KEY:<KEY>END_PIccePI:KEY:<KEY>END_PI0fbPI:KEY:<KEY>END_PIbbPI:KEY:<KEY>END_PIbdPI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIfaaPI:KEY:<KEY>END_PI8aaf6"
f()
COUNT = "7"
EntropyInput = "b3679d82e8a26b602835fa5b780e9678d8a84cbcac2cd6a66174a9c6f68d86cb"
Nonce = "c4b1bcdcc20888953f8ff22363fa8a5e"
PersonalizationString = "c35fe47a7a0c8f82af93ec7dd162aeb423af44aa71b35d299d561b65640e43a1"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4fb91c1ac25546550d914c1bca10943f0bc2d6785d11eb28eef7b138b42a248b7866eeedee2a00772d3ea216430344af63e896fd0731e93ed7e06e96024385af563cc80cbb27df9285219b1abc57949c580b3d7b7b2e956ec2375ea5069c89ca50602494fbaf80b06424fda851a7576806dd18cb8c96e11c746b71e272c09eae0d3e1a5e14d46a4f09ce1520c36aee0e565f3093e703786bb109a4362620eec6108c0ae71abcb8e3a46e9907fa74522cf47f81d743ff4766b7ecf81982340e573a2893636ea8072373a628abe72e78fa22785e607d4fd6941b6b58da5d77517e3cd6d228b67b49b408b7b67c76ff126da818ba19e4dc36ab647f3b3bdb3c9e19"
f()
COUNT = "8"
EntropyInput = "d120f00e06be42483e026e4be88267ca2f8c1b92f3a8342fd460ee5f2f162bf9"
Nonce = "e851a711e87dd4ce719d660de2988754"
PersonalizationString = "28b9fd7cbe714602be7d7d8a159db5e72cfdc8ad8f25cd18023da801466bcd2b"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6912a14bbddf7b5fee9d8df4e06662b8856bcb85ed0dc70061c0951b46ff4a6d9fc49eed01f71a9155b3f03ec31d2bf96d0cd5b961a36cb702c9cbb4a938f3a5cdbbd22d4a94f12434a706362897617f25953d6f62243cb3b8cb21877cf74899d5285a5b7fdc8fe18f49bc7f0fa4d200e8c98ee38884e4ab56ff8e31dd2420PI:KEY:<KEY>END_PI"
f()
COUNT = "9"
EntropyInput = "256eabcc37aed36ee6a5e288f6a96c28b8554ae987eea487a87f7f1a3c93052c"
Nonce = "9dceeb5a5749f26f4dfde9ce42908d33"
PersonalizationString = "0aeb442729544bdfdaf0a0997e12da31187d92e5491eeb19a9d0a5b8142f4017"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "729f91d238cbbcb0001d55967c9e33765db722ee3c1acfb58d67f630b24ed6ea612d45b12db152f082bef94fdf1e370bbf1388c26ccb6e5d2567340PI:KEY:<KEY>END_PI"
f()
COUNT = "10"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "26346eb244156cbc6cb297d3f57ceb43"
PersonalizationString = "8f75e9cb9dbf8636d5ca1a08e5def41e9c773de65bda450e025b3947d198fc0c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "952ecf7252536ef906e1c4a9d4d0fbe5696a574487a9192445b9730d96ec2bebf57c9fb3ff1203011ef221625f95721611b10ff4eca17833ce11c4ae6f2155d1954dcdcf17d4d9252a739c99e085c3a6169585fe1b2523388f0690392d30f153d2fa75d8dc12fb8f235cbd83d5d1d0f883bf2f0dff0bc3ecb490fbee2dd09be21cd63e56c90dc92552a7819da8682c1676ee432e1e6c85cb8928b9997ea4af23e7d5dcceaba634cfc31541133c2d11cda92aa858d7fc98940fe4bb6865f8986b27ccbe9889f94cfefdf5e7d7c9667dcb91ef9095daa86a27df13a4bb8afb32d4bc5273247c29a93b4eb53c0189308585bb83baf9b6ce76d995838e035aeee907"
f()
COUNT = "11"
EntropyInput = "b18f4e2614719779660fdfbd342f37b944141c5adc2346c4e37733a4da6fd2ba"
Nonce = "d849c315f51034df3c7bd39ce4f4ddf7"
PersonalizationString = "7b6c82ea24ddf29ae2fbea9c9e284506288abff2059c07246689618d3e6ecfc2"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2cbf77930162fd93a9becce1b29e5b37a9b401b8e7875f650204cce39ce74592686e274372be83c1ede3e7901d4e9fadc5d1b9f58e03e7db208feca9573dd3e0f39967922309fc7e065591b59e6cd7cd4aaf836882d1230320e22f0326c629afada478708125c4ad140b3054c9d4a660811a40df01d6f3d0acd7a16b69b10f388ce317fd795b8336a141a3c3cf95f30035567a58c66a08806c8523984bf18d75bcdd67a6c1f9fc464e939c913ba02d28fa465042e1151adb914bce52048544ff6835d1f81aec6c42f005f592772e751bc7f64ccadc276a1754c382e1355958e435fe2a096818171b644084c702ed4740bbad7f536aad0bf47b3c1fffdb3e214e"
f()
COUNT = "12"
EntropyInput = "14c817683e8013e1a3a56e46bcca485cbf386cf85bc45d11817264b0809919dc"
Nonce = "9fecddd4a2d910ff5ee139f436af231b"
PersonalizationString = "13145848e593be74e8d9730be55c9b98fa551eab55c364127b16b4a295ca15ad"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4a16be29fd77ac3e0b0754ef030b0702209be0bed2e2292059d5d9a07322050991991d482689e71921fb4f0d189be688fffd4eff001d78e2fa28075101c55ac98f4af065b9fb34df0a1db10ba41c5efb241e2acdf9bb65fa5051c6d01cb8a0d683b001c034cce35dae98197b3a6945b31f3eb1342cf1a8bb6e528dac01c7f0350253029a1ad0899801bca276bc5eb3dd92a712f2e99PI:KEY:<KEY>END_PIdeadPI:KEY:<KEY>END_PIedPI:KEY:<KEY>END_PIfdPI:KEY:<KEY>END_PIffePI:KEY:<KEY>END_PI115291f999059109f2ef4a1299798d2d04bada29088e9b886cf83PI:KEY:<KEY>END_PIc71cdae58bPI:KEY:<KEY>END_PI4d1PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PIecc0PI:KEY:<KEY>END_PIdfa0PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PIabe0e6PI:KEY:<KEY>END_PI"
f()
COUNT = "13"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "b37e0aa74649ab01627fe3663d28fef0"
PersonalizationString = "e49c8fd4b2d1676096f937a0674ce41f2b960eb53e4b35d01212adb6b1ded917"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f5dd013f8eea8fc48a2a77600cac576dbab7919c91f2d360749ae7369f184fdb428d3575ff97574b8727ad20dceb04d116030b8c3ad2ee54c69e6e01fa1580cedca2949641067a2845f6fffd1909ae2e520b9PI:KEY:<KEY>END_PI"
f()
COUNT = "14"
EntropyInput = "e9e4f59e1a5fd43acbe20923907227b2790efd1a2118106b1e4823588c525423"
Nonce = "fff1f2e2ac117af8b2cb023f0dd6c6ea"
PersonalizationString = "0PI:KEY:<KEY>END_PI69d6c69PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI9cPI:KEY:<KEY>END_PI8PI:KEY:<KEY>END_PIcPI:KEY:<KEY>END_PI"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ae35e947a538e7da73f944b4dea689c064b144b753fe597369e58ec4868099c0f000995949e82dc3e5c00555a2cfe48c8a87e87ae5e7402e2b1679e413cc556f08796269ef3ea83d6a49116349a31710964fb2f936cccf249472eab3267cc1ca0073ff4d964eefc82dd1559c3737661f8b206757a64c756680fb7ab6be8cb433b93f21a04c1e99c777ac26c1f34918794085ee593ca27ae991c53d141e52f90e7872bbb036dce78e6a33e2d638360f9c15d5746d6ff13c1bcdff1cd01749fa51c3c72e68c0ce57423d4915abe84c15cfb3301d0c3b8ffc6a1962c1fd981790fa2a3da60d70e8e8557e4b2e7458ad85f5141ad46e1db751893e8327c8197571e8"
f()
COUNT = "0"
EntropyInput = "dc01767ed6527b8775e99fd5d46dd33db0ec2ebb393acf59b080510a657954ba"
Nonce = "174e0ed454d1b57021fa980f4597ea25"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3de906b138662897b8a5aa00d8cfaa364bf70143d1de088a6f38b610c8f4d2a20c107c9f6d277850fa5f50007744f90cda0e20e3b140f9aac249a43ece99c574245ced90e6023ff5bf5bacee6656866db3fd72a209c79fd9829e3c63a7f46f0d31398e189331f93ec97ff1554bf0739c18abc1cc1dca1d8a8a5ab243b7355223ea6eeaddccc0972f23a03291b28af9303c21c0a1417529471c6adeaacc659554e8619b03fe6112de5c72162dc6e1039cf05141fa88be6abddcd2f312167e86773e52e73336c6404b44820bdc14ffa6f0e8f7149da33743fbd2c89dbd0e75b6bd9ce7703b337031ab51f5137fe1508567340fd11bf4b51f34032385f1287d4af1"
f()
COUNT = "1"
EntropyInput = "197c8b09c20500b2ff9095142c4629becd3a131ed17b99940ab31a53762226ba"
Nonce = "4579a3858564901928fed2a75c98f32f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c33b2418bf4d66f49ad1c05102686c65613cc3602d74aa4e5c611873a337c0fffc4c8ccba9c5ab56c3c9cdfd9be3c0da039bf08442cf2ed4af5a9fdbedf0d66001192bca2a2a5dd5a49cf159e2a5ff00066eec08b99312f84033e6e6f24bc5d908cd9d19e6314bfebb98bdf431c9779d0ee7d15cf9ee7e9baefddc6c6625500911d2810a0ec794e28eefcd0fd76590419933e1a1e077cb2860975762926eb206e1eee8f1a6eeba762d7ff6056a37c56649b034af7c976432cc63e672dfd4b564bfd4898de6ae7944789199e700c64a78ecd1b841d206a7c523040f240001829363809569dc5e90762c5c63a5147fdcf6f31beb60151ed54637c73d6df4a93aed"
f()
COUNT = "2"
EntropyInput = "dfe546e4148a5d0107f3dc9f735936d87f5ffbd694158d140ff04fce96785e93"
Nonce = "943f71ec131f0d6abe5098a00a93321f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8290a703f35fcec670b1239fee36a0059fa0b3a355cda9bc1f824ec616107edf4f101d9d8e7979892ae17a3cedfbc9c13a938335d61414f20308a4afb94846bc8ef1729cd35fca10f0bb975cfb554f8723cc51e9356d13c083fd5954a0e4346823dcd5b5ebcb0e21b788609bd88fe40354dfcdecbdd97d08af772351cb919e3d19ee65444f1269dd790cdac4ee88b026770eaf75c8018cfb7526a1c4efbb9a870287e6a0ed8dc8e67124feba54baefe721ce87da82743e4f185b7f591ef67506ad43c50df769dcb68965808d246f294461d4a55c9a148998572e6ab52bf574a50cc60129b1bbadde86695e3c5d4d21ba7f9e4beb432a39ba85dce836b16452a2"
f()
COUNT = "3"
EntropyInput = "f81566d48684aa031fa29e7a8c759dd08f6666b13692776361ece56e92bc3c2a"
Nonce = "40b04432b8979914f3e0e19b9d3c01b6"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1799a737c4436d32e8ea5662541c2ff628c2f293aaa7a463f6566e52d78782c88a34c505e36f29f351d2063880b5b8c3fc99ed9e02ee62496649e1401b1e151fcdbb3dc76f13b209044fa205d050603fb1197da58e7a1a3c3edc8c4b6adc230239a120b71baa6a272624c67f0eafbe6daa71c681eaa67b47227daa1ba058f399440c421dde47ec1b8211d5c57c7bb82c7448a3491b6209a450ac1e0856363fff9afecdb065051021c6b9f0e7a010d1022af4ad396ad1d164894e1c077fd83b71d55c12f9b41bfec2023998f43a2457cd55bd0fdf0a68258fde7a6fa13beb1070a5183145a2d7b88786b443deabd15e594dea1f1eb72d556178e0c74701773739"
f()
COUNT = "4"
EntropyInput = "36afbb34419c0396505235be6de69861e8902bf1c70a3e2836b97998cbac8b38"
Nonce = "d45450d4c1e1c3cc4be7379b0938cc37"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e1dc7fb2c7d11f53a88520928b127cc0e234c1ce3d593bb05967ab2600a1d66b0fb32e70b9985db2f6c14999f3b9faccb72c318e07f9d7770f3a0ed33f2f822e36a5db463cfadbaaab7ec75e773e8d4b5497ac104e23e199e1284c4f1f9e75322ebecbe659bd564ed808f815ed2PI:KEY:<KEY>END_PI"
f()
COUNT = "5"
EntropyInput = "5PI:KEY:<KEY>END_PI"
Nonce = "54b1b9129eca3d2db0c63e4467a495b9"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2fa8957e56449eeb60e0cb78e9a00a31842b821ac67e8c883f6be54e8134666b30011f6ca692f4694d663e8542ec824369faeedd281ad710110687092cff0f72990ed35cd942fc5626bd58bd4ca6PI:KEY:<KEY>END_PI5043ccePI:KEY:<KEY>END_PI8dPI:KEY:<KEY>END_PIe1decPI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI36PI:KEY:<KEY>END_PIe3ePI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI33e9PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PI84205PI:KEY:<KEY>END_PI93PI:KEY:<KEY>END_PI6c34d3e52f244efcb0e0b6335d1PI:KEY:<KEY>END_PIdbc4941bad32a8c69d750a7a91509a0ac714d80b2a0e28e14e02e5e5785906b94fa153b7abd1e0dec4b4fd00c073ab6acb6f705c07f8d7239caf3809109c78461d7ddb334edd0ef9902861ef98b7d7ac418ed9c24d2fb7c4414e25794ee5165feac3611caab8945541af42f77cbd0d7c118a077ade186972"
f()
COUNT = "6"
EntropyInput = "42f551fb6533137fPI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI"
Nonce = "2cee96d6c3eef1c9ed1485cca77725a7"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3fd4f97eedccf2e2eddb37caaaae3433e5585c9fddf32aa601c68338554ec84f16aadb8e808e194c4f0PI:KEY:<KEY>END_PIePI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PIac650fbce449e79db7842815beac2137d57b6edcf121389861d85b9ffe68143cc06e4afa9cd9639b45b310acac933160d7f0699a6df9e04b156acb02c43d5d729474bd28559de2f02192dacdd790ac550bd6c9afefae91ae3924494dfae1ce356PI:KEY:<KEY>END_PI7bcb188da65be4eb0c356516246ef1PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI031d6247PI:KEY:<KEY>END_PI61PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIdbfPI:KEY:<KEY>END_PIcdaPI:KEY:<KEY>END_PIcePI:KEY:<KEY>END_PI"
f()
COUNT = "7"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "b01fe9f159783d29824bf8055c646c93"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "60d46361f9b1834PI:KEY:<KEY>END_PI85296bf3ca101e9bab6bd4f03b2adcc870ff9987afeddd9e6ba1edcba09f79192adef6b561c5c36dbe8aeb196da9a2384259583f6d40aeb54197f0291e5b70a34aa559558358b88f5786cd5822a1523dbbed83314882c5083aead0ef17c2ca94e7322142706cac212a5521f6d4f881ac61128b13e327f4b5e81c6bf2649b01b40645edb9aca61ebc58290db9f46eac6cb475b5c3a9e481a80cd98f548031c99PI:KEY:<KEY>END_PI46f41d85456fa87f824e8164b408dcf1aa14PI:KEY:<KEY>END_PI3f9PI:KEY:<KEY>END_PI36PI:KEY:<KEY>END_PI11PI:KEY:<KEY>END_PI1ebcPI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI"
f()
COUNT = "8"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "b5d170cc69ee34ee7ba73f35646512cf"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cePI:KEY:<KEY>END_PI54bd42cfe4PI:KEY:<KEY>END_PIfbb8PI:KEY:<KEY>END_PI0283cffPI:KEY:<KEY>END_PIdbd56daPI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI7cPI:KEY:<KEY>END_PIcfdPI:KEY:<KEY>END_PIfbdPI:KEY:<KEY>END_PI"
f()
COUNT = "9"
EntropyInput = "9ec905ee3602c95906f6084b8cf69a8be76d268652035370cfdf13a871a85f86"
Nonce = "a7764c145e668435e219dd8cf9cab23f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1996b8d7bf0d43454d61239147a8b32a27d73e0b1c1d8bbf8ab5b751bba9cc813d8be80c0ac7d71ce30bbd5ff5b1b17c12413a169af3d081f8ab1739048a0d2c1c2e24c5e44b0dd7225eeb227610af83a4a271fc31da57213eb6d938edcc2da5e712210202a09020ae24967e271677adeb2dfe6347cb6573e413dc20ae7ebd151acc91a255dc5153be1f6dfbaa4f2b7704d557592961d9847c5d8302469b02e3ca07cf331b9e61b9ec64efd32f3405319506b772fee3aa1d2ac2d70303d47e193e0e1ac9c8565861a5d7f62e515d61f770e2ab3fed00b3f9e713058322586914d69491fb4515cb2c5d21cf07c710cbc4ce362383d084c857e73f62c58f76567b"
f()
COUNT = "10"
EntropyInput = "8dbf9b093d9a190ea8d588a16b5ff2f72caa500a3cd55e0a0b7aea0ca5c41731"
Nonce = "a5087104d6327761d61843ef45cbbe88"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4b4ed879c2b1980112e0f4e627eff8f8c7d210f2606aaa2f7d26422c3e4dd3a66623ee501b702ae194b7ac258613e87f248bf49b40d0df4427142185d2e94b8e14570a00efcaf59ed542454f250475cfda7a98d1c1450978336f613f704dd9cb87b132ab60f24a51a1e1d815ab7e1d96967bb255dc5ac351238053602fd774b9223e7f079a423ef7b0a8ec9a71e222825ebe3c817ded31c2e6c68e9ae26feec7e75fd04157f60a25ad6c13734ea8ffcbf426dd61f4adc1a15e0693b420afc3035f7c847766430792b4fc78a32377a808c82ca7a2abc3c8370a3ff192014ffc819b5e842596cfc46d0c79546ea429f744f5b1acf603e65fc472d592ca07c8d19e"
f()
COUNT = "11"
EntropyInput = "222e8db3a1b1a95497aa0a141277d9c9c643d0cae5f47d1f58cc15c8120cefc4"
Nonce = "5836e4a886163ee0b2966ae82117b48e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e28b5015a08bb7b427bb90d734089a277eb749803280d5edd578fd4ab6bf48c3c6ad69176c116b3d98452e377c08bc4c2d06f552db3258c0c4062a498e22c438114dd312353e47444f4a3e393109fa4a33fd183b599ac0f7290726f9589f24a266e6214dbd0a165e22b277c88047ce9aba14f0b0912920560c89c658997590b4e18e7bd5989e9PI:KEY:<KEY>END_PIbPI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI0a5064fa134276b7617bd081PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PIdddd2fa53PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PIbePI:KEY:<KEY>END_PIaaaPI:KEY:<KEY>END_PIdecPI:KEY:<KEY>END_PIebPI:KEY:<KEY>END_PI"
f()
COUNT = "12"
EntropyInput = "c648e453f220fd4568476502b7260069174cd037157de9021346e81695a0f310"
Nonce = "f38c95d2dd89f2f83a26125306249bce"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "43a9a34282ff596a085abba35356affec9178ede69c2abb61b6f697f8e88c1c89a1585a246e1ba6bab4f9ef2d886bf570e7e17b587bb5a65bdce7c23372eff0a56e66689a000c0d30620678accc0196eca5c3b28d2d7ab89e8919e8caPI:KEY:<KEY>END_PI"
f()
COUNT = "13"
EntropyInput = "19306c387a4da3de2f76013cd9c584dcf5e91a85a6dd35c0f25f2862a785bc0e"
Nonce = "ca0ef920312aa7c7dbcc510f9fd0c29a"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9e13d3d914923d8a6f3d182cb8b17bcaa961ac018af69a716fe9c95f091c7e15877892e001e2b6d656306cd8359PI:KEY:<KEY>END_PI"
f()
COUNT = "14"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "ed884f91a94c1b0a51f316df776283af"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c74ce568f0PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI25a3d7c1PI:KEY:<KEY>END_PI9a2fe87d565dccdcee7c62ed32b577763f510f0029a99530209628359bedf4bbfed1a13c222692d8cae60ca736df834a6e316db27642ed5839d2e11716a5c06e8d067e8548d7ac0687da801PI:KEY:<KEY>END_PI292PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI"
f()
COUNT = "0"
EntropyInput = "PI:KEY:<KEY>END_PI0e3a1d456f6"
Nonce = "c925484deeb0c02e1ec7a38ef5e36794"
PersonalizationString = "6252125662bf914498ec710dd31f0605278245e955e9533099ea9afb0ad6ef63"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ea3ee991336bf6581121965ff6a6283014f5c523d1dee5dc80e2721eb83a45b987d3a8abfa55ee72ed6cc2068588a6b8caf25fec88ab5f85ac642ba24e8414ca1e707e3d10f7908b186a82db2b68ce58fb47b670730bad51f8680d59e179f032de3a0f79723b933673264098fb1ec8f3793eceec7131cdd562898fa091571df4cd5e32026e7889fc8b659e90eab98baa2cb43096c352e58066ab913f05e728136a83d24e76b41c21ab6822c4ca4c04e14733a1dfd2b71a270b528346315609139005194b7f3d07bf28108af97f09fb374a57bb9aa7680cb9e78e2160c972e938ffcbabf12b971011ab7c1a91703d3c1c394463d907545c82623a3ae1d2af3667"
f()
COUNT = "1"
EntropyInput = "ef6b4f56c5db9f685e6ec380c464a4dbb95cf606f084586c58672b15d053d64a"
Nonce = "e16ff3c7a87dcefd6e10de7911ca6ed9"
PersonalizationString = "50802dacbd92284106b984a2e396fe6bb812d99854e400089aa90cd5f144269c"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "879ebdba3b1b84207f6fec1a1634ca18367ceb5965f19e27e5ff68560a37604b9735adfc9afefe54a5fa2dad2518256d3c1df4df770f674bb7344b10930d1216af13a34605177f083b4e33709681def353db5af5a299736697222ce8b642e11c745ae8f0cd1b76f4ef769982defc93c1c70ca94ceb83f8886859ead2f726e3fe2f4bca26af14cc7709143c45a6a5b958d91660ffPI:KEY:<KEY>END_PI"
f()
COUNT = "2"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "5a8694dcc941d12b4d493c19cd570de9"
PersonalizationString = "2216173dfb01b06b657de3436d0664a388f808b60756149be8abdceee6f4cf2e"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9207bef177758af5c15d7d3966830b6ef24b4637b6add27942c6d424e2ea88f019c0461248d2617b9465a83b05dd41d7068a7a504c8db20ba0764e06b94b90c6bffa114fc60edd4800d5f58c423da2PI:KEY:<KEY>END_PI"
f()
COUNT = "3"
EntropyInput = "dd3ad19720c1d6c4879fa48ae23714bca5a1d66c0954931869185b48dbce099f"
Nonce = "48c5d647187ef550d19146ee9cb698f3"
PersonalizationString = "18f7902106c00d137e6b15a4bed0b4accfe6646128ee8823ac669e24179303df"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "98PI:KEY:<KEY>END_PI9e9a4b03179506cca38808f3f7cfadb64f3e803c343a86285fa12038acae76447185fd501d5a2e6d28fa115dee82b51dee3f3fbfe25e773d251a020f563aec137c70039b2fb19280dd6af9ff02b637bcbcd9e797f26106906f9592538f4c2a9dcd48f1ecb38f7c2ae448f21170ed80535ba1a8f54d75e4d716a848a27d49fd046862dda79f1988ba90e3ddf6b5986ff969488PI:KEY:<KEY>END_PI"
f()
COUNT = "4"
EntropyInput = "5e2d0af8be964d1a61be969defc7f60a06814b957be5cd8ca15664f497794b71"
Nonce = "2eae930008a2aabe1f198c85b8a8d6c0"
PersonalizationString = "1199ca7cdaf509f81d91ffb82fde7c046ac4656d3b5dd0cf1074fb5038347e49"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "88daeabbe4e2a2569535426d288b9ccbad2cd69560575ab7a41059f59f8cfcfbcd0e2014407cdb6704b017778d5212cb1ce4e32d644c3b41202013f56853be5339df4213982c4af9ecf7159354277e03618b7e43d1f0598e8989820d523f656bf1fb337b50c983c90b05f87f4f758f0f087bc6699332efc4674661362f6a503374016808ad6f40497e4bb0e114d42015725d9b19f864fc3c5c5c0ec00b8053a578538da3e137c0b4be7bf851f106e2d95fcdd7ebcb1375ad3c73c9873e70081f699adaf7d84ab7030e3b223170c051b8483f23159e98ec9220e84c0077dd6953d407dfb1e3748b3eed11e50ca7a39f89a003ebf69e803ee20d60a6ac192195d4"
f()
COUNT = "5"
EntropyInput = "92ca3d101093735e51f6fd573831b25999b1a5ce1c097e4f77f4aafa6b4c80fe"
Nonce = "d72dbca1fee829ae441d39da0465e172"
PersonalizationString = "22e63e6682ce40e6680f2cc9d7a9ad1a596fc6415cf064e928bb1ab72df2db0d"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a5e34c0e957adb585c30195b1273b68d4cec0b345ed1bf59411733fc384d62d47ee2eede9fcd4e62781b7c2a03d5edc49d2d199f20a0942f26d97426e5c689bf7b6b81332ff8b4f9ec595e604a49c5752761c97b3d592ac04701c561a580460ff11351cb885c34834bc46d0584ff4fa9b449fbd9d03600dc1bd622c4e4940bb6a64f4ac7e71e8c23d52e1c348eff5PI:KEY:<KEY>END_PI"
f()
COUNT = "6"
EntropyInput = "e1d4f840d1a01cf5e3baf6eb6aab35c639f60571275f1c115eecad9ec2758f8b"
Nonce = "f5c70fdd75c0aafbf443d897d31f181b"
PersonalizationString = "1a4cc8a65d133ed5e0548f770277d0e3eadfff3c24f09e00f15f1f0ccee00d4f"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a194fa818179426cbd54eb333c2517054cdf917529d3a9e589f27dcdf99fe3c342b95f4f79806c236f786a38bbe110a8693563ab67ba6568b45e309a6d245b1f87ae2d48ab1d3ea36cae52eac12b44f4680f2d611ce9c72f56663fd1e36fe45aeaee8d4e996c1f7d38aaebb0b531e2d663108994ba31a2ce149d5a32452377e05dc4a413df8dfb10b3595df855e0e07c2a347331e871c0b00139bd0a2ecd715a4a5a4e85239f466c779d96f44de09142bc40f3a48390f9606d65386a214d99932b0ed3be2af18bb0de0d05e8a875334e62291ae6c0b91f39fc1586dded2d2fb318f2d26d843332218798faefe3e9e3425502efdf010d1dcbPI:KEY:<KEY>END_PI32f6343f3c85f1b"
f()
COUNT = "7"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "67fe6aaf8f40159e194a0cff0162ded0"
PersonalizationString = "6aa803389ba0af55905fd1873fffc6c9453034a363dba07bee0cae6f73254fec"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "912f5656584c52f95a4a503e26c23b99fe2dd4b96fb03e8d86b29d780bb55a0086b3a77a67ab163c56abde4ceb6a68c4b06eba82371f587ed043739e12cd6e722a6d73d01495ed89e35dddc2b794ae7155179c609dc4f9a7edefcb4c92e1025aff94a9d24b7d84dPI:KEY:<KEY>END_PI01PI:KEY:<KEY>END_PIdbPI:KEY:<KEY>END_PIbbdfdPI:KEY:<KEY>END_PIdcPI:KEY:<KEY>END_PIcbPI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIeb4f6046PI:KEY:<KEY>END_PIcf8f58cf5d37ffbab4d6b1a56136ad14543e015ff7a225bacf8781525e96c3e31b8da29c6805572620feef74b20360764fbbdd06233f1a94905c378c66ce86066c12cb92f8375fbf14f4fb205de70ef7ed38b28932fe186bc10f6dda1c73c20e18718bc6b59b39f5"
f()
COUNT = "8"
EntropyInput = "47369855076e8388e990cc50d9eabaccebb582e6c369a99b6060424fcc23494a"
Nonce = "afc19984384c07a8fcb59c8e63ba97e5"
PersonalizationString = "088a77b7655f59f2dba8fbb3aed15499e13342d66c7b0655cfb1b1395c725b44"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6f084fc8c0b936aaf49e1a98f3a96846735895ba71b246a837516b6c678b5f6a8b9a091fc6bab3307f428e97eaab850e5cd014e7fc356e2af6c8d673fa58c1bd201fd8be3f38759d109bd06d6452786d230700ceaccee38fb0de9dd05a5f9d0a64dc447ba63f92d93c58464f5a14026c4e2d83d8af8da039839552dac49fe50ca95fb38ef1dffd8ae4c1ba5640621c087118f8d71d69cca33cbcb58742a16eb90bdfa51238877e55bcdb018cba252e26f222272a6c267c28be26db945fb4f0cda1c0b4ca281fa2a85b2625504609fe86005b9e71237bf50c31cedf9e13ef022d6b348873d9f5eb3cb9a980e063d76c9e1baab412eafe3f6980e560fe6d8efcf8"
f()
COUNT = "9"
EntropyInput = "9770de601e4657b3746637e5599a79f4ba210bb03d8805fba3fa1f2f26737592"
Nonce = "148dc9db3e1e58a31fc21e596dec2324"
PersonalizationString = "5bffe17060a51fe205385ac70c9634873cee14fef7ce2fa8970f7e9ffba450f8"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "30339e731f1f4fc03c326affccc77c23678f6ddfda53b944d9ccf8429b4ff06b36f77e5e0fc378d083c9381e8de0a24285aa3b17dfe2ce7f3fe591afdc0e9a91e9a90f69566d104bac8086781e543487f652d77f836462b01a3c5f1e8208ec43f6f7aa78bced28b9de9b1de36a468630966c0762e31f6fb8b0d07a86210ec395aac19c5a4f3661c9f7de171106f656f705ef14e7f30d3bce37335ad53093f5dfc1971c39a0fece8259800d1b022de76cf250bf5d2a22ff62227a8a4176f9c8308bfae7fa68c1fbe7b2027254c39a161ba4280e38785f664afeaa3ab2df3c99c28939378c1864282715d16335c8e75a085d7f389aeda6c26c331683fce2d01ace"
f()
COUNT = "10"
EntropyInput = "381ec64f6818df09b9295dae3adabcd409e6302d5434f15f37ec9e5223f08a05"
Nonce = "deabba7b30c167c6e6876b63983163a9"
PersonalizationString = "698f68deb716fa4258dfa3869119bfa258b0645f9742bcc362988251276659fc"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "3533a7cf3cc1aa7b16ce6be85d863b65734649b6668fd63dcbfa92a320af14b6f2bd01008e6a7a2232f36b4891a566723d63c4915ecc00915c96b0f50bc999d3ad4783b8e3d6157b5204dPI:KEY:<KEY>END_PI80PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI46246a28PI:KEY:<KEY>END_PI5PI:KEY:<KEY>END_PI9PI:KEY:<KEY>END_PI4521PI:KEY:<KEY>END_PIfc1PI:KEY:<KEY>END_PI6b34d1PI:KEY:<KEY>END_PI4ee79PI:KEY:<KEY>END_PI18eba29a1bc7c10bde98653e732918b6176ad764f3ea31543240beb406c473f1e60f6b20ab383be850ddf581cab"
f()
COUNT = "11"
EntropyInput = "93c686ac3e6a7d9a4b70fa7152354f3eab1641bc3afa7b4fe4629d94613d359d"
Nonce = "2c0b9cfc3c188fd6e16721ab5186626b"
PersonalizationString = "PI:KEY:<KEY>END_PI"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "47abfa2d8ae584ef5PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PI84PI:KEY:<KEY>END_PI06PI:KEY:<KEY>END_PI82f6a3cb366cfa0d6a8582cf99d32e89473cf7a7d2db63e964e48557a1210499beddd73073028cabddf737a8ab9b7ea17f4ed7bfb94c80f03f5f0PI:KEY:<KEY>END_PI64fPI:KEY:<KEY>END_PIb5PI:KEY:<KEY>END_PIdfa0fcPI:KEY:<KEY>END_PI"
f()
COUNT = "12"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "98de460fPI:KEY:<KEY>END_PI"
PersonalizationString = "PI:KEY:<KEY>END_PI"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "10b72d019296b20db00cc383abdbaa2b69bb4cf3PI:KEY:<KEY>END_PI6c4fbf8PI:KEY:<KEY>END_PIfdcea1PI:KEY:<KEY>END_PI0d0PI:KEY:<KEY>END_PIcbcPI:KEY:<KEY>END_PI3dcPI:KEY:<KEY>END_PIfdPI:KEY:<KEY>END_PI1e10PI:KEY:<KEY>END_PIe86f4b4ff6ccad0dfa1e5a27b619e62fece2eb9b6e65c5aa5fe22867304d46971a6365e33f60821cbPI:KEY:<KEY>END_PI5460PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI33c7771ePI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI00PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIbfPI:KEY:<KEY>END_PI0c1c8266673e8dad1cca8e6cfa1e601be95917184677b7534dfd2c6f1640821cc675794b29fcc71df517cee4ae6efe95d2fd866939aca4400ea374a8acd"
f()
COUNT = "13"
EntropyInput = "bee32aca74973a8b63b36cd8ac04a68f36484202c6249ba92cd33a1379ee2e6c"
Nonce = "a5d175205ef0278c9df481f882d482ad"
PersonalizationString = "ac5f8a3e150849a818d0170bcc772e0397b7c70cca37a466fb774bca78e4d708"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "22104a4798cdec3742e654aaca8122f69437867fad058e34e840bf94d460b61e2d7aeb653ce8c8723c00df1b4f77eff3a70345c1a2b3fd601075667b5cddeec75bdea28a5066833f40b50d7350b12a5cd93afcf19b353d06083acdd05f8c8b64542c3ab2b4ae1283df7fcdf747d3b0bbb3ec3345a0f8fcd156692a4a2e6d887c8f3da7289282865f4d75e0ac46cf06b4a93fc0f7ef19aab22290104095cc1f94b03688c7b3712491b9ab2990c2041PI:KEY:<KEY>END_PI0a22e6b0PI:KEY:<KEY>END_PIe1bcb3ea75PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI62fca5bebfPI:KEY:<KEY>END_PIbPI:KEY:<KEY>END_PIe06PI:KEY:<KEY>END_PIe620PI:KEY:<KEY>END_PIcaPI:KEY:<KEY>END_PI96dPI:KEY:<KEY>END_PIfcPI:KEY:<KEY>END_PIda8cc0PI:KEY:<KEY>END_PI3023626PI:KEY:<KEY>END_PI66PI:KEY:<KEY>END_PIe2590a68e8028417e4ba0edc1622a6f1b4d8bdf9519aab87beb2f89888e8b3bd6a0d42107653a69427f"
f()
COUNT = "14"
EntropyInput = "cba112f4a75eb3dadb31a728f3ea66ee4671e971a313e6516ab3b3890f7432de"
Nonce = "70916df78dd9ea799230435b3e48686b"
PersonalizationString = "bf755696adb9c92839798798f836b063cbbe987f0163ef3f4a97222c888f5da0"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "411cd8e76e711447e8a93ca95aa3aac5e51f559d65a8385a15e71877ac8472a347d9d453bd6761655711ce2133900d28e41cfd1292d28848646e5cbdcac1e60e49e62aab169b1735e701e38d65ccc073f277972ca85444deaPI:KEY:<KEY>END_PIafPI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PId32PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIaaaPI:KEY:<KEY>END_PIee43f73PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PIbf0PI:KEY:<KEY>END_PI3240PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI7c8PI:KEY:<KEY>END_PI5dc3e0PI:KEY:<KEY>END_PI62PI:KEY:<KEY>END_PI62PI:KEY:<KEY>END_PI91PI:KEY:<KEY>END_PIf486cd7PI:KEY:<KEY>END_PI5ff330f3PI:KEY:<KEY>END_PI316afb762b1a06cf8b593ca00d7edf739e2e6827a7af662f33bb09fad09d6bdb3a565f2bd32512c79927d390c79a1cc6dbPI:KEY:<KEY>END_PI68b13PI:KEY:<KEY>END_PI0"
f()
COUNT = "0"
EntropyInput = "b8986abc6b50516023dec0e7781e93b4b03848dde5e52228d294554df1c2bb00"
Nonce = "f33c24a6daeac094c1ccd55cf361977e"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "95b7f29293e4a8f8482708020c7ecd95dcf05cdb3df4a4483b686419c74582b9e98edebf5ddc6bbf9814f17f6d46eaa90cf3c13ee1PI:KEY:<KEY>END_PIe4fePI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI73e3PI:KEY:<KEY>END_PI167a57a4ff8cf8010cb3bff991f4e93e70db1e37f40a7a82d4faccc3be32b9135d027d95ac543b632a310620a02e3b470a254e9dc98c4e99e0136a104312639809fe0dd94ab03a2eeeaa43ad232e3793b4aa7b0b78767d11c85d2f87f7849ee2d7189f1e4e5b8b08bac8464454350PI:KEY:<KEY>END_PI1e06e7PI:KEY:<KEY>END_PI7PI:KEY:<KEY>END_PI5570071521PI:KEY:<KEY>END_PI7PI:KEY:<KEY>END_PI7PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI8PI:KEY:<KEY>END_PI2"
f()
COUNT = "1"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "9d117b412eb74a7959bae27760f40e2f"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "63ccf23c51a7a4b0PI:KEY:<KEY>END_PI"
f()
COUNT = "2"
EntropyInput = "dde440ac558146a64d1e2c2f87eb87478e0bbd74e136e689f3d265256e241477"
Nonce = "fff859ca9364614d9b5863eb66241c8d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "106f18c8ed2c030f51b4e93558dafe67172b90d87ec55cf2bbe05ae4e5b4aa1ccc48d8e394474c7df81a1c251fc7e3e6ab3c19dfce7c295f254bf11cd7b111b78ccd711fd87eb3befe8fd7eac04bc74c9c5973d4d1e49a6906fb89bcc7596a2d5068aeb44750029a2527ebca0be10a1a1cf6bfb07d76424fcaaff1a363723de6b4c0e5dc571479bfaf2867fa367d7d959b948f45b195ec62132223170f8fd4afcedc7a00d27e61fbf700f49d75dbecc39a9ae57e5f3912afcc5332e079474c4b9e378583c55e3b6f073701d887b2eca9bd847b6465318b1a449e3eb10b0471a7777253dd183c61805b0d8014467c6387fc32d96d4eb52ba83d3db2f28ee05a2b"
f()
COUNT = "3"
EntropyInput = "1345c9f6856380372ce69dfeac4ef92df722f03ecc518641706a051745da310c"
Nonce = "3bc180fbc657cef9407b75d1b54cb1e7"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c83d6366f2f83627b33b3c656a259007a0077cc81b898dd4d61df0c29a2373fa40437510f34a5752e25d70641936f47a37c760a653372e557220d2315815542b7146f4aeb3ee9f9ae20ffd438e252240d8b2e08b0797d4cb1e066003b76dcc678adb112a82b7a3ff1bf8c65452b302571d5fc02ad3f32272a6a386e3c977e756ecaf2d3d02e8cc093b862897ce2e5e948dd8f734d55fb17b07c16d6e709d79e6e5f55f9ecbe6e273a17d45822ecd0ffbc3c6c414a0f9e48e47a93fe851f95034bf26dcbbd1ceb9393eddd6af5532b4890b492217fe1f88befd804b6ee1dbd4deafe0d267ebb3d3b8811ef3a56cd6a3de86cce946640857a30f2f50bf2b49cd81"
f()
COUNT = "4"
EntropyInput = "d732d597e8a0422d76f6e50efa36e3730f59e3ecf79e315417a51f227541c05d"
Nonce = "def492adecfd386c3dd0182ffef8ffb4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ce4473c4d793faf305df6e140dc003789a07a30baf67ec1536f7aa9a7cc1f471a04bb9572136c171de8db565f2699136e27b99df40edda1feffcc2dc69105dc1cc28ed89b16043e11e4bb3d5d7f6a1c2af9a2682c50059ecfe1703aa75246f6e0f6059c3011c52a572851a9b6a833aeb9ccf2849dd17fbc9e83a038462ec9ba2237ae49abd362d3e8741bac32785296ddd9fdf65686123f8bdd880299a491e9236353321bb61251582c2a101a236b94656af99ea28697369e5e94b00945f8a78407b9a8271f3e2ab4c782c13a5e5be75537adc659ab2d163dc126460e9f6985dac8a43fdae67502239c85f634fe48064222ab8c3e74e71f8170a4c1c6c5f5951"
f()
COUNT = "5"
EntropyInput = "5c03a20629e0853b273a8c5e8f89203740133523221903a50b03ba6234d6625c"
Nonce = "45501a3fb480211f9d2b905ea7594986"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "5faf1daeb0830553498d82ac172c0772d8dd27da798244ab2c6757b52e0e0a296778fdd919b39878e97a22db985d2c6d68b67b73e6e43fa9fce011500aa9145ba44b118ceca3d563281fa4eee23f7664d07f1882ee5979974ad726d37f43bee6ee7a16e033116c4ccebf1f65a859754716c43b98021bd588c79bfb1926db0c0211f746PI:KEY:<KEY>END_PIaeePI:KEY:<KEY>END_PIbePI:KEY:<KEY>END_PI"
f()
COUNT = "6"
EntropyInput = "ceb630090ef9282f160d091a8e72b664783dc3fb75991f3ae1f7c6f73a2af906"
Nonce = "7c00f71bdf80b23077f1f5b023c6e2d3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2c8416d3b2e9a4d1d613b5e15d8a11d47893a625cede12d0a72b2b3bc51a20898fa3ba2277b5a6aaf1533cf89de5bda5a4718a303a6e34ae7faa1ab282b96057459a743be70c4d966824ebdf872682ac4a28d24ccec49c5a8e001e33bf56f01a0d33c11669d75133e8711b763463e40462a78fec1f92859306c3515986a56aa3834dc6e9fb6adf4c59519f288c80519491f1c0f3ce10d06058ded3ac519918156427884b431bbc13d3aca7d10e0674733c55f727e18d84a5de635d92fed7bd08957434367e803fc2c8f33cf41068bbcba158bb28dc0913ad6456c3f5208413795909c47e375292b7d4e2e23a68df5ae3c5850b18b216991079ae32a211c95da0"
f()
COUNT = "7"
EntropyInput = "76b7040ddaf267ec9336ca11549bf3ca5b7bb0a8e5f9f5d8590ac8b6cf7ea1f1"
Nonce = "0dbc66c634c191cae0b2f868cd1e3ad6"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2895076c2ab15efb5ae7d61fe578f78301bd35cefd33f1e752a5bcb18a65c197479efee3b262277bc7af37bb6b3aPI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI52PI:KEY:<KEY>END_PI221af880d89be0ad1e077c94e9321608a11d4296c3d2506c6ed3dd7497934068604bc3f3d8dfc75PI:KEY:<KEY>END_PI0fPI:KEY:<KEY>END_PI8c88ee6bcPI:KEY:<KEY>END_PI"
f()
COUNT = "8"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "49e936bf613e20debe5dd21c69109806"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bc35bdf36345602PI:KEY:<KEY>END_PI"
f()
COUNT = "9"
EntropyInput = "PI:KEY:<KEY>END_PI5efcd4e3d7"
Nonce = "45e7d8d1df1cce8e4c7b8440497523b8"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "434171f3f7354d83fec4db3d3661c711af86509600390f65a9bba8e441012ac77fcdf571d8ccd0cfd251912ce649fc54635a058ae7ee7cb6f569b23f878ddba61a7697f460e38886b6c87748d681e92f0bf9fee069518c54e8ec68e97f8a37abb2ab3a52229486150d58d18d1adf04c0da18681aacffc5aa930c3917b363d5d09563a551d357c36f0a4cf8ae1ac19929483f38cdf6622e6920eb59f53f2adacc373d7de0d44fa850de05c8a6769cc62fa06b1613d8027d926858aac39b6caf61d2d29435aefd106910234b1cffc5cd44ea7c09980e0841c7de8cce4115d5aa570b842a66aef9e2fb79be1a5b80b4d8e16bf6580195d88855896a781f7818de65"
f()
COUNT = "10"
EntropyInput = "9246151f2e277d5a46b79d0974eee76bd6a47b4d0464e01c00155697bad29380"
Nonce = "43e6b81c6860e213f058e63d2f3104cd"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "e72f3fc80993eb5c3cbd9b1f5012b53d33e7c7fb10cc4371ad20f1b80945e41b4e7114130fc5d86aa3a2869cc28c8401708d6a52fee5e8fa610ef5f1bed0b3e6392a9d238d714cb4d177858508b0623ca80d8458509b12e2b9bbb45482c68199a9fab0d3b3c9144d0685b88200720fc0a58095603851397ddfab4b1fdd014aa893fd3821680cfa9fdbd356a62cb59939401715cd2ac1f878fe78b4754a5f0c8860c6fbe554a95331264ae2b5f918fcaba26b32c1ee5dcd9722684e7f5d7f18c42a1855ab7e2b504c6af919d3fd2e3b0de2022afc88b8e9082fae2949389456f323ecf76ba43074de7256b00ecbc0ce278ecd8024c37e684c1af05814ee2ad34f"
f()
COUNT = "0"
EntropyInput = "edb77aba67caabf66d3c8d413dc36566b7dd33c73d63e960ada87cdad9dadbee"
Nonce = "c978a652b5e6ac2a190904bc40d6756e"
PersonalizationString = "9b383b001677ddaf1170ad611a6290243deeee5d66800c4df57d9eadea09a427"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "44c890c4ba73a795eedd9166cbde015048f77ff2c66fd44897f6336885bc7549e624f203ad2e89765859d1189d09658e19e4a30d929a896db54df1ad5c3fdd8b87b8e5f90bae3bd9e9810e3cefd816320a80aa8b2ddec800c422befceaaf438005ae24a35568047298b136f47d832fef5ef8a1d53e8a6f1f89ee49fc560f80112f7d40859ab8c7e2e4a4618da79b996818PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PIcPI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PIee6PI:KEY:<KEY>END_PI62PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PIddbfaPI:KEY:<KEY>END_PIce6PI:KEY:<KEY>END_PIabbPI:KEY:<KEY>END_PI"
f()
COUNT = "1"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "9d59d755eae840fbbfd9a37e9e02ef07"
PersonalizationString = "d5550e16a863843f4cd187bfb650f683adbb44c86d50ccc21f3e7630db3335f0"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a2c62c753a64e44e34be03981037275ae9244b016d05a2c9a63b36fc611c82d4ecd819c1d3910147b25b7bfbee0236ed6711a4293825c5d57cc1c58af1ddcfb8df533d81b6138645PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI2840PI:KEY:<KEY>END_PIa7eded21499d7088aa60cd444a95915ce7767228c9bc4953d53f46d90f67e736bfd7dde2442ed01182253aeb8ea827f3049faff9c210e99c4b33ea6e623ef7b6d2c975c374ddce64f63860bc3c9db27015d23d97c27b90bef3088cec88a3d0d905eb1d11b32596b6b35281bedb3acf36f61feab9dd9ce9fb299f7d78e50404640827851222cfac558fcca1848da435bef281c739cd27"
f()
COUNT = "2"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "0da29b48baf4f732099e4eddd2fb96c7"
PersonalizationString = "PI:KEY:<KEY>END_PI39PI:KEY:<KEY>END_PI"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "PI:KEY:<KEY>END_PI"
f()
COUNT = "3"
EntropyInput = "PI:KEY:<KEY>END_PI5b1997bd89827d80009f"
Nonce = "7327fcb73b868a9cbfcff006887e24c7"
PersonalizationString = "00275a675d26641f1ab35a7528984a8dca8c97ebab8eb6eb28cb66fe84221ff2"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "b81c15c53d887dcef3f883a7d59d4c9c9a0cc12e025dc35edac3bdfddc103075aef3f64a51082bb4192acd3506c485ef3860c3064c58189464540a81048492bbdd30bf008bedaf29c0da72f074dcd1de0a960ec0ba7bd14d9f2387a613c3c90b1641ddd7c3fab4dc87690d29d0e04ff239234f863d82411931e2ffaa1d145f659309ff4a812ebd0b42e73493236540a5f01eb1b16d9b708c096308696fe0e6ebf082b8056cd52fcc5c3dca38d63a6cac9c511bc868a4d66df93474ea8d2927edd1e82860de415aecb983891cc2fe543a2ace004049a9e093e04d4f70de538532665168811a460b266dd67bc690c85978be0a842b39d3b2dde330f2f9a73afb87"
f()
COUNT = "4"
EntropyInput = "beb782e041c9d9a5b139e53d8e08143e0068542cb2b7e5db08499b956eb8a886"
Nonce = "cb85d7488309f168aa876d0734d3ad5b"
PersonalizationString = "afc9951f1f4a984a9a8df813305d0fd3522bb403964bc59a74a81ed0c85c2310"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bfaa34c4fff641c7aaaddd740fba23c411e1d8b42fb3352c1727784880625d1e361c27aada86e9576769428746007526d5557e391dfdc780fe07ed6efc11867b09445ad1b7e2e2b0677347b9115af686e260f5d931b2018853120726670d5614c6baceaa5af00c0820ffc2a05ecf892f86ea228a8be5fedea5d92a8da790bc124dc9088e39c40ac841d10e2d62447be7d201PI:KEY:<KEY>END_PI"
f()
COUNT = "5"
EntropyInput = "d5bf7d62d00accf87cd381fbd180da753d77295d2686363694a701c488ab0c41"
Nonce = "6b20f1e0dca4e33d41ad2e1e9c208f31"
PersonalizationString = "eaa87c33076d80188b5fad9b2a8a02bf86444c44da180b96d268b8cfb1542390"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "06526cd25183a00907d645d24335e149ca77df7f85e92748a7a87b61feba04664bcacc26bd3b1ea915ddb05efcc0afbfe9b0a589f059a8e683bf69223dd192bd88f3e2aef159d330bdcb594db1570d66efc1ce9815190e482dea0f49ade057e3877ffd9a09bcc026bfPI:KEY:<KEY>END_PIe067f7c14PI:KEY:<KEY>END_PIb07PI:KEY:<KEY>END_PIbddPI:KEY:<KEY>END_PI"
f()
COUNT = "6"
EntropyInput = "5a85a9bf855fdcf49be93d2526a919a4894c0f3aeb309d40f207901ecc0fa28d"
Nonce = "602a3e7262dc08315232d907ad1f59a6"
PersonalizationString = "PI:KEY:<KEY>END_PI"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "349fde4PI:KEY:<KEY>END_PI"
f()
COUNT = "7"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "75cf81e0cfc6e785f9726764aa4645e8"
PersonalizationString = "a59dd29cca65bd03afea186a4954ef29206731fa886a48206ebf7fb6927a3e48"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "d6cf433eca8f0666456bafc8aef685dd0e754809484c24ebe02540eb23aa1347b6c7a50e2dbefe708721b4faa6c789a1bd6713ee9cf90a1ebfea3c3aeeb140cc98632ed1243f54089c5a1ad6e417b07aa2fb6c499d4a61243174c710ddf884f6b4852150ca52b9b720e4695ae896fcce789bbdcdf46a294c745d87d396fa9672e7bcddc44bb3f60c311a188666cf8881372df9f8d5e9c043ec407f88c820efa189256d7c1c7cb80041ed2adb12bde1e0d6c859436c7477af255b142cebeb166e1620e90a7678065c4af0701b56076417723756929b11b2eff02db9c453ee8dddc972cbba1609582bda90a0ae87a66939937e4f77cb1d377232b4616239516ff3"
f()
COUNT = "8"
EntropyInput = "8ea56a01e2005c37c31497fd29737ea3b4526dc41437fa458f0b5832ac20eb62"
Nonce = "d943aa0cd94bd4978aad7c73780334fb"
PersonalizationString = "1a42ae9e19b372b72c1b531514a053ea1a78666c16923df2f2e79e6180006efc"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "d6a2ac0a8ad361cfd21fdaabbfa801a355b11b19a1ef8bb273c4467186df3950aded4e5da688d791b82480f8f153da515624273839c737e104d45546e3ecd93a6dd264632109c64514a54d6269e4b532451ab5858f5822e1f591dbff0e059b7f3d4008b568a4ad5da523310a5b26d8db5a567ab4c4a06152113ee8f36a219630391c5dff713f1533f5bc008799156260d6651a40d37ba3943beed438ca200c4ce9fa7ded15c7f603ef42525a44a11d58ee5822085d5b20ab20e7edec9e85b547bbd69bba771ab4c3ff826dc431d6989baf43c9b6290e49d03c8b9994f84f8a284c8cae9276dd0ff1f5b667557c23d6992ae9fa10331b7e9bae6a8b91522215a5"
f()
COUNT = "9"
EntropyInput = "519b1945befce5d1e96187884347ef9b3cd4e5071cec80fb51c98c67c453c442"
Nonce = "2fb7d601b274bbf70e993d28e0ed8e72"
PersonalizationString = "3b80d6282d60ddc94765a1bf565f7e852dc1f02fbdea78b69618adc620c1f40e"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "84dd67414dcf2958a46055de4fc10ca01c25e6cb267382474a5b9d2f1368a57304c33775099e503f95ff1210d4a67d2096c10f1ec3bf20d743fdd76ebdd256dcff2e0cdc5a33eeb53ba22ef8a4fe3ca9d6cbaf80827256b4PI:KEY:<KEY>END_PI2cbPI:KEY:<KEY>END_PI1de591f52e6e75e7859bceace3e1777ecc049f3998a70144db83ea86fc064e95efad6e35b4106c297bfb2755f7fb30addc540c89a5a8851174ce22fd1b7e836fa05e4808a1a407ba0afb3532c6cfa8f0e927d958a51a59c82cfad3f8PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PI2e1PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI88PI:KEY:<KEY>END_PI7PI:KEY:<KEY>END_PI9PI:KEY:<KEY>END_PIdbb6a0"
f()
COUNT = "10"
EntropyInput = "83cc514fa8ab6bdfb33360PI:KEY:<KEY>END_PIfcbbdfPI:KEY:<KEY>END_PIcbPI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI"
Nonce = "af261aca6c9304f2da6aacae2dc03883"
PersonalizationString = "786925c06d3c492a86815236ccdcc4accef34PI:KEY:<KEY>END_PIc8f38ef3PI:KEY:<KEY>END_PIfaadfcPI:KEY:<KEY>END_PIcb8cdPI:KEY:<KEY>END_PI4"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "8d0e4fc80515d2e3eefb3502227dab5ee4351c91dd01044cPI:KEY:<KEY>END_PI"
f()
COUNT = "11"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "74eace5391ea07e06086ac34PI:KEY:<KEY>END_PI"
PersonalizationString = "PI:KEY:<KEY>END_PI"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "babea6d83335979e5a00ce624eeb176c3cee353b0a54fc527b3e8a0cc50adf9ee0b1c593fc7eeb9172360c13269fPI:KEY:<KEY>END_PI2bPI:KEY:<KEY>END_PI98PI:KEY:<KEY>END_PI27PI:KEY:<KEY>END_PIb1PI:KEY:<KEY>END_PIb6PI:KEY:<KEY>END_PI486PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI11PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIdeaPI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI2a9734a365d90795c24e26802d20ea0f716524cd4a0ff51d477d0576576edf380c19df4f02adeda7be181225af4531e8ab14507460604bb343cef74"
f()
COUNT = "12"
EntropyInput = "00fc95fa83856472b00b768fc708a33aa34f2ed9131806db181c866afd1462be"
Nonce = "d83ab71ea108ea16515709e570e254d3"
PersonalizationString = "fdbb2d6bbc8a928fe4517ee72aee729d0eb1271ca81af6a5088238431ceb7095"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c081d6b891989eb071bf0a0b71c474907265be63e377a09da9a960242031dd90975980facd28cd796a682204f82283748bbb5fae826fd9ca93aa1bd0defc349de351f7e6f20e21a0ab8136228698035aa25fcae2167118fb45209290df4e6913d0ab1c86d3c9fc6f6e0060888298fc66ee23654c084126579ec84695f3a186f5ebd25785cb46e9a59e255625e2818bad169e6f7cc74c534d12364370faa8a6361f9e7bf555d67e7242cdb938040a26ed80606fd06914e75195d534726318f07b8dba65cc62319e0888712ee6538689d59bea3d885e0726295f219d6592dac0789f804ad13ac299f740bb90fe4931015398a6dd5e9fda6341958111fce25e4041"
f()
COUNT = "13"
EntropyInput = "38dacb8077d4db34f11073e2eb9010dd02dc81ecb8ff3eb9b734f64c48e53fe2"
Nonce = "af14d0a2076e6a24f5ca02486ac730dd"
PersonalizationString = "28dc06090ccea62ffa3118dd24bf603ff69953c457dfdcdf1e9faced7d35e768"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "5c587214e8d8da5b7f02254ffb5a22010a67dc6bce57c87f0d0c06e055cab7ccb833f90eb0138a33c5fb4b0d0360004cc24fa15ae5dcec1338a8233479a31d9ee03f9ea28e78495e6abf4541b17ca14207beedde6055c7f2364564e62a91df25da12f61efbf2cPI:KEY:<KEY>END_PI1c1ff1388629c1e323eef58c4PI:KEY:<KEY>END_PI7e0PI:KEY:<KEY>END_PI5755f81266PI:KEY:<KEY>END_PI6721PI:KEY:<KEY>END_PIe56PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PIdb4PI:KEY:<KEY>END_PIccb600PI:KEY:<KEY>END_PI871ad705d69855db4a664ce644701f044630a57c2ed719335c5b45cc82e4c57e1408adeb7d748199a4ba60f56642c44090092d88c26e"
f()
COUNT = "14"
EntropyInput = "5f0d1e9762c2724d5f95c91ae417ec0bdc4646ffb3ed6a880f4380d514caae6e"
Nonce = "c600da30d68cddd9b823433845111880"
PersonalizationString = "8896ff67866ff1f59c8e5074d91e6b9112410c9b6a1eefbcf05a1b8c7123dc89"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ad8150de910a0bbdad0a674d032919ac3304d5977fc43ad5d5PI:KEY:<KEY>END_PI"
f()
COUNT = "0"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "0af3420dcb3b3c9fcab87faa4b8d424d"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4a7de883632c3994a36a9ddea329a9de611938d1ef7664d253e5521aaa8351fb2b0dfad134ce0265c244fe0bed3a3aa92f0d1a9c6acef83f7de0ab63f8f1c3d7fb0ba92789ccbea0d623d6c13fa105f6193899a01058581c75076fc3b3e4efab80a43bf44d001c04d8d506736ab1f89b19e56964d7963c05b9012eee267a724455ab95661b8264f617be5bf9cf3f802faef499e678f4ad60bd4d0ecdab530e509c3892e285796ffec16d86944d680f9798c1d3ee68723d027a30ac4a24cd786d4d831aa7d513304dace72161c247206c87a19138545abb73e9f3d152a633db771b8fc44a30ef80cf51b72cbb2f3c6aaa4d269d21ca261c4e37b738a150de07b0"
f()
COUNT = "1"
EntropyInput = "40136bc306788c4cefdb176bfece4f36a6394877701bffd97c3ab18bd612570a"
Nonce = "ffbc7fd2c6642875705ef4fd03626c48"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a285cafeac40e0f69ba54aad2ce4729c7dfce5986280394d21415ed3d01f42d058f6398cf8f0b66b1d106633485079ff222bc776320f545bd14dd1493558475c47bea679ed53bc467cfc074e80172ee4ee1a69219e9e0a363e0943bab755e321be51100f86c2699999ffd1e28c0a2cd5aaf39ef1a0650e0d2836ba8019b459f37c46a1aad8ebcb428212571d3311c5d62566786e802d8c332e23edf9520545b6862b9bd5c1c3956b469732ee9c613fdedcab0b549456ffefa53f861bb6b2a2b88ebcc6e0bdc46e599d71508029bd38da75dc3c25e72bcb005388928c65bbd95c1a5c998ccddd238f61cece503db24f29e7c9a8cf9e65ff6a1f3d1593212662e2"
f()
COUNT = "2"
EntropyInput = "a7b5fb892d79e492e2c8d71a0102ee88fe3f59b8e4ad9cd1d81b060fd8003971"
Nonce = "7cc6a54858c8cd55f2fae01c56697c6a"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a470511f2b6ccc5165bbbf869c310ce23938ab12c43a41f7948d33a82f11e80488908d06e2af77fb0f20afecdd0ea10066b620d31930a6bfaf6187957b6e6f81b55d2e1326961c9ca81652a9596dacb4902ff4884b58c5a36b8c05aa3c13b67d27b30ceddebcd53fd8b4378ccd8d6120542647b6890c4d02caa295d5ea456496113d3a08e3fac09111eda6a045a3772bdbc70a83493d32a3204247c616de698107aa903721fd735e9fc54192e7c8bf4a6cfd4c4f905a9378b4d675abf7767c49fbff7fede516f55a291023cbad78de62eda3626e31c1ea8cc59a675bacdd28c03aab810681ecb2e56304c238fe24a1c77c9e6e3418d037a775f6e92a70698fc8"
f()
COUNT = "3"
EntropyInput = "69b215896f256a733071f69845c6cdf74b9691e7763441de0e773a31e66443fe"
Nonce = "066baca0590baa636f46ef08f5a692a3"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "01c9fe0a33ed105dca11803a2383c6d40b47a5eeaae652aca48a13e45ebada151ca8d67ddfa80695072eb6008265976e7a0ddb1433067d9f713f0a227c8790542a8fe78d7b22473e54bd4a8b5616db0201f1e9038beb957bfdad898b1c23e8af9c2b7fc2c9f96c6e6ffdd2dbf573cd78a6c340ec42d8be6025f86e873c596631bc3477848566ffbdcbd68b9e76cf38d96f4f01d8afd3962fde3da68a030daeb0034ee83fb292c1c86PI:KEY:<KEY>END_PId9238af6PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI5dc4d6PI:KEY:<KEY>END_PI820532PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PIcfPI:KEY:<KEY>END_PI6bPI:KEY:<KEY>END_PIab03PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI2deb0PI:KEY:<KEY>END_PI80e6PI:KEY:<KEY>END_PI6ccfdefe4fPI:KEY:<KEY>END_PI09bc8d6b6df8324a768dcba833f89538dfab26ed2e4ee631207000658343e45655ef5e75825c7810079c8092f905193"
f()
COUNT = "4"
EntropyInput = "6b1e50fbfab2832c10f5d700df82a557c65e02c76c93989f55440ef504323926"
Nonce = "2237e475dad8bf250e39186b8ea84c81"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1ceedd14783c8de93a55f78d671ab637df79aad2aa6c27a25e47adeeb972b70c03695bf3868e06651a58fd1bc9b1edd48d8a9f235d24dd6a75f62e70b27e8bf3e6e3f50bb86bff965c5e8825054ea8bc99b92f78daefbaff65ce19b509e502ae7e1c7d64780e9daa88e8080ead7d99da186c5862882b696159b9PI:KEY:<KEY>END_PI"
f()
COUNT = "5"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "3dac59142e1618546d5daf95d3fea0fa"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cb4a6120b3f246e8823342bb72b0e1fa96870c444046e9118626aae0e127f79a69895508a0e40b2adfe07ed0f92c2cf72787886298350983ba75577bc7c3ae4f30d66bb1c5da0a544d0e49edc45f2b7d89179e55c1PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PIba3PI:KEY:<KEY>END_PIcabbePI:KEY:<KEY>END_PIedPI:KEY:<KEY>END_PIdb0PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIcefdPI:KEY:<KEY>END_PIbbPI:KEY:<KEY>END_PIdcPI:KEY:<KEY>END_PIedPI:KEY:<KEY>END_PIcPI:KEY:<KEY>END_PIaeePI:KEY:<KEY>END_PIbdePI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIfPI:KEY:<KEY>END_PIacdPI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIbbPI:KEY:<KEY>END_PIdcPI:KEY:<KEY>END_PIebcPI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI0e"
f()
COUNT = "6"
EntropyInput = "27fce7d15031d5dd6880083d1ec5c2a3e8625b8c4c0dc0d7d438266ec7de5689"
Nonce = "c59e3bcdc1f6e31367e7b8b958eaa7d4"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "6da842ae1a45995da23d6e3b5ba2c0ec56b21624a2fdac824f3fb3b04fe416054796e2f06977838ccPI:KEY:<KEY>END_PIfPI:KEY:<KEY>END_PI8d74dPI:KEY:<KEY>END_PI410PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PI8cPI:KEY:<KEY>END_PIeePI:KEY:<KEY>END_PIePI:KEY:<KEY>END_PIePI:KEY:<KEY>END_PIePI:KEY:<KEY>END_PI"
f()
COUNT = "7"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "f279ca8bb4ea4c7136f0ad8fca7b7d86"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cfa3865020689702cb30dde9f5901000146b9b3afa92b34a88ef926071c5f868c7e5006ae33dc38ed990006f3d7ff1b3d412a325527effd32f416e19394d435043d3bee05166f22b8505fdefb1f28053424be60457833f988cb426f4a8279742f16d2163a898ef6a08c85d5fc77a8b127efbb118d0b1a3c288c29e8e0a299c9e13d3935ab6ed39a8a2dcPI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PIae897daPI:KEY:<KEY>END_PIe3PI:KEY:<KEY>END_PIab65PI:KEY:<KEY>END_PI1PI:KEY:<KEY>END_PIbf0PI:KEY:<KEY>END_PIecPI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PIe3PI:KEY:<KEY>END_PI6PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI6aa60PI:KEY:<KEY>END_PIbcfPI:KEY:<KEY>END_PIddPI:KEY:<KEY>END_PIfbPI:KEY:<KEY>END_PIbPI:KEY:<KEY>END_PIbPI:KEY:<KEY>END_PIfbPI:KEY:<KEY>END_PIfbPI:KEY:<KEY>END_PIcdPI:KEY:<KEY>END_PIbfPI:KEY:<KEY>END_PIdbcPI:KEY:<KEY>END_PI4"
f()
COUNT = "8"
EntropyInput = "2823011f32eabe40c1131b36c9f001cc28f7e86f15db184124c15e26b8d01914"
Nonce = "bd4af70749da0f3f64a915dfec31e50c"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "a0198acbe891a7acbda52fbe35181c97d58d39844fb2975c96eb0dffd606092e691048ba65295bf2db16aac82b094a93667fd18c23ad5c0b564120237d3c56da6eba0d39cc4d8e023ef15e7ead8e241cbb8d0b2560bd444b84ab3c85c1eebce0ec40fccf680f2c4d440214125a2735d889da956dc3a895c7a69f07854f962f354e67524ed18863ed71d3e77816bf460b171fbd81b0a7c364c0f6ee18d32d7543a13cf5a7d7b992b8bca523e0de92fab578f980cac24d779f806565467702f75021652287a96adcc9f420e2acb22528ca77013501d9c7e5764f625f7edaa52a26b0ff184f343bf24477cc54c893c1434f7bf38d18efcf255c397b9a70fa0b64df"
f()
COUNT = "9"
EntropyInput = "15dbcb3de71426dc0aea3a0851e7390af9e3bac12e1db58dd931d4ed2d9682e2"
Nonce = "d87baa587e87d5b0c32d734dff92d9bd"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "ec3246fca162a62512bc4ad2239270b2b0a98b25f6a7bf0aeaf80099c4c2da07e33fc1d58d41d85df68113c0d0decaa92a3838de2d99f807d615b2e969669422d9d52821315baccaf3a3630b2a7bf7f2c75a59948974759f6bb53d21ae9b981ee54261168d707eb45c0e0f7332ba702f1be30873a96f66f164ad4e78ba0ba3e5fbef4caf4b1d807e7233380f34a6d48013763bbbb5c6c16a83366dbe061b480ed45c8901804b117de73fc892c819ecc42951b130465e30f4c54f0112ad62f7b1193ec0c7725ab6489d343178b212e74ec147d3fd520a9ad9db384073b22a6a478f64b37a2e76cebea0e246660cf80536145719eff348558a72e84eb50245cc15"
f()
COUNT = "10"
EntropyInput = "6a36ca9ec24741c1389ad722a350c61008ce53432c24365cb6a60de26fff37a4"
Nonce = "50a4c1c05fc3893876e627976e1ea388"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c54305f7794a66781bbafcfcd1a5af259fa3a8b4d47c4e3ececcbbf80f885fb50dc93dcc507fa9109c238bc724289f5e3c765ffb4289ed0fd9bf7ae050c0154d11413997e61789c8bb806c61f4002a63bb2ca21bac9ca65abe92d0594da90c4e122b6ca9d0d4db29265783defa05ff40ff1e6c5089e8c1133d85d8de6f5cc20699659ba4d93e076086bcddb51bab709004e0391bb932440c951ee064PI:KEY:<KEY>END_PI"
f()
COUNT = "11"
EntropyInput = "f42f1d6f989cf2df671516b14a9a5d72a4825ae220e52b058cd32d09802d9dac"
Nonce = "985aec205afa866c62d988545950f210"
PersonalizationString = ""
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "65b86867a230ae4abc0c4e4d8c6836a13c1b289145df5111dd75a2c863823e77fe68925696f51e9e9e3ecd8d81ef2717ba90a537f7f48d8c242e4494bda43857314893a53dfc887ea27a3f8fd809bc536e6bf484430ebe45ada15426b5d2d994549cd800280654b29ee75730b8d53PI:KEY:<KEY>END_PI"
COUNT = "0"
EntropyInput = "f85649f8a8c01f8a2925f7e93e356be0fbc75206d1ce2f7e04a14257c3338a48"
Nonce = "01a8843b7a3dc0b1cab5f7c8b001598d"
PersonalizationString = "91022d072824cb580ac07555c90a31373f2dfc272de60d3bdbc0612e175874ab"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "9f40affda9c797363a7b058d7f5b848f0ba366808e7a87ec94894091ca0818dc387a8ab24PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI3PI:KEY:<KEY>END_PI8647bc920e6a0c865a297bffc88b407a24e2d2aead0e711fcf96b83bbede5bb35a5f9b0dc5e2376a693afa9070a4b1aa86dec23e6e597PI:KEY:<KEY>END_PI74237"
f()
COUNT = "1"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "d4e9df171d09a7b93949907ca65fd5b0"
PersonalizationString = "a36PI:KEY:<KEY>END_PI"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIffPI:KEY:<KEY>END_PIccPI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PIfPI:KEY:<KEY>END_PIafPI:KEY:<KEY>END_PIdecPI:KEY:<KEY>END_PIa6ce0cPI:KEY:<KEY>END_PIb"
f()
COUNT = "2"
EntropyInput = "e2743de1bead33b91f0fa01a64e2dc2175749260d4475dc1c4652c6192ff65fb"
Nonce = "952e8d0d03b09130e4df1de0f8de4484"
PersonalizationString = "b187c33f16414734eb500c3c3230d3600c4b4251c2c44085b7a585c86dc713a3"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "7da54694edc364dcaf51bb239b82b3a8956264bd1279920b34f6a7a33395900b49180e38f0e97a2b1c5b7fb11bb1e4672275cae66a007ce88d0decfca929766c2c07e019eb94ed00094a5e72a82ddb00badada39d4eee8900dba0e71ba29750641908dc4b4eec95ecc3b49cc9df72ef5ecfbd1fa8c9eda509301222f9267abb4893470a75dfa86f793db4fea9bfc1de6c637c2a29d6c60272a521c10304bcbf595cfa632798701da4d50eb776d4dbe01865a8471c58e2cdbed14f083d6b4ed3cbafe1b2ccafe82e73151a8299c3a04d36eb713dd47c9f4d306c0e503026d7d6ab6c4789078c8c95ff5abe002b4bb86a369b91b4ef23c6afc0559a2cba4ff53ea"
f()
COUNT = "3"
EntropyInput = "aa1cfe4c9f03a9990c2dd55c0775ec36f3daf3d64873ef84369PI:KEY:<KEY>END_PIbPI:KEY:<KEY>END_PI887b7dPI:KEY:<KEY>END_PIaPI:KEY:<KEY>END_PIc"
Nonce = "70484796fff90a01cfc2168d1d0f5ed9"
PersonalizationString = "21b468ff6f1e92ca410177941ec0bea74990555071cb7d7fc0844fb24cefd511"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "72ca74671d10f6aa0607c3abf4e86f022af34cd8c32cbc274eff9bd38bcd4b79c64b09e68f44a3b1c6592b7f458f743f99a3971becf6acd974792dd5812d473891766460b028f3724036496188bfd2fae5d3bf734d2503316db5c9b408496e9d99712dec355865c240d3209c1793fcc815df057ffe555d2bbf47e7370031893aefec6ef0e71d137e16c416dbe52df3b98f280f5e6b29636d7d9bb0999139fb5e46bfec53bb22c8fd68d2a15df7d4e1a2c813ae363bf3055e6def008ae16343ded598a0c08548801189ced03e6f81b31286dd8e3eab82d648b6a9fe5aa6fa1f951789cf4f5815e10188d2d9755e04f283373ce7da806cd92935aea243d6a566f9"
f()
COUNT = "4"
EntropyInput = "2625400a6130e77fa20f0b7c58cc0f9d0f22ef5ea54e5cfa6e6e648933d62322"
Nonce = "dff0eb02fc7ce93e4be2e294a24509b4"
PersonalizationString = "cdb1072fd83114ef83323ccb03d702f68a550d7a0e8b153a95eb9f771a271861"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "4fa6071756afe972853072ba73e203773937f7d6e1dcd7982c37ef7566369e27add7889b32ed2e2c2669d00633c22d91fd98f2223789681fd3b1d93a16c2278b8e4007286dc1273e5abdce7845f87c066a59b0d8152f9c13230ce488f9cf00e7c3e1e0c3719e6087fa251e8bb4ddd3e778c6149a14db3217f172a8bfd656bfe6fe2c4960768adeca843f1f36671b722fcc62dde8b2e0c5765c6232ada6a4504b21f350786d0879408d8979e19a3aa16f0ec47df3d0836296fb88363d1fbc687bed75f14ccceafb185ce90c2b0f5cef3247f1573e822c19b1b9944204d42a6101326b127262b7023e89824a3f2d4fbc4c072ed3dbb7325e77eccc70cd82218f43"
f()
COUNT = "5"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "743775b879b22ba24d0b08ded6298ef0"
PersonalizationString = "1d8d1abc5f597648889bc220040cfe3bd49ad771ebf7ff2ffc9a7bb8ce2cb285"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "1cd45a83f0236d70908291a0cb24e8af67268ba14492c0ee4f7f736e48a3da7c5bc80a0aafb54ab028907477463d7587a11c59cf2add25aa799fc39290c2284da916790985dd1d842421a24186aec5acad4ed5e511dab8c28f2a2a0b2449d1aaeb5265e5df2e708e761a42df5304dc92dd2c10028cbdabf5f21c1cf572cb0d55c194a273c166df5dce469ddaef537b3f5e72b6ec8c3f32e2a69d90a640ed3f219832117615c209251a467f7343df9a6fb891c6646f01f896d83319bec63cfb0e36d35d5b554f08a0635c3605d51f9e7cb8c32cf69cf3cbddb02f68c321ae08cd185de20256c9c78efd667a35a3c423e6a0d83213fe0acc1a11693b641037daec"
f()
COUNT = "6"
EntropyInput = "c90ef2a9a1cf4936689ec66acf771e3b0faaabbae4af866d4595d20823d04df7"
Nonce = "624caf43c3fb18b0a9b9b7b56245ce60"
PersonalizationString = "ef05d14650114038c30f441f8484301d2442f6b9167f57f1f2c0a77b5c91212a"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "f89763a96ebbc1c4b5d5730501dd5a5910a9b907b1939442562ed880bca94724f9392d31eced9bb670cf355d5113a78f6b6993a85954c8e52d450f14815e8d25f3c5af5e0791fc9f94220994d58b7e3decdaa01993428bb597f1129c7c9a0643c413d0696df191ab0b18691c77e79d5705ed144a3b54ccb3e025f4f71d62cbbab9aca0804b15325d335a35b8ad9d06435ca2b847fcf45a2bd0afc95583cc11dd66f63596c9a81ec1244a58aee352b59cd4173e1b5b51e88f1d64ed887dc7c23efbf7ef49e34bc1324e91d17403052741dcd7e1e5a866ce3e2e424096a4c67ad818220a36a4ef8379f7650a2e49a953fe488202f1a95fb55a929b0e3261f181b7"
f()
COUNT = "7"
EntropyInput = "fc9e6a14f9614e1430dfc99640633f2195e35532342ccede226e0896d0c07319"
Nonce = "a43c19082988a2a1609150d903106415"
PersonalizationString = "ec6f5aea1cff91b0b798b1247a2e79bd62173d8ccdb5daf9492b3958ad82c48f"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "852a9d864504846fda05677c567bd9fff95221e620b8473c5e51580697ae193d7bf1f3237fd094363bef04f9231d95b8531a837ad43c7ff18d165acb2502f9e645460e06e2da19bd10c2df17ef2a6c0791921d74f72f91db4f80484f4fe3eb0aedac4e6417cef76e75c68c041be290f955a6121499842549ea9251bf892107614a1ee94110ca401c096c5a88adc4b39bfa5f821fb980b6e6455ee75cfdb8cfb31756565c3c836cc8e96b537080facd6c4c38c5d15c405e904a9d708e92a626cec63a5f88e3fb2b597348a7798559d612fce9013e6cda53b8eef61d5c874ea030d377639f93f3c83b5f7f634da201ce392d9799102ba9ca4c6126dd9fb77b33e1"
f()
COUNT = "8"
EntropyInput = "a5e0b94b0efb6e1df2b691bdd3e15d68ba602e25a4e1fa7b17fe124f280b722b"
Nonce = "3be26657fd44368efebe93c16b230e4f"
PersonalizationString = "PI:KEY:<KEY>END_PI"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "bc9379fca8507d562434c8d54d35dfece72c18197593480bfa7b63b262d79667d8184c9026682b4a42b73ee237ce5ff46d8cf58PI:KEY:<KEY>END_PI4df8710PI:KEY:<KEY>END_PIb952b9d3d47f3ee346f150e8e4e21d1d3892008ed163c0cde88a6d8d6d6ee7aa2511e15d583e3f286462f9d3d13966f955898d0c0c7a369e886caf2c3df6d41238ba85086e47fa78028f3dc01545834dc73b25509ee6577a6e8f159c70407bb7b05ca9bfe2580e8ab864543fbe67c286230dfb3c792ad050e79ce16ca3fabf73387e85a68faa44ee95d"
f()
COUNT = "9"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "d472daefa0831117e7b8f3f667c5508c"
PersonalizationString = "c52f79e56dda5affe2fc350e3b6aed9cf7de57f2005e1f2f003a90f1cb175974"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "2b37c3d8c45efa020eb3f84284a93c5207b25b71c002d941528ca0d98f7ac42a72f55f1ecd13ea74a296d3e231e453511a496a0dc577252cda49b4e48056ff71cb4e309495d459d6c9fa2e6502f3ef39a06ec4dafc9f14405f14c3015b6ad7bdc9c1077aca97dc7974996c925c66a98b15fe8aa355ce3426b1af68df85491d46da2be2dc58e166edc60216520f18939cecb381d3d4efe70d89f4e4be3c93f11f5be68729f48ad9e501b327146087bb161ce7deaca44622bdbcb50efe8e076fd2e9cc3902cbaefc3abedbb60cbf24ce332a00bf7ff8ec7a2cc81d6669b9957d15d68c03e1308550b7041ce77c95de5cded1382124896b2dea1254af1e93ed7be7"
f()
COUNT = "10"
EntropyInput = "8b9e3283cc2316b6955171a2a3de5851a56ac2c3e6de14166fce6ce0d24421e4"
Nonce = "8f2caa11450b9c6676d35cfc83e3a1aa"
PersonalizationString = "55d98ce73f316177ca27dbaca3fa25111c19fac26fdc224adf71e46c33d9e076"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "cac7b77c2664ab953a413557f03b73ba499a7ba627acd4bb81b1dd77198e17ffbab3393e83cf39a56353b387d312791f89df0cd9b4c3bb94eb43d8f34f95a4d2485609728f2fe4fbb4280c35c18a1bb5f5d4f7457eb4b79dd13ae5e3f39ea592028fc95f165cf7024813dbccb18651740146276293d8a45af3d7315978a610c4891134096701bb8cebd9a4bbe0685c06f12f8d98f825b84429ab7363a04043ae9aa5732274194db7bd6517029a92ce11d57710d2152fd877c563b9dbf773930a3e50326a84fd880b24bc142744b8a8b4d0661a008684bebe8d5dd682fab88b90247fea58ee911c6c8719dbc25bc95ec4440f50b34eeec9514264d05633a63862"
f()
COUNT = "11"
EntropyInput = "63740fe4ea180a767ee3ae551a0ba9f87fb93e511830188be1da2f5a3256db07"
Nonce = "2d7f7bbab9e17b0eed3d6fe126b49af7"
PersonalizationString = "dc61dc0b522a10dec7869d396deb1ef849bfa93604299519a520516d0e673098"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "85eeeb0897db47806534ca3cc1b700625e364196dd3dc4fb771bbec51b7e5aac09164d0cd6cd6f67bfe780b656d162cb8a9d9b5a9ddac9a3a38bd1fc23cfa41a17a4271239bbfd604845866f4b515fb0e9df75152d38251f5f50f6b4d99835eae72a518eb83c2e72501a3af9b4cdbd374134f6fbe6401cf592b444be6629af1bb1378b09038a01f459bf95daec141ca7639247776e44cf0ec36c8e494f91f4cf3bc0da212437279992f0986b8f5d592c8f64c5baf2e97ce04983af1639b90ac350a84a9bafd4e659d554dd29e5bd128468675e2c264aecc332a373655704e005144ec1d8efd8e1f5c915b78c2f8ce413242d788927aa8b3f66574750fac7fafa"
f()
COUNT = "12"
EntropyInput = "5be0278fdd81b7a4a0eebc3528bbe5982ba4084415152dee27649c6bae0a6b0b"
Nonce = "afac0cd0520ad32657e543c27bb01d73"
PersonalizationString = "265d72a4f0a1f93c91f72c755e9386626f1f0afb86e0bc341dbdc67859c176cb"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "c056c7acec0c2fc67e8a66cfe62e26d63daf7dcc5bf1300f6ee44c818a35fd99ae13d16be2ed0b96ee98aead005d1b0c8ce10bd72a02045608129c12c02e6c0828717a6PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI413PI:KEY:<KEY>END_PI883PI:KEY:<KEY>END_PI0PI:KEY:<KEY>END_PI8afe8fed0e10PI:KEY:<KEY>END_PI5f195ee5365289b928b0d6c55f375b32f4e056ec7e0PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI7ed9PI:KEY:<KEY>END_PI8PI:KEY:<KEY>END_PI"
f()
COUNT = "13"
EntropyInput = "PI:KEY:<KEY>END_PI"
Nonce = "08e08a673d0f1678b1564e7c6f1695d2"
PersonalizationString = "dc5c4cdf1531fcf69c55bece5c291a96ce9330a86737770fd5452c1e77d2a5aa"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "PI:KEY:<KEY>END_PI"
f()
COUNT = "14"
EntropyInput = "2fa23531e11329997329d273d454ef186bffe879fdf95c8812533e4b8027df87"
Nonce = "0a6bef6b736129740978e31c3fa279e8"
PersonalizationString = "a5ca2491479bda16341b2c14339a5307fc2e2f5df4fa625e0ea351a95a14f588"
AdditionalInput = ""
AdditionalInput = ""
ReturnedBits = "df587647f8d440a6c8034e757cd47f28d0e58f8aad9a047cdc8a70a8b1cd0d8185240d47bc5d2f4657205ed218ec38307e68efad94714630cd490b939719a4a07ab994793112c021969a8c69872903315c74b00b677648673e5883b5f46e075550092914cfeab05454226ee3d2154698f368bfda0b8b99eff5d111c1649a0f7e67ec0f637c6d3466994d655066a95732590e521ca055b048dbafd219be1a04fcd047c3722c4adf29ebd8486e7171359292e11ac6b740b4d51093383d64d2a45e51115c689PI:KEY:<KEY>END_PI"
f()
console.log "exports.data = #{JSON.stringify out, null, 4};"
|
[
{
"context": " - represents a single page in the PDF document\nBy Devon Govett\n###\n\nclass PDFPage\n constructor: (@document, opt",
"end": 74,
"score": 0.9998672604560852,
"start": 62,
"tag": "NAME",
"value": "Devon Govett"
}
] | lib/page.coffee | jesenko/pdfkit | 0 | ###
PDFPage - represents a single page in the PDF document
By Devon Govett
###
class PDFPage
constructor: (@document, options = {}) ->
@size = options.size or 'letter'
@layout = options.layout or 'portrait'
# process margins
if typeof options.margin is 'number'
@margins =
top: options.margin
left: options.margin
bottom: options.margin
right: options.margin
# default to 1 inch margins
else
@margins = options.margins or DEFAULT_MARGINS
# calculate page dimensions
dimensions = if Array.isArray(@size) then @size else SIZES[@size.toUpperCase()]
@width = dimensions[if @layout is 'portrait' then 0 else 1]
@height = dimensions[if @layout is 'portrait' then 1 else 0]
@content = @document.ref()
# Initialize the Font, XObject, and ExtGState dictionaries
@resources = @document.ref
ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI']
# Lazily create these dictionaries
Object.defineProperties this,
fonts:
get: => @resources.data.Font ?= {}
xobjects:
get: => @resources.data.XObject ?= {}
ext_gstates:
get: => @resources.data.ExtGState ?= {}
patterns:
get: => @resources.data.Pattern ?= {}
color_spaces:
get: => @resources.data.ColorSpace ?= {}
annotations:
get: => @dictionary.data.Annots ?= []
# The page dictionary
@dictionary = @document.ref
Type: 'Page'
Parent: @document._root.data.Pages
MediaBox: [0, 0, @width, @height]
Contents: @content
Resources: @resources
maxY: ->
@height - @margins.bottom
write: (chunk) ->
@content.write chunk
end: ->
@dictionary.end()
@resources.end()
@content.end()
DEFAULT_MARGINS =
top: 72
left: 72
bottom: 72
right: 72
SIZES =
'4A0': [4767.87, 6740.79]
'2A0': [3370.39, 4767.87]
A0: [2383.94, 3370.39]
A1: [1683.78, 2383.94]
A2: [1190.55, 1683.78]
A3: [841.89, 1190.55]
A4: [595.28, 841.89]
A5: [419.53, 595.28]
A6: [297.64, 419.53]
A7: [209.76, 297.64]
A8: [147.40, 209.76]
A9: [104.88, 147.40]
A10: [73.70, 104.88]
B0: [2834.65, 4008.19]
B1: [2004.09, 2834.65]
B2: [1417.32, 2004.09]
B3: [1000.63, 1417.32]
B4: [708.66, 1000.63]
B5: [498.90, 708.66]
B6: [354.33, 498.90]
B7: [249.45, 354.33]
B8: [175.75, 249.45]
B9: [124.72, 175.75]
B10: [87.87, 124.72]
C0: [2599.37, 3676.54]
C1: [1836.85, 2599.37]
C2: [1298.27, 1836.85]
C3: [918.43, 1298.27]
C4: [649.13, 918.43]
C5: [459.21, 649.13]
C6: [323.15, 459.21]
C7: [229.61, 323.15]
C8: [161.57, 229.61]
C9: [113.39, 161.57]
C10: [79.37, 113.39]
RA0: [2437.80, 3458.27]
RA1: [1729.13, 2437.80]
RA2: [1218.90, 1729.13]
RA3: [864.57, 1218.90]
RA4: [609.45, 864.57]
SRA0: [2551.18, 3628.35]
SRA1: [1814.17, 2551.18]
SRA2: [1275.59, 1814.17]
SRA3: [907.09, 1275.59]
SRA4: [637.80, 907.09]
EXECUTIVE: [521.86, 756.00]
FOLIO: [612.00, 936.00]
LEGAL: [612.00, 1008.00]
LETTER: [612.00, 792.00]
TABLOID: [792.00, 1224.00]
module.exports = PDFPage | 131096 | ###
PDFPage - represents a single page in the PDF document
By <NAME>
###
class PDFPage
constructor: (@document, options = {}) ->
@size = options.size or 'letter'
@layout = options.layout or 'portrait'
# process margins
if typeof options.margin is 'number'
@margins =
top: options.margin
left: options.margin
bottom: options.margin
right: options.margin
# default to 1 inch margins
else
@margins = options.margins or DEFAULT_MARGINS
# calculate page dimensions
dimensions = if Array.isArray(@size) then @size else SIZES[@size.toUpperCase()]
@width = dimensions[if @layout is 'portrait' then 0 else 1]
@height = dimensions[if @layout is 'portrait' then 1 else 0]
@content = @document.ref()
# Initialize the Font, XObject, and ExtGState dictionaries
@resources = @document.ref
ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI']
# Lazily create these dictionaries
Object.defineProperties this,
fonts:
get: => @resources.data.Font ?= {}
xobjects:
get: => @resources.data.XObject ?= {}
ext_gstates:
get: => @resources.data.ExtGState ?= {}
patterns:
get: => @resources.data.Pattern ?= {}
color_spaces:
get: => @resources.data.ColorSpace ?= {}
annotations:
get: => @dictionary.data.Annots ?= []
# The page dictionary
@dictionary = @document.ref
Type: 'Page'
Parent: @document._root.data.Pages
MediaBox: [0, 0, @width, @height]
Contents: @content
Resources: @resources
maxY: ->
@height - @margins.bottom
write: (chunk) ->
@content.write chunk
end: ->
@dictionary.end()
@resources.end()
@content.end()
DEFAULT_MARGINS =
top: 72
left: 72
bottom: 72
right: 72
SIZES =
'4A0': [4767.87, 6740.79]
'2A0': [3370.39, 4767.87]
A0: [2383.94, 3370.39]
A1: [1683.78, 2383.94]
A2: [1190.55, 1683.78]
A3: [841.89, 1190.55]
A4: [595.28, 841.89]
A5: [419.53, 595.28]
A6: [297.64, 419.53]
A7: [209.76, 297.64]
A8: [147.40, 209.76]
A9: [104.88, 147.40]
A10: [73.70, 104.88]
B0: [2834.65, 4008.19]
B1: [2004.09, 2834.65]
B2: [1417.32, 2004.09]
B3: [1000.63, 1417.32]
B4: [708.66, 1000.63]
B5: [498.90, 708.66]
B6: [354.33, 498.90]
B7: [249.45, 354.33]
B8: [175.75, 249.45]
B9: [124.72, 175.75]
B10: [87.87, 124.72]
C0: [2599.37, 3676.54]
C1: [1836.85, 2599.37]
C2: [1298.27, 1836.85]
C3: [918.43, 1298.27]
C4: [649.13, 918.43]
C5: [459.21, 649.13]
C6: [323.15, 459.21]
C7: [229.61, 323.15]
C8: [161.57, 229.61]
C9: [113.39, 161.57]
C10: [79.37, 113.39]
RA0: [2437.80, 3458.27]
RA1: [1729.13, 2437.80]
RA2: [1218.90, 1729.13]
RA3: [864.57, 1218.90]
RA4: [609.45, 864.57]
SRA0: [2551.18, 3628.35]
SRA1: [1814.17, 2551.18]
SRA2: [1275.59, 1814.17]
SRA3: [907.09, 1275.59]
SRA4: [637.80, 907.09]
EXECUTIVE: [521.86, 756.00]
FOLIO: [612.00, 936.00]
LEGAL: [612.00, 1008.00]
LETTER: [612.00, 792.00]
TABLOID: [792.00, 1224.00]
module.exports = PDFPage | true | ###
PDFPage - represents a single page in the PDF document
By PI:NAME:<NAME>END_PI
###
class PDFPage
constructor: (@document, options = {}) ->
@size = options.size or 'letter'
@layout = options.layout or 'portrait'
# process margins
if typeof options.margin is 'number'
@margins =
top: options.margin
left: options.margin
bottom: options.margin
right: options.margin
# default to 1 inch margins
else
@margins = options.margins or DEFAULT_MARGINS
# calculate page dimensions
dimensions = if Array.isArray(@size) then @size else SIZES[@size.toUpperCase()]
@width = dimensions[if @layout is 'portrait' then 0 else 1]
@height = dimensions[if @layout is 'portrait' then 1 else 0]
@content = @document.ref()
# Initialize the Font, XObject, and ExtGState dictionaries
@resources = @document.ref
ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI']
# Lazily create these dictionaries
Object.defineProperties this,
fonts:
get: => @resources.data.Font ?= {}
xobjects:
get: => @resources.data.XObject ?= {}
ext_gstates:
get: => @resources.data.ExtGState ?= {}
patterns:
get: => @resources.data.Pattern ?= {}
color_spaces:
get: => @resources.data.ColorSpace ?= {}
annotations:
get: => @dictionary.data.Annots ?= []
# The page dictionary
@dictionary = @document.ref
Type: 'Page'
Parent: @document._root.data.Pages
MediaBox: [0, 0, @width, @height]
Contents: @content
Resources: @resources
maxY: ->
@height - @margins.bottom
write: (chunk) ->
@content.write chunk
end: ->
@dictionary.end()
@resources.end()
@content.end()
DEFAULT_MARGINS =
top: 72
left: 72
bottom: 72
right: 72
SIZES =
'4A0': [4767.87, 6740.79]
'2A0': [3370.39, 4767.87]
A0: [2383.94, 3370.39]
A1: [1683.78, 2383.94]
A2: [1190.55, 1683.78]
A3: [841.89, 1190.55]
A4: [595.28, 841.89]
A5: [419.53, 595.28]
A6: [297.64, 419.53]
A7: [209.76, 297.64]
A8: [147.40, 209.76]
A9: [104.88, 147.40]
A10: [73.70, 104.88]
B0: [2834.65, 4008.19]
B1: [2004.09, 2834.65]
B2: [1417.32, 2004.09]
B3: [1000.63, 1417.32]
B4: [708.66, 1000.63]
B5: [498.90, 708.66]
B6: [354.33, 498.90]
B7: [249.45, 354.33]
B8: [175.75, 249.45]
B9: [124.72, 175.75]
B10: [87.87, 124.72]
C0: [2599.37, 3676.54]
C1: [1836.85, 2599.37]
C2: [1298.27, 1836.85]
C3: [918.43, 1298.27]
C4: [649.13, 918.43]
C5: [459.21, 649.13]
C6: [323.15, 459.21]
C7: [229.61, 323.15]
C8: [161.57, 229.61]
C9: [113.39, 161.57]
C10: [79.37, 113.39]
RA0: [2437.80, 3458.27]
RA1: [1729.13, 2437.80]
RA2: [1218.90, 1729.13]
RA3: [864.57, 1218.90]
RA4: [609.45, 864.57]
SRA0: [2551.18, 3628.35]
SRA1: [1814.17, 2551.18]
SRA2: [1275.59, 1814.17]
SRA3: [907.09, 1275.59]
SRA4: [637.80, 907.09]
EXECUTIVE: [521.86, 756.00]
FOLIO: [612.00, 936.00]
LEGAL: [612.00, 1008.00]
LETTER: [612.00, 792.00]
TABLOID: [792.00, 1224.00]
module.exports = PDFPage |
[
{
"context": "\t\tdatestr=(new Date()).getTime()\n\t\t\t\tnew_file_key=czoneid+\"_\"+datestr+\"_\"+oldfile.name\n\t\t\t\tnewfile=\n\t\t\t\t\tname",
"end": 1916,
"score": 0.8932685852050781,
"start": 1907,
"tag": "KEY",
"value": "czoneid+\""
},
{
"context": "ate()).getTime()\n\t\t\t\t... | server/methods/kimaFilesMethods.coffee | sawima/kimashare | 0 | Meteor.methods
'create_new_folder':(new_dir)->
new_dir=_.extend(new_dir,{isRemoved:false})
acestors=new_dir.acestors
acestors_arr=_.pluck(acestors,'name')
acestors_arr.push(new_dir.name)
dirPath=acestors_arr.join('/')
Meteor.call "createNewPhysicalFolder",dirPath
KimaFiles.insert new_dir
'removekimafile':(file_ids)->
KimaFiles.update({_id:{$in:file_ids}},{$set:{isRemoved:true}},{multi:true})
'restoreRemovedFile':(file_id,current_folder_id)->
target_file=KimaFiles.findOne(file_id)
existNames=Meteor.call 'getParentChildrenNames',current_folder_id
newname=""
if not target_file.isDir
newname=Meteor.call 'checkDumplicateFileName',existNames,target_file.name,target_file.name,0
else
newname=Meteor.call 'checkDumplicateFolderName',existNames,target_file.name,target_file.name,0
KimaFiles.update({_id:target_file._id},{$set:{name:newname,isRemoved:false}})
'permanentlyDeleteKimaFile':(file_id)->
target=KimaFiles.findOne(file_id)
attach_id=target.file_id
target_type=target.isDir
if not target_type
KimaFiles.remove file_id
#todo remove file first then remove file record
filepath=KimaAttachments.findOne(attach_id).path
Meteor.call 'removeFileFromStorage',filepath
KimaAttachments.remove attach_id
else
Meteor.call 'folderIterationDelete',file_id
'copyToKimaFiles':(file_ids,target_folder_id,target_folder_name,czoneid,isroot)->
copyfilescollection=KimaFiles.find({_id:{$in:file_ids}})
parent=
_id:target_folder_id
name:target_folder_name
targetfolder_acestors=new Array()
if not isroot
targetfolder_acestors=KimaFiles.findOne(target_folder_id).acestors
targetfolder_acestors.push parent
full_path=_.pluck(targetfolder_acestors,'name').join('/')
copyfilescollection.forEach (fc) ->
if not fc.isDir
oldfile=KimaAttachments.findOne(fc.file_id)
datestr=(new Date()).getTime()
new_file_key=czoneid+"_"+datestr+"_"+oldfile.name
newfile=
name:oldfile.name
type:oldfile.type
size:oldfile.size
createdAt:new Date()
key:new_file_key
path:full_path+"/"+new_file_key
folderpath:full_path
metadata:{
owner:Meteor.userId()
}
Meteor.call 'copyFile',oldfile.path,newfile.path,full_path
newfile_id=KimaAttachments.insert(newfile)
newfilerecord=
name:oldfile.name
file_id:newfile_id
size:oldfile.size
type:oldfile.type
updatedAt:new Date()
acestors:targetfolder_acestors
parent:
_id:target_folder_id
name:target_folder_name
isRemoved:false
czone_id:czoneid
# KimaFiles.insert newfilerecord
Meteor.call 'insertFileWithNameCheck',newfilerecord
else
Meteor.call 'folderIterationCopy',fc._id,target_folder_id,target_folder_name,isroot,czoneid
'moveToKimaFiles':(file_ids,target_folder_id,target_folder_name,czoneid,isroot)->
new_parent=
_id:target_folder_id
name:target_folder_name
targetfolder_acestors=new Array()
if not isroot
targetfolder_acestors=KimaFiles.findOne(target_folder_id).acestors
targetfolder_acestors.push new_parent
acestors_name_path=_.pluck(targetfolder_acestors,'name')
target_path=acestors_name_path.join('/')
#KimaFiles.update({_id:{$in:file_ids}},{$set:{acestors:target_acestors,parent:new_parent}},{multi:true})
tryMovedFiles=KimaFiles.find({_id:{$in:file_ids}})
existNames=Meteor.call 'getParentChildrenNames',target_folder_id
tryMovedFiles.forEach (file) ->
newname=""
if not file.isDir
newname=Meteor.call 'checkDumplicateFileName',existNames,file.name,file.name,0
#todo: move file to target folder
attach=KimaAttachments.findOne(file.file_id)
source_path=attach.path
source_key=attach.key
update_path=target_path+'/'+source_key
update_folderpath=target_path
Meteor.call 'moveFile',source_path,update_path,target_path
KimaAttachments.update({_id:file.file_id},{$set:{path:update_path,folderpath:update_folderpath}})
KimaFiles.update({_id:file._id},{$set:{acestors:targetfolder_acestors,parent:new_parent,name:newname}})
else
newname=Meteor.call 'checkDumplicateFolderName',existNames,file.name,file.name,0
Meteor.call 'createNewPhysicalFolder',target_path+'/'+newname
Meteor.call 'folderIterationMove',file._id,target_folder_id,target_folder_name,isroot,czoneid
# 'renameKimaFiles':(file_id,new_file_name,czoneid)->
# # current_file_info=KimaFiles.findOne(file_id)
# # target_acestors=current_file_info.acestors
# # parent=current_file_info.parent
# # if not current_file_info.isDir
# # oldfile=KimaAttachments.findOne(current_file_info.file_id)
# # datestr=(new Date()).getTime()
# # newfile=
# # name:oldfile.name
# # type:oldfile.type
# # size:oldfile.size
# # createdAt:new Date()
# # key:czoneid+"_"+datestr+"_"+oldfile.key
# # path:full_path+"/"+oldfile.key
# # folderpath:full_path
# # metadata:{
# # owner:Meteor.userId()
# # }
# # Meteor.call 'copyFile',oldfile.path,newfile.path
# # newfile_id=KimaAttachments.insert(newfile)
# # newfilerecord=
# # name:new_file_name
# # file_id:newfile_id
# # size:newfile.size
# # type:newfile.type
# # updateAt:new Date()
# # acestors:target_acestors
# # parent:parent
# # isRemoved:false
# # czone_id:czoneid
# # # KimaFiles.insert newfilerecord
# # KimaFiles.update({_id:file_id},{$set:{isRemoved:true}})
# # Meteor.call 'insertFileWithNameCheck',newfilerecord
# # else
# current_file_info=KimaFiles.findOne(file_id)
# target_acestors=current_file_info.acestors
# parent=current_file_info.parent
# full_path=_.pluck(target_acestors,'name').join('/')
# if not current_file_info.isDir
# KimaFiles.update({_id:file_id}, {$set:{name:new_file_name}})
# else
# old_folder_path=full_path+'/'+current_file_info.name
# new_folder_path=full_path+'/'+new_file_name
# Meteor.call 'dirRename',old_folder_path,new_folder_path
# KimaFiles.update({_id:file_id}, {$set:{name:new_file_name}})
'folderIterationDelete':(folder_id)->
target_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
children.forEach (child) ->
if not child.isDir
filepath=KimaAttachments.findOne(child.file_id).path
Meteor.call 'removeFileFromStorage',filepath
KimaAttachments.remove child.file_id
KimaFiles.remove(child._id)
else
Meteor.call 'folderIterationDelete',child._id
folder_acestors=target_folder.acestors
path_array=_.pluck(folder_acestors,'name')
path_array.push(target_folder.name)
fullpath=path_array.join('/')
Meteor.call "removeEmptyFolder",fullpath
KimaFiles.remove target_folder._id
'folderIterationCopy':(folder_id,target_pos_id,target_pos_name,isroot,czoneid)->
origin_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
existNames=Meteor.call 'getParentChildrenNames',target_pos_id
newname=Meteor.call 'checkDumplicateFolderName',existNames,origin_folder.name,origin_folder.name,0
target_parent=
_id:target_pos_id
name:target_pos_name
target_parent_acestors=new Array()
if not isroot
target_parent_acestors=KimaFiles.findOne(target_pos_id).acestors
target_parent_acestors.push target_parent
full_path=_.pluck(target_parent_acestors,'name').join('/')
delete origin_folder._id
origin_folder.parent=target_parent
origin_folder.acestors=target_parent_acestors
new_folder_name=newname
Meteor.call 'createNewPhysicalFolder',full_path+'/'+newname
new_folder_id=Meteor.call 'insertFolderWithNameCheck',origin_folder
children.forEach (child) ->
fake_ids=new Array()
fake_ids.push child._id
Meteor.call 'copyToKimaFiles',fake_ids,new_folder_id,new_folder_name,czoneid
'folderIterationMove':(folder_id,target_pos_id,target_pos_name,isroot,czoneid)->
origin_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
current_folder_acestors=_.pluck(origin_folder.acestors,'name')
current_folder_acestors.push(origin_folder.name)
current_folder_path=current_folder_acestors.join('/')
target_parent=
_id:target_pos_id
name:target_pos_name
target_parent_acestors=new Array()
if not isroot
target_parent_acestors=KimaFiles.findOne(target_pos_id).acestors
target_parent_acestors.push target_parent
old_folder_id=origin_folder._id
delete origin_folder._id
origin_folder.parent=target_parent
origin_folder.acestors=target_parent_acestors
new_folder_name=origin_folder.name
# new_folder_id = KimaFiles.insert origin_folder
new_folder_id=Meteor.call 'insertFolderWithNameCheck',origin_folder
KimaFiles.remove(old_folder_id)
children.forEach (child) ->
fake_ids=new Array()
fake_ids.push child._id
Meteor.call 'moveToKimaFiles',fake_ids,new_folder_id,new_folder_name,czoneid
'checkDumplicateFolderName':(existNames,folder_name,new_folder_name,sufix)->
sufix++
if _.indexOf(existNames,new_folder_name)!=-1
new_folder_name=folder_name+"("+sufix+")"
Meteor.call 'checkDumplicateFolderName',existNames,folder_name,new_folder_name,sufix
else
return new_folder_name
'checkDumplicateFileName':(existNames,file_name,new_file_name,sufix)->
sufix++
if _.indexOf(existNames,new_file_name)!=-1
pos=file_name.lastIndexOf('.')
if pos!=-1
extension=file_name.substr(pos)
new_file_name=file_name.substr(0,pos)+"("+sufix+")"+extension
Meteor.call 'checkDumplicateFileName',existNames,file_name,new_file_name,sufix
else
new_file_name=file_name+"("+sufix+")"
Meteor.call 'checkDumplicateFileName',existNames,file_name,new_file_name,sufix
else
return new_file_name
'getParentChildrenNames':(parent_id)->
existNames=new Array()
all_files_under=KimaFiles.find({"parent._id":parent_id,isRemoved:false}).fetch()
existNames=_.pluck(all_files_under,'name')
return existNames
#correct the dumplicated name before insert new file into the KimaFile collection
'insertFileWithNameCheck':(newfile)->
filename=newfile.name
parent_id=newfile.parent._id
existNames=Meteor.call 'getParentChildrenNames',parent_id
new_file_name=Meteor.call 'checkDumplicateFileName',existNames,filename,filename,0
newfile.name=new_file_name
KimaFiles.insert newfile
'insertFolderWithNameCheck':(newfolder)->
foldername=newfolder.name
parent_id=newfolder.parent._id
existNames=Meteor.call 'getParentChildrenNames',parent_id
new_folder_name=Meteor.call 'checkDumplicateFolderName',existNames,foldername,foldername,0
newfolder.name=new_folder_name
return KimaFiles.insert newfolder
| 100513 | Meteor.methods
'create_new_folder':(new_dir)->
new_dir=_.extend(new_dir,{isRemoved:false})
acestors=new_dir.acestors
acestors_arr=_.pluck(acestors,'name')
acestors_arr.push(new_dir.name)
dirPath=acestors_arr.join('/')
Meteor.call "createNewPhysicalFolder",dirPath
KimaFiles.insert new_dir
'removekimafile':(file_ids)->
KimaFiles.update({_id:{$in:file_ids}},{$set:{isRemoved:true}},{multi:true})
'restoreRemovedFile':(file_id,current_folder_id)->
target_file=KimaFiles.findOne(file_id)
existNames=Meteor.call 'getParentChildrenNames',current_folder_id
newname=""
if not target_file.isDir
newname=Meteor.call 'checkDumplicateFileName',existNames,target_file.name,target_file.name,0
else
newname=Meteor.call 'checkDumplicateFolderName',existNames,target_file.name,target_file.name,0
KimaFiles.update({_id:target_file._id},{$set:{name:newname,isRemoved:false}})
'permanentlyDeleteKimaFile':(file_id)->
target=KimaFiles.findOne(file_id)
attach_id=target.file_id
target_type=target.isDir
if not target_type
KimaFiles.remove file_id
#todo remove file first then remove file record
filepath=KimaAttachments.findOne(attach_id).path
Meteor.call 'removeFileFromStorage',filepath
KimaAttachments.remove attach_id
else
Meteor.call 'folderIterationDelete',file_id
'copyToKimaFiles':(file_ids,target_folder_id,target_folder_name,czoneid,isroot)->
copyfilescollection=KimaFiles.find({_id:{$in:file_ids}})
parent=
_id:target_folder_id
name:target_folder_name
targetfolder_acestors=new Array()
if not isroot
targetfolder_acestors=KimaFiles.findOne(target_folder_id).acestors
targetfolder_acestors.push parent
full_path=_.pluck(targetfolder_acestors,'name').join('/')
copyfilescollection.forEach (fc) ->
if not fc.isDir
oldfile=KimaAttachments.findOne(fc.file_id)
datestr=(new Date()).getTime()
new_file_key=<KEY>_"+date<KEY>_"+oldfile.name
newfile=
name:oldfile.name
type:oldfile.type
size:oldfile.size
createdAt:new Date()
key:new_file_key
path:full_path+"/"+new_file_key
folderpath:full_path
metadata:{
owner:Meteor.userId()
}
Meteor.call 'copyFile',oldfile.path,newfile.path,full_path
newfile_id=KimaAttachments.insert(newfile)
newfilerecord=
name:oldfile.name
file_id:newfile_id
size:oldfile.size
type:oldfile.type
updatedAt:new Date()
acestors:targetfolder_acestors
parent:
_id:target_folder_id
name:target_folder_name
isRemoved:false
czone_id:czoneid
# KimaFiles.insert newfilerecord
Meteor.call 'insertFileWithNameCheck',newfilerecord
else
Meteor.call 'folderIterationCopy',fc._id,target_folder_id,target_folder_name,isroot,czoneid
'moveToKimaFiles':(file_ids,target_folder_id,target_folder_name,czoneid,isroot)->
new_parent=
_id:target_folder_id
name:target_folder_name
targetfolder_acestors=new Array()
if not isroot
targetfolder_acestors=KimaFiles.findOne(target_folder_id).acestors
targetfolder_acestors.push new_parent
acestors_name_path=_.pluck(targetfolder_acestors,'name')
target_path=acestors_name_path.join('/')
#KimaFiles.update({_id:{$in:file_ids}},{$set:{acestors:target_acestors,parent:new_parent}},{multi:true})
tryMovedFiles=KimaFiles.find({_id:{$in:file_ids}})
existNames=Meteor.call 'getParentChildrenNames',target_folder_id
tryMovedFiles.forEach (file) ->
newname=""
if not file.isDir
newname=Meteor.call 'checkDumplicateFileName',existNames,file.name,file.name,0
#todo: move file to target folder
attach=KimaAttachments.findOne(file.file_id)
source_path=attach.path
source_key=attach.key
update_path=target_path+'/'+source_key
update_folderpath=target_path
Meteor.call 'moveFile',source_path,update_path,target_path
KimaAttachments.update({_id:file.file_id},{$set:{path:update_path,folderpath:update_folderpath}})
KimaFiles.update({_id:file._id},{$set:{acestors:targetfolder_acestors,parent:new_parent,name:newname}})
else
newname=Meteor.call 'checkDumplicateFolderName',existNames,file.name,file.name,0
Meteor.call 'createNewPhysicalFolder',target_path+'/'+newname
Meteor.call 'folderIterationMove',file._id,target_folder_id,target_folder_name,isroot,czoneid
# 'renameKimaFiles':(file_id,new_file_name,czoneid)->
# # current_file_info=KimaFiles.findOne(file_id)
# # target_acestors=current_file_info.acestors
# # parent=current_file_info.parent
# # if not current_file_info.isDir
# # oldfile=KimaAttachments.findOne(current_file_info.file_id)
# # datestr=(new Date()).getTime()
# # newfile=
# # name:oldfile.name
# # type:oldfile.type
# # size:oldfile.size
# # createdAt:new Date()
# # key:c<KEY>+"_"+<KEY>+"_"+oldfile.key
# # path:full_path+"/"+oldfile.key
# # folderpath:full_path
# # metadata:{
# # owner:Meteor.userId()
# # }
# # Meteor.call 'copyFile',oldfile.path,newfile.path
# # newfile_id=KimaAttachments.insert(newfile)
# # newfilerecord=
# # name:new_file_name
# # file_id:newfile_id
# # size:newfile.size
# # type:newfile.type
# # updateAt:new Date()
# # acestors:target_acestors
# # parent:parent
# # isRemoved:false
# # czone_id:czoneid
# # # KimaFiles.insert newfilerecord
# # KimaFiles.update({_id:file_id},{$set:{isRemoved:true}})
# # Meteor.call 'insertFileWithNameCheck',newfilerecord
# # else
# current_file_info=KimaFiles.findOne(file_id)
# target_acestors=current_file_info.acestors
# parent=current_file_info.parent
# full_path=_.pluck(target_acestors,'name').join('/')
# if not current_file_info.isDir
# KimaFiles.update({_id:file_id}, {$set:{name:new_file_name}})
# else
# old_folder_path=full_path+'/'+current_file_info.name
# new_folder_path=full_path+'/'+new_file_name
# Meteor.call 'dirRename',old_folder_path,new_folder_path
# KimaFiles.update({_id:file_id}, {$set:{name:new_file_name}})
'folderIterationDelete':(folder_id)->
target_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
children.forEach (child) ->
if not child.isDir
filepath=KimaAttachments.findOne(child.file_id).path
Meteor.call 'removeFileFromStorage',filepath
KimaAttachments.remove child.file_id
KimaFiles.remove(child._id)
else
Meteor.call 'folderIterationDelete',child._id
folder_acestors=target_folder.acestors
path_array=_.pluck(folder_acestors,'name')
path_array.push(target_folder.name)
fullpath=path_array.join('/')
Meteor.call "removeEmptyFolder",fullpath
KimaFiles.remove target_folder._id
'folderIterationCopy':(folder_id,target_pos_id,target_pos_name,isroot,czoneid)->
origin_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
existNames=Meteor.call 'getParentChildrenNames',target_pos_id
newname=Meteor.call 'checkDumplicateFolderName',existNames,origin_folder.name,origin_folder.name,0
target_parent=
_id:target_pos_id
name:target_pos_name
target_parent_acestors=new Array()
if not isroot
target_parent_acestors=KimaFiles.findOne(target_pos_id).acestors
target_parent_acestors.push target_parent
full_path=_.pluck(target_parent_acestors,'name').join('/')
delete origin_folder._id
origin_folder.parent=target_parent
origin_folder.acestors=target_parent_acestors
new_folder_name=newname
Meteor.call 'createNewPhysicalFolder',full_path+'/'+newname
new_folder_id=Meteor.call 'insertFolderWithNameCheck',origin_folder
children.forEach (child) ->
fake_ids=new Array()
fake_ids.push child._id
Meteor.call 'copyToKimaFiles',fake_ids,new_folder_id,new_folder_name,czoneid
'folderIterationMove':(folder_id,target_pos_id,target_pos_name,isroot,czoneid)->
origin_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
current_folder_acestors=_.pluck(origin_folder.acestors,'name')
current_folder_acestors.push(origin_folder.name)
current_folder_path=current_folder_acestors.join('/')
target_parent=
_id:target_pos_id
name:target_pos_name
target_parent_acestors=new Array()
if not isroot
target_parent_acestors=KimaFiles.findOne(target_pos_id).acestors
target_parent_acestors.push target_parent
old_folder_id=origin_folder._id
delete origin_folder._id
origin_folder.parent=target_parent
origin_folder.acestors=target_parent_acestors
new_folder_name=origin_folder.name
# new_folder_id = KimaFiles.insert origin_folder
new_folder_id=Meteor.call 'insertFolderWithNameCheck',origin_folder
KimaFiles.remove(old_folder_id)
children.forEach (child) ->
fake_ids=new Array()
fake_ids.push child._id
Meteor.call 'moveToKimaFiles',fake_ids,new_folder_id,new_folder_name,czoneid
'checkDumplicateFolderName':(existNames,folder_name,new_folder_name,sufix)->
sufix++
if _.indexOf(existNames,new_folder_name)!=-1
new_folder_name=folder_name+"("+sufix+")"
Meteor.call 'checkDumplicateFolderName',existNames,folder_name,new_folder_name,sufix
else
return new_folder_name
'checkDumplicateFileName':(existNames,file_name,new_file_name,sufix)->
sufix++
if _.indexOf(existNames,new_file_name)!=-1
pos=file_name.lastIndexOf('.')
if pos!=-1
extension=file_name.substr(pos)
new_file_name=file_name.substr(0,pos)+"("+sufix+")"+extension
Meteor.call 'checkDumplicateFileName',existNames,file_name,new_file_name,sufix
else
new_file_name=file_name+"("+sufix+")"
Meteor.call 'checkDumplicateFileName',existNames,file_name,new_file_name,sufix
else
return new_file_name
'getParentChildrenNames':(parent_id)->
existNames=new Array()
all_files_under=KimaFiles.find({"parent._id":parent_id,isRemoved:false}).fetch()
existNames=_.pluck(all_files_under,'name')
return existNames
#correct the dumplicated name before insert new file into the KimaFile collection
'insertFileWithNameCheck':(newfile)->
filename=newfile.name
parent_id=newfile.parent._id
existNames=Meteor.call 'getParentChildrenNames',parent_id
new_file_name=Meteor.call 'checkDumplicateFileName',existNames,filename,filename,0
newfile.name=new_file_name
KimaFiles.insert newfile
'insertFolderWithNameCheck':(newfolder)->
foldername=newfolder.name
parent_id=newfolder.parent._id
existNames=Meteor.call 'getParentChildrenNames',parent_id
new_folder_name=Meteor.call 'checkDumplicateFolderName',existNames,foldername,foldername,0
newfolder.name=new_folder_name
return KimaFiles.insert newfolder
| true | Meteor.methods
'create_new_folder':(new_dir)->
new_dir=_.extend(new_dir,{isRemoved:false})
acestors=new_dir.acestors
acestors_arr=_.pluck(acestors,'name')
acestors_arr.push(new_dir.name)
dirPath=acestors_arr.join('/')
Meteor.call "createNewPhysicalFolder",dirPath
KimaFiles.insert new_dir
'removekimafile':(file_ids)->
KimaFiles.update({_id:{$in:file_ids}},{$set:{isRemoved:true}},{multi:true})
'restoreRemovedFile':(file_id,current_folder_id)->
target_file=KimaFiles.findOne(file_id)
existNames=Meteor.call 'getParentChildrenNames',current_folder_id
newname=""
if not target_file.isDir
newname=Meteor.call 'checkDumplicateFileName',existNames,target_file.name,target_file.name,0
else
newname=Meteor.call 'checkDumplicateFolderName',existNames,target_file.name,target_file.name,0
KimaFiles.update({_id:target_file._id},{$set:{name:newname,isRemoved:false}})
'permanentlyDeleteKimaFile':(file_id)->
target=KimaFiles.findOne(file_id)
attach_id=target.file_id
target_type=target.isDir
if not target_type
KimaFiles.remove file_id
#todo remove file first then remove file record
filepath=KimaAttachments.findOne(attach_id).path
Meteor.call 'removeFileFromStorage',filepath
KimaAttachments.remove attach_id
else
Meteor.call 'folderIterationDelete',file_id
'copyToKimaFiles':(file_ids,target_folder_id,target_folder_name,czoneid,isroot)->
copyfilescollection=KimaFiles.find({_id:{$in:file_ids}})
parent=
_id:target_folder_id
name:target_folder_name
targetfolder_acestors=new Array()
if not isroot
targetfolder_acestors=KimaFiles.findOne(target_folder_id).acestors
targetfolder_acestors.push parent
full_path=_.pluck(targetfolder_acestors,'name').join('/')
copyfilescollection.forEach (fc) ->
if not fc.isDir
oldfile=KimaAttachments.findOne(fc.file_id)
datestr=(new Date()).getTime()
new_file_key=PI:KEY:<KEY>END_PI_"+datePI:KEY:<KEY>END_PI_"+oldfile.name
newfile=
name:oldfile.name
type:oldfile.type
size:oldfile.size
createdAt:new Date()
key:new_file_key
path:full_path+"/"+new_file_key
folderpath:full_path
metadata:{
owner:Meteor.userId()
}
Meteor.call 'copyFile',oldfile.path,newfile.path,full_path
newfile_id=KimaAttachments.insert(newfile)
newfilerecord=
name:oldfile.name
file_id:newfile_id
size:oldfile.size
type:oldfile.type
updatedAt:new Date()
acestors:targetfolder_acestors
parent:
_id:target_folder_id
name:target_folder_name
isRemoved:false
czone_id:czoneid
# KimaFiles.insert newfilerecord
Meteor.call 'insertFileWithNameCheck',newfilerecord
else
Meteor.call 'folderIterationCopy',fc._id,target_folder_id,target_folder_name,isroot,czoneid
'moveToKimaFiles':(file_ids,target_folder_id,target_folder_name,czoneid,isroot)->
new_parent=
_id:target_folder_id
name:target_folder_name
targetfolder_acestors=new Array()
if not isroot
targetfolder_acestors=KimaFiles.findOne(target_folder_id).acestors
targetfolder_acestors.push new_parent
acestors_name_path=_.pluck(targetfolder_acestors,'name')
target_path=acestors_name_path.join('/')
#KimaFiles.update({_id:{$in:file_ids}},{$set:{acestors:target_acestors,parent:new_parent}},{multi:true})
tryMovedFiles=KimaFiles.find({_id:{$in:file_ids}})
existNames=Meteor.call 'getParentChildrenNames',target_folder_id
tryMovedFiles.forEach (file) ->
newname=""
if not file.isDir
newname=Meteor.call 'checkDumplicateFileName',existNames,file.name,file.name,0
#todo: move file to target folder
attach=KimaAttachments.findOne(file.file_id)
source_path=attach.path
source_key=attach.key
update_path=target_path+'/'+source_key
update_folderpath=target_path
Meteor.call 'moveFile',source_path,update_path,target_path
KimaAttachments.update({_id:file.file_id},{$set:{path:update_path,folderpath:update_folderpath}})
KimaFiles.update({_id:file._id},{$set:{acestors:targetfolder_acestors,parent:new_parent,name:newname}})
else
newname=Meteor.call 'checkDumplicateFolderName',existNames,file.name,file.name,0
Meteor.call 'createNewPhysicalFolder',target_path+'/'+newname
Meteor.call 'folderIterationMove',file._id,target_folder_id,target_folder_name,isroot,czoneid
# 'renameKimaFiles':(file_id,new_file_name,czoneid)->
# # current_file_info=KimaFiles.findOne(file_id)
# # target_acestors=current_file_info.acestors
# # parent=current_file_info.parent
# # if not current_file_info.isDir
# # oldfile=KimaAttachments.findOne(current_file_info.file_id)
# # datestr=(new Date()).getTime()
# # newfile=
# # name:oldfile.name
# # type:oldfile.type
# # size:oldfile.size
# # createdAt:new Date()
# # key:cPI:KEY:<KEY>END_PI+"_"+PI:KEY:<KEY>END_PI+"_"+oldfile.key
# # path:full_path+"/"+oldfile.key
# # folderpath:full_path
# # metadata:{
# # owner:Meteor.userId()
# # }
# # Meteor.call 'copyFile',oldfile.path,newfile.path
# # newfile_id=KimaAttachments.insert(newfile)
# # newfilerecord=
# # name:new_file_name
# # file_id:newfile_id
# # size:newfile.size
# # type:newfile.type
# # updateAt:new Date()
# # acestors:target_acestors
# # parent:parent
# # isRemoved:false
# # czone_id:czoneid
# # # KimaFiles.insert newfilerecord
# # KimaFiles.update({_id:file_id},{$set:{isRemoved:true}})
# # Meteor.call 'insertFileWithNameCheck',newfilerecord
# # else
# current_file_info=KimaFiles.findOne(file_id)
# target_acestors=current_file_info.acestors
# parent=current_file_info.parent
# full_path=_.pluck(target_acestors,'name').join('/')
# if not current_file_info.isDir
# KimaFiles.update({_id:file_id}, {$set:{name:new_file_name}})
# else
# old_folder_path=full_path+'/'+current_file_info.name
# new_folder_path=full_path+'/'+new_file_name
# Meteor.call 'dirRename',old_folder_path,new_folder_path
# KimaFiles.update({_id:file_id}, {$set:{name:new_file_name}})
'folderIterationDelete':(folder_id)->
target_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
children.forEach (child) ->
if not child.isDir
filepath=KimaAttachments.findOne(child.file_id).path
Meteor.call 'removeFileFromStorage',filepath
KimaAttachments.remove child.file_id
KimaFiles.remove(child._id)
else
Meteor.call 'folderIterationDelete',child._id
folder_acestors=target_folder.acestors
path_array=_.pluck(folder_acestors,'name')
path_array.push(target_folder.name)
fullpath=path_array.join('/')
Meteor.call "removeEmptyFolder",fullpath
KimaFiles.remove target_folder._id
'folderIterationCopy':(folder_id,target_pos_id,target_pos_name,isroot,czoneid)->
origin_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
existNames=Meteor.call 'getParentChildrenNames',target_pos_id
newname=Meteor.call 'checkDumplicateFolderName',existNames,origin_folder.name,origin_folder.name,0
target_parent=
_id:target_pos_id
name:target_pos_name
target_parent_acestors=new Array()
if not isroot
target_parent_acestors=KimaFiles.findOne(target_pos_id).acestors
target_parent_acestors.push target_parent
full_path=_.pluck(target_parent_acestors,'name').join('/')
delete origin_folder._id
origin_folder.parent=target_parent
origin_folder.acestors=target_parent_acestors
new_folder_name=newname
Meteor.call 'createNewPhysicalFolder',full_path+'/'+newname
new_folder_id=Meteor.call 'insertFolderWithNameCheck',origin_folder
children.forEach (child) ->
fake_ids=new Array()
fake_ids.push child._id
Meteor.call 'copyToKimaFiles',fake_ids,new_folder_id,new_folder_name,czoneid
'folderIterationMove':(folder_id,target_pos_id,target_pos_name,isroot,czoneid)->
origin_folder=KimaFiles.findOne(folder_id)
children=KimaFiles.find({'parent._id':folder_id})
current_folder_acestors=_.pluck(origin_folder.acestors,'name')
current_folder_acestors.push(origin_folder.name)
current_folder_path=current_folder_acestors.join('/')
target_parent=
_id:target_pos_id
name:target_pos_name
target_parent_acestors=new Array()
if not isroot
target_parent_acestors=KimaFiles.findOne(target_pos_id).acestors
target_parent_acestors.push target_parent
old_folder_id=origin_folder._id
delete origin_folder._id
origin_folder.parent=target_parent
origin_folder.acestors=target_parent_acestors
new_folder_name=origin_folder.name
# new_folder_id = KimaFiles.insert origin_folder
new_folder_id=Meteor.call 'insertFolderWithNameCheck',origin_folder
KimaFiles.remove(old_folder_id)
children.forEach (child) ->
fake_ids=new Array()
fake_ids.push child._id
Meteor.call 'moveToKimaFiles',fake_ids,new_folder_id,new_folder_name,czoneid
'checkDumplicateFolderName':(existNames,folder_name,new_folder_name,sufix)->
sufix++
if _.indexOf(existNames,new_folder_name)!=-1
new_folder_name=folder_name+"("+sufix+")"
Meteor.call 'checkDumplicateFolderName',existNames,folder_name,new_folder_name,sufix
else
return new_folder_name
'checkDumplicateFileName':(existNames,file_name,new_file_name,sufix)->
sufix++
if _.indexOf(existNames,new_file_name)!=-1
pos=file_name.lastIndexOf('.')
if pos!=-1
extension=file_name.substr(pos)
new_file_name=file_name.substr(0,pos)+"("+sufix+")"+extension
Meteor.call 'checkDumplicateFileName',existNames,file_name,new_file_name,sufix
else
new_file_name=file_name+"("+sufix+")"
Meteor.call 'checkDumplicateFileName',existNames,file_name,new_file_name,sufix
else
return new_file_name
'getParentChildrenNames':(parent_id)->
existNames=new Array()
all_files_under=KimaFiles.find({"parent._id":parent_id,isRemoved:false}).fetch()
existNames=_.pluck(all_files_under,'name')
return existNames
#correct the dumplicated name before insert new file into the KimaFile collection
'insertFileWithNameCheck':(newfile)->
filename=newfile.name
parent_id=newfile.parent._id
existNames=Meteor.call 'getParentChildrenNames',parent_id
new_file_name=Meteor.call 'checkDumplicateFileName',existNames,filename,filename,0
newfile.name=new_file_name
KimaFiles.insert newfile
'insertFolderWithNameCheck':(newfolder)->
foldername=newfolder.name
parent_id=newfolder.parent._id
existNames=Meteor.call 'getParentChildrenNames',parent_id
new_folder_name=Meteor.call 'checkDumplicateFolderName',existNames,foldername,foldername,0
newfolder.name=new_folder_name
return KimaFiles.insert newfolder
|
[
{
"context": "@Config =\n name: 'Portal Saúde'\n urlImg: ->\n '/img/logo3-light.png'\n title:",
"end": 31,
"score": 0.9879955649375916,
"start": 19,
"tag": "NAME",
"value": "Portal Saúde"
},
{
"context": "ue, users are forced to set a username\n username: false\n\n # Localisa... | both/config/_config.coffee | thiago-zaidem/appVilaDosBichos | 0 | @Config =
name: 'Portal Saúde'
urlImg: ->
'/img/logo3-light.png'
title: ->
TAPi18n.__ 'configTitle'
subtitle: ->
TAPi18n.__ 'configSubtitle'
logo: ->
'<b>' + @name + '</b>'
footer: ->
@name + ' - Copyright ' + new Date().getFullYear()
# Emails
emails:
from: 'no-reply@' + Meteor.absoluteUrl()
contact: 'hello' + Meteor.absoluteUrl()
# Username - if true, users are forced to set a username
username: false
# Localisation
defaultLanguage: 'pt-BR'
dateFormat: 'D/M/YYYY'
# Meta / Extenrnal content
privacyUrl: 'http://meteorfactory.io'
termsUrl: 'http://meteorfactory.io'
# For email footers
legal:
address: 'Rua Florianópolis, Nº 110 - Bairro Alto da Glória - Goiânia-GO'
name: 'Portal Saude'
url: 'http://www.portalsaude.med.br'
about: 'http://www.portalsaude.med.br/quem-somos'
#blog: 'http://learn.meteorfactory.io'
socialMedia:
facebook:
url: 'http://facebook.com/portalsaude'
icon: 'facebook'
twitter:
url: 'http://twitter.com/portalsaude'
icon: 'twitter'
###
github:
url: 'http://github.com/yogiben'
icon: 'github'
info:
url: 'http://meteorfactory.io'
icon: 'link'
###
#Routes
homeRoute: '/'
publicRoutes: ['home']
dashboardRoute: '/dashboard'
dashboardLogo: ->
'/img/logo_portal_branco.png'
#Profiles
profileDashboard: ["admin","profissional","equipe"]
defaultProfile: "profissional"
Avatar.options =
customImageProperty: 'profile.picture'
Meteor.startup ->
if Meteor.isClient
for property of Template
# check if the property is actually a blaze template
if Blaze.isTemplate(Template[property])
template = Template[property]
# assign the template an onRendered callback who simply prints the view name
template.onRendered ->
$('select').material_select();
slideHeight = $(window).height()
this.$('.section-height').css('height',slideHeight)
this.$(window).resize( ()-> $('.section-height').css('height', slideHeight))
return
TAPi18n.setLanguage('pt')
#i18n.setLanguage('pt-br')
T9n.setLanguage("pt")
moment.locale('pt-br')
globalMessages = _.clone(SimpleSchema._globalMessages)
Meteor.autorun ->
lang = TAPi18n.getLanguage()
localMessages = TAPi18n.__('simpleschema.messages', returnObjectTrees: true)
localMessages.regEx = _.map(localMessages.regEx, (item) ->
if item.exp
item.exp = eval(item.exp)
item
)
messages = _.extend(_.clone(globalMessages), localMessages)
SimpleSchema.messages messages
return | 137122 | @Config =
name: '<NAME>'
urlImg: ->
'/img/logo3-light.png'
title: ->
TAPi18n.__ 'configTitle'
subtitle: ->
TAPi18n.__ 'configSubtitle'
logo: ->
'<b>' + @name + '</b>'
footer: ->
@name + ' - Copyright ' + new Date().getFullYear()
# Emails
emails:
from: 'no-reply@' + Meteor.absoluteUrl()
contact: 'hello' + Meteor.absoluteUrl()
# Username - if true, users are forced to set a username
username: false
# Localisation
defaultLanguage: 'pt-BR'
dateFormat: 'D/M/YYYY'
# Meta / Extenrnal content
privacyUrl: 'http://meteorfactory.io'
termsUrl: 'http://meteorfactory.io'
# For email footers
legal:
address: 'Rua Florianópolis, Nº 110 - Bairro Alto da Glória - Goiânia-GO'
name: '<NAME>'
url: 'http://www.portalsaude.med.br'
about: 'http://www.portalsaude.med.br/quem-somos'
#blog: 'http://learn.meteorfactory.io'
socialMedia:
facebook:
url: 'http://facebook.com/portalsaude'
icon: 'facebook'
twitter:
url: 'http://twitter.com/portalsaude'
icon: 'twitter'
###
github:
url: 'http://github.com/yogiben'
icon: 'github'
info:
url: 'http://meteorfactory.io'
icon: 'link'
###
#Routes
homeRoute: '/'
publicRoutes: ['home']
dashboardRoute: '/dashboard'
dashboardLogo: ->
'/img/logo_portal_branco.png'
#Profiles
profileDashboard: ["admin","profissional","equipe"]
defaultProfile: "profissional"
Avatar.options =
customImageProperty: 'profile.picture'
Meteor.startup ->
if Meteor.isClient
for property of Template
# check if the property is actually a blaze template
if Blaze.isTemplate(Template[property])
template = Template[property]
# assign the template an onRendered callback who simply prints the view name
template.onRendered ->
$('select').material_select();
slideHeight = $(window).height()
this.$('.section-height').css('height',slideHeight)
this.$(window).resize( ()-> $('.section-height').css('height', slideHeight))
return
TAPi18n.setLanguage('pt')
#i18n.setLanguage('pt-br')
T9n.setLanguage("pt")
moment.locale('pt-br')
globalMessages = _.clone(SimpleSchema._globalMessages)
Meteor.autorun ->
lang = TAPi18n.getLanguage()
localMessages = TAPi18n.__('simpleschema.messages', returnObjectTrees: true)
localMessages.regEx = _.map(localMessages.regEx, (item) ->
if item.exp
item.exp = eval(item.exp)
item
)
messages = _.extend(_.clone(globalMessages), localMessages)
SimpleSchema.messages messages
return | true | @Config =
name: 'PI:NAME:<NAME>END_PI'
urlImg: ->
'/img/logo3-light.png'
title: ->
TAPi18n.__ 'configTitle'
subtitle: ->
TAPi18n.__ 'configSubtitle'
logo: ->
'<b>' + @name + '</b>'
footer: ->
@name + ' - Copyright ' + new Date().getFullYear()
# Emails
emails:
from: 'no-reply@' + Meteor.absoluteUrl()
contact: 'hello' + Meteor.absoluteUrl()
# Username - if true, users are forced to set a username
username: false
# Localisation
defaultLanguage: 'pt-BR'
dateFormat: 'D/M/YYYY'
# Meta / Extenrnal content
privacyUrl: 'http://meteorfactory.io'
termsUrl: 'http://meteorfactory.io'
# For email footers
legal:
address: 'Rua Florianópolis, Nº 110 - Bairro Alto da Glória - Goiânia-GO'
name: 'PI:NAME:<NAME>END_PI'
url: 'http://www.portalsaude.med.br'
about: 'http://www.portalsaude.med.br/quem-somos'
#blog: 'http://learn.meteorfactory.io'
socialMedia:
facebook:
url: 'http://facebook.com/portalsaude'
icon: 'facebook'
twitter:
url: 'http://twitter.com/portalsaude'
icon: 'twitter'
###
github:
url: 'http://github.com/yogiben'
icon: 'github'
info:
url: 'http://meteorfactory.io'
icon: 'link'
###
#Routes
homeRoute: '/'
publicRoutes: ['home']
dashboardRoute: '/dashboard'
dashboardLogo: ->
'/img/logo_portal_branco.png'
#Profiles
profileDashboard: ["admin","profissional","equipe"]
defaultProfile: "profissional"
Avatar.options =
customImageProperty: 'profile.picture'
Meteor.startup ->
if Meteor.isClient
for property of Template
# check if the property is actually a blaze template
if Blaze.isTemplate(Template[property])
template = Template[property]
# assign the template an onRendered callback who simply prints the view name
template.onRendered ->
$('select').material_select();
slideHeight = $(window).height()
this.$('.section-height').css('height',slideHeight)
this.$(window).resize( ()-> $('.section-height').css('height', slideHeight))
return
TAPi18n.setLanguage('pt')
#i18n.setLanguage('pt-br')
T9n.setLanguage("pt")
moment.locale('pt-br')
globalMessages = _.clone(SimpleSchema._globalMessages)
Meteor.autorun ->
lang = TAPi18n.getLanguage()
localMessages = TAPi18n.__('simpleschema.messages', returnObjectTrees: true)
localMessages.regEx = _.map(localMessages.regEx, (item) ->
if item.exp
item.exp = eval(item.exp)
item
)
messages = _.extend(_.clone(globalMessages), localMessages)
SimpleSchema.messages messages
return |
[
{
"context": "itConfig.user.name then gitConfig.user.name else \"username\"\n user.email = if gitConfig.user && gitCo",
"end": 7494,
"score": 0.998246967792511,
"start": 7486,
"tag": "USERNAME",
"value": "username"
},
{
"context": "Config.user.email then gitConfig.user.email ... | src/tower/server/generator/resources.coffee | vjsingh/tower | 1 | exec = require("child_process").exec
File = require("pathfinder").File
fs = require 'fs'
Tower.Generator.Resources =
route: (routingCode) ->
# @log "route", routingCode
@inRoot =>
if @controller.namespaced
# @todo, add namespaces and such
@injectIntoFile "config/routes.coffee", " #{routingCode}\n", after: /\.Route\.draw ->\n/, duplicate: false
else
@injectIntoFile "config/routes.coffee", " #{routingCode}\n", after: /\.Route\.draw ->\n/, duplicate: false
bootstrap: (model) ->
@inRoot =>
# bootstrap into client side
@injectIntoFile "app/client/config/application.coffee",
" @#{model.className}.load(data.#{model.namePlural}) if data.#{model.namePlural}\n", after: /bootstrap\: *\(data\) *-\> *\n/i
# bootstrap into server side
string = """
\ \ \ \ \ \ (next) => #{@app.namespace}.#{@model.className}.all (error, #{@model.namePlural}) =>
data.#{@model.namePlural} = #{@model.namePlural}
next()
"""
@injectIntoFile "app/controllers/applicationController.coffee", string, after: /_.series *\[ *\n/i
asset: (path, options = {}) ->
bundle = options.bundle || "application"
@inRoot =>
@injectIntoFile "config/assets.coffee", " \"#{path}\"\n", after: new RegExp("\\s*#{bundle}: *\\[[^\\]]+\\n", "i")
navigation: (key, path) ->
pattern = /div *class: *"nav-collapse" *, *->\s+ul *class: *"nav", *-> */
content = """\n navItem t("links.#{key}"), #{path}
"""
@inRoot =>
@injectIntoFile "app/views/shared/_navigation.coffee", content, after: pattern
locale: (pattern, content) ->
@inRoot =>
@injectIntoFile "config/locales/en.coffee", content, after: pattern
inRoot: (block) ->
@inside ".", block
generate: (type) ->
options =
program: @program
app: @app
user: @user
model: @model
view: @view
controller: @controller
destinationRoot: @destinationRoot
generator = @constructor.buildGenerator(type)
generator = new generator(options)
generator.run()
nodeModule: (name, options = {}) ->
locals: ->
model: @model
view: @view
controller: @controller
app: @app
user: @user
builtAttribute: (name, type = "string") ->
name: name
type: switch type.toLowerCase()
when "text" then "String"
else
Tower.Support.String.camelize(type)
humanName: _.humanize(name)
fieldType: switch type
when "integer" then "number"
when "float", "decimal", "string" then "string"
when "time" then "time"
when "datetime", "timestamp" then "datetime"
when "date" then "date"
when "text" then "text"
when "boolean" then "checkbox"
else
"string"
default: switch type
when "integer" then 0
when "array" then []
else
null
value: switch type
when "integer" then 0
when "array" then []
else
"A #{name}"
buildRelation: (type, className) ->
name: Tower.Support.String.camelize(className, true)
type: type
humanName: _.humanize(className)
buildModel: (name, appNamespace, argv) ->
namespaces = name.split("/")
name = namespaces.pop()
name = Tower.Support.String.camelize(name, true)
className = Tower.Support.String.camelize(name)
classNamePlural = Tower.Support.String.pluralize(className)
namespacedClassName = "#{appNamespace}.#{className}"
namePlural = Tower.Support.String.pluralize(name)
paramName = Tower.Support.String.parameterize(name)
paramNamePlural = Tower.Support.String.parameterize(namePlural)
humanName = _.titleize(className)
attributes = []
relations = []
for pair in argv
pair = pair.split(":")
continue unless pair.length > 1
key = pair[0]
type = Tower.Support.String.camelize(pair[1] || "String", true)
if key.match(/(belongsTo|hasMany|hasOne)/)
relations.push @buildRelation(key, Tower.Support.String.camelize(type))
else
attributes.push @builtAttribute(key, Tower.Support.String.camelize(type))
name: name
namespace: appNamespace
className: className
classNamePlural: classNamePlural
namespacedClassName: namespacedClassName
namePlural: namePlural
paramName: paramName
paramNamePlural: paramNamePlural
humanName: humanName
attributes: attributes
relations: relations
namespacedDirectory: namespaces.join("/")
viewDirectory: namespaces.join("/") + "/#{namePlural}"
namespaced: _.map(namespaces, (n) -> Tower.Support.String.camelize(n)).join(".")
buildApp: (name = @appName) ->
@program.namespace ||= Tower.namespace()
name: name
namespace: Tower.Support.String.camelize(@program.namespace)
paramName: Tower.Support.String.parameterize(name)
paramNamePlural: Tower.Support.String.parameterize(Tower.Support.String.pluralize(name))
session: @generateRandom("hex")
year: (new Date).getFullYear()
directory: name
buildView: (name) ->
name = _.map(name.split("/"), (n) -> Tower.Support.String.camelize(n, true)).join("/")
namespace: name
directory: Tower.Support.String.pluralize(name)
buildController: (name) ->
namespaces = name.split("/")
className = Tower.Support.String.pluralize(Tower.Support.String.camelize(namespaces[namespaces.length - 1])) + "Controller"
if namespaces.length > 1
namespaces = namespaces[0..-2]
directory = _.map(namespaces, (n) -> Tower.Support.String.camelize(n, true)).join("/")
namespace = @app.namespace + "." + _.map(namespaces, (n) -> Tower.Support.String.camelize(n)).join(".")
else
namespace = @app.namespace
directory = ""
namespace: namespace
className: className
directory: directory
name: Tower.Support.String.camelize(className, true)
namespaced: directory != ""
generateRandom: (code = "hex") ->
crypto = require('crypto')
uuid = require('node-uuid')
hash = crypto.createHash("sha1")
hash.update(uuid.v4())
hash.digest(code)
# automatically parse this stuff out from ~/.gitconfig
buildUser: (callback) ->
gitFile = "#{process.env.HOME}/.gitconfig"
gitConfig = {}
user = {}
try
if File.exists(gitFile)
lines = File.read(gitFile).split("\n")
for line in lines
if line.charAt(0) != "#" && line.match(/\S/)
if line.match(/^\[(.*)\]$/)
variable = RegExp.$1
else
line = line.split("=")
key = line[0].trim()
value = line[1].trim()
gitConfig[variable] ||= {}
gitConfig[variable][key] = value
# refactor to underscore.blank
user.name = if gitConfig.user && gitConfig.user.name then gitConfig.user.name else "username"
user.email = if gitConfig.user && gitConfig.user.email then gitConfig.user.email else "example@example.com"
user.username = if gitConfig.github && gitConfig.github.user then gitConfig.github.user else "User"
catch error
@
user.database = "mongodb"
callback(user) if callback
user
module.exports = Tower.Generator.Resources
| 103578 | exec = require("child_process").exec
File = require("pathfinder").File
fs = require 'fs'
Tower.Generator.Resources =
route: (routingCode) ->
# @log "route", routingCode
@inRoot =>
if @controller.namespaced
# @todo, add namespaces and such
@injectIntoFile "config/routes.coffee", " #{routingCode}\n", after: /\.Route\.draw ->\n/, duplicate: false
else
@injectIntoFile "config/routes.coffee", " #{routingCode}\n", after: /\.Route\.draw ->\n/, duplicate: false
bootstrap: (model) ->
@inRoot =>
# bootstrap into client side
@injectIntoFile "app/client/config/application.coffee",
" @#{model.className}.load(data.#{model.namePlural}) if data.#{model.namePlural}\n", after: /bootstrap\: *\(data\) *-\> *\n/i
# bootstrap into server side
string = """
\ \ \ \ \ \ (next) => #{@app.namespace}.#{@model.className}.all (error, #{@model.namePlural}) =>
data.#{@model.namePlural} = #{@model.namePlural}
next()
"""
@injectIntoFile "app/controllers/applicationController.coffee", string, after: /_.series *\[ *\n/i
asset: (path, options = {}) ->
bundle = options.bundle || "application"
@inRoot =>
@injectIntoFile "config/assets.coffee", " \"#{path}\"\n", after: new RegExp("\\s*#{bundle}: *\\[[^\\]]+\\n", "i")
navigation: (key, path) ->
pattern = /div *class: *"nav-collapse" *, *->\s+ul *class: *"nav", *-> */
content = """\n navItem t("links.#{key}"), #{path}
"""
@inRoot =>
@injectIntoFile "app/views/shared/_navigation.coffee", content, after: pattern
locale: (pattern, content) ->
@inRoot =>
@injectIntoFile "config/locales/en.coffee", content, after: pattern
inRoot: (block) ->
@inside ".", block
generate: (type) ->
options =
program: @program
app: @app
user: @user
model: @model
view: @view
controller: @controller
destinationRoot: @destinationRoot
generator = @constructor.buildGenerator(type)
generator = new generator(options)
generator.run()
nodeModule: (name, options = {}) ->
locals: ->
model: @model
view: @view
controller: @controller
app: @app
user: @user
builtAttribute: (name, type = "string") ->
name: name
type: switch type.toLowerCase()
when "text" then "String"
else
Tower.Support.String.camelize(type)
humanName: _.humanize(name)
fieldType: switch type
when "integer" then "number"
when "float", "decimal", "string" then "string"
when "time" then "time"
when "datetime", "timestamp" then "datetime"
when "date" then "date"
when "text" then "text"
when "boolean" then "checkbox"
else
"string"
default: switch type
when "integer" then 0
when "array" then []
else
null
value: switch type
when "integer" then 0
when "array" then []
else
"A #{name}"
buildRelation: (type, className) ->
name: Tower.Support.String.camelize(className, true)
type: type
humanName: _.humanize(className)
buildModel: (name, appNamespace, argv) ->
namespaces = name.split("/")
name = namespaces.pop()
name = Tower.Support.String.camelize(name, true)
className = Tower.Support.String.camelize(name)
classNamePlural = Tower.Support.String.pluralize(className)
namespacedClassName = "#{appNamespace}.#{className}"
namePlural = Tower.Support.String.pluralize(name)
paramName = Tower.Support.String.parameterize(name)
paramNamePlural = Tower.Support.String.parameterize(namePlural)
humanName = _.titleize(className)
attributes = []
relations = []
for pair in argv
pair = pair.split(":")
continue unless pair.length > 1
key = pair[0]
type = Tower.Support.String.camelize(pair[1] || "String", true)
if key.match(/(belongsTo|hasMany|hasOne)/)
relations.push @buildRelation(key, Tower.Support.String.camelize(type))
else
attributes.push @builtAttribute(key, Tower.Support.String.camelize(type))
name: name
namespace: appNamespace
className: className
classNamePlural: classNamePlural
namespacedClassName: namespacedClassName
namePlural: namePlural
paramName: paramName
paramNamePlural: paramNamePlural
humanName: humanName
attributes: attributes
relations: relations
namespacedDirectory: namespaces.join("/")
viewDirectory: namespaces.join("/") + "/#{namePlural}"
namespaced: _.map(namespaces, (n) -> Tower.Support.String.camelize(n)).join(".")
buildApp: (name = @appName) ->
@program.namespace ||= Tower.namespace()
name: name
namespace: Tower.Support.String.camelize(@program.namespace)
paramName: Tower.Support.String.parameterize(name)
paramNamePlural: Tower.Support.String.parameterize(Tower.Support.String.pluralize(name))
session: @generateRandom("hex")
year: (new Date).getFullYear()
directory: name
buildView: (name) ->
name = _.map(name.split("/"), (n) -> Tower.Support.String.camelize(n, true)).join("/")
namespace: name
directory: Tower.Support.String.pluralize(name)
buildController: (name) ->
namespaces = name.split("/")
className = Tower.Support.String.pluralize(Tower.Support.String.camelize(namespaces[namespaces.length - 1])) + "Controller"
if namespaces.length > 1
namespaces = namespaces[0..-2]
directory = _.map(namespaces, (n) -> Tower.Support.String.camelize(n, true)).join("/")
namespace = @app.namespace + "." + _.map(namespaces, (n) -> Tower.Support.String.camelize(n)).join(".")
else
namespace = @app.namespace
directory = ""
namespace: namespace
className: className
directory: directory
name: Tower.Support.String.camelize(className, true)
namespaced: directory != ""
generateRandom: (code = "hex") ->
crypto = require('crypto')
uuid = require('node-uuid')
hash = crypto.createHash("sha1")
hash.update(uuid.v4())
hash.digest(code)
# automatically parse this stuff out from ~/.gitconfig
buildUser: (callback) ->
gitFile = "#{process.env.HOME}/.gitconfig"
gitConfig = {}
user = {}
try
if File.exists(gitFile)
lines = File.read(gitFile).split("\n")
for line in lines
if line.charAt(0) != "#" && line.match(/\S/)
if line.match(/^\[(.*)\]$/)
variable = RegExp.$1
else
line = line.split("=")
key = line[0].trim()
value = line[1].trim()
gitConfig[variable] ||= {}
gitConfig[variable][key] = value
# refactor to underscore.blank
user.name = if gitConfig.user && gitConfig.user.name then gitConfig.user.name else "username"
user.email = if gitConfig.user && gitConfig.user.email then gitConfig.user.email else "<EMAIL>"
user.username = if gitConfig.github && gitConfig.github.user then gitConfig.github.user else "User"
catch error
@
user.database = "mongodb"
callback(user) if callback
user
module.exports = Tower.Generator.Resources
| true | exec = require("child_process").exec
File = require("pathfinder").File
fs = require 'fs'
Tower.Generator.Resources =
route: (routingCode) ->
# @log "route", routingCode
@inRoot =>
if @controller.namespaced
# @todo, add namespaces and such
@injectIntoFile "config/routes.coffee", " #{routingCode}\n", after: /\.Route\.draw ->\n/, duplicate: false
else
@injectIntoFile "config/routes.coffee", " #{routingCode}\n", after: /\.Route\.draw ->\n/, duplicate: false
bootstrap: (model) ->
@inRoot =>
# bootstrap into client side
@injectIntoFile "app/client/config/application.coffee",
" @#{model.className}.load(data.#{model.namePlural}) if data.#{model.namePlural}\n", after: /bootstrap\: *\(data\) *-\> *\n/i
# bootstrap into server side
string = """
\ \ \ \ \ \ (next) => #{@app.namespace}.#{@model.className}.all (error, #{@model.namePlural}) =>
data.#{@model.namePlural} = #{@model.namePlural}
next()
"""
@injectIntoFile "app/controllers/applicationController.coffee", string, after: /_.series *\[ *\n/i
asset: (path, options = {}) ->
bundle = options.bundle || "application"
@inRoot =>
@injectIntoFile "config/assets.coffee", " \"#{path}\"\n", after: new RegExp("\\s*#{bundle}: *\\[[^\\]]+\\n", "i")
navigation: (key, path) ->
pattern = /div *class: *"nav-collapse" *, *->\s+ul *class: *"nav", *-> */
content = """\n navItem t("links.#{key}"), #{path}
"""
@inRoot =>
@injectIntoFile "app/views/shared/_navigation.coffee", content, after: pattern
locale: (pattern, content) ->
@inRoot =>
@injectIntoFile "config/locales/en.coffee", content, after: pattern
inRoot: (block) ->
@inside ".", block
generate: (type) ->
options =
program: @program
app: @app
user: @user
model: @model
view: @view
controller: @controller
destinationRoot: @destinationRoot
generator = @constructor.buildGenerator(type)
generator = new generator(options)
generator.run()
nodeModule: (name, options = {}) ->
locals: ->
model: @model
view: @view
controller: @controller
app: @app
user: @user
builtAttribute: (name, type = "string") ->
name: name
type: switch type.toLowerCase()
when "text" then "String"
else
Tower.Support.String.camelize(type)
humanName: _.humanize(name)
fieldType: switch type
when "integer" then "number"
when "float", "decimal", "string" then "string"
when "time" then "time"
when "datetime", "timestamp" then "datetime"
when "date" then "date"
when "text" then "text"
when "boolean" then "checkbox"
else
"string"
default: switch type
when "integer" then 0
when "array" then []
else
null
value: switch type
when "integer" then 0
when "array" then []
else
"A #{name}"
buildRelation: (type, className) ->
name: Tower.Support.String.camelize(className, true)
type: type
humanName: _.humanize(className)
buildModel: (name, appNamespace, argv) ->
namespaces = name.split("/")
name = namespaces.pop()
name = Tower.Support.String.camelize(name, true)
className = Tower.Support.String.camelize(name)
classNamePlural = Tower.Support.String.pluralize(className)
namespacedClassName = "#{appNamespace}.#{className}"
namePlural = Tower.Support.String.pluralize(name)
paramName = Tower.Support.String.parameterize(name)
paramNamePlural = Tower.Support.String.parameterize(namePlural)
humanName = _.titleize(className)
attributes = []
relations = []
for pair in argv
pair = pair.split(":")
continue unless pair.length > 1
key = pair[0]
type = Tower.Support.String.camelize(pair[1] || "String", true)
if key.match(/(belongsTo|hasMany|hasOne)/)
relations.push @buildRelation(key, Tower.Support.String.camelize(type))
else
attributes.push @builtAttribute(key, Tower.Support.String.camelize(type))
name: name
namespace: appNamespace
className: className
classNamePlural: classNamePlural
namespacedClassName: namespacedClassName
namePlural: namePlural
paramName: paramName
paramNamePlural: paramNamePlural
humanName: humanName
attributes: attributes
relations: relations
namespacedDirectory: namespaces.join("/")
viewDirectory: namespaces.join("/") + "/#{namePlural}"
namespaced: _.map(namespaces, (n) -> Tower.Support.String.camelize(n)).join(".")
buildApp: (name = @appName) ->
@program.namespace ||= Tower.namespace()
name: name
namespace: Tower.Support.String.camelize(@program.namespace)
paramName: Tower.Support.String.parameterize(name)
paramNamePlural: Tower.Support.String.parameterize(Tower.Support.String.pluralize(name))
session: @generateRandom("hex")
year: (new Date).getFullYear()
directory: name
buildView: (name) ->
name = _.map(name.split("/"), (n) -> Tower.Support.String.camelize(n, true)).join("/")
namespace: name
directory: Tower.Support.String.pluralize(name)
buildController: (name) ->
namespaces = name.split("/")
className = Tower.Support.String.pluralize(Tower.Support.String.camelize(namespaces[namespaces.length - 1])) + "Controller"
if namespaces.length > 1
namespaces = namespaces[0..-2]
directory = _.map(namespaces, (n) -> Tower.Support.String.camelize(n, true)).join("/")
namespace = @app.namespace + "." + _.map(namespaces, (n) -> Tower.Support.String.camelize(n)).join(".")
else
namespace = @app.namespace
directory = ""
namespace: namespace
className: className
directory: directory
name: Tower.Support.String.camelize(className, true)
namespaced: directory != ""
generateRandom: (code = "hex") ->
crypto = require('crypto')
uuid = require('node-uuid')
hash = crypto.createHash("sha1")
hash.update(uuid.v4())
hash.digest(code)
# automatically parse this stuff out from ~/.gitconfig
buildUser: (callback) ->
gitFile = "#{process.env.HOME}/.gitconfig"
gitConfig = {}
user = {}
try
if File.exists(gitFile)
lines = File.read(gitFile).split("\n")
for line in lines
if line.charAt(0) != "#" && line.match(/\S/)
if line.match(/^\[(.*)\]$/)
variable = RegExp.$1
else
line = line.split("=")
key = line[0].trim()
value = line[1].trim()
gitConfig[variable] ||= {}
gitConfig[variable][key] = value
# refactor to underscore.blank
user.name = if gitConfig.user && gitConfig.user.name then gitConfig.user.name else "username"
user.email = if gitConfig.user && gitConfig.user.email then gitConfig.user.email else "PI:EMAIL:<EMAIL>END_PI"
user.username = if gitConfig.github && gitConfig.github.user then gitConfig.github.user else "User"
catch error
@
user.database = "mongodb"
callback(user) if callback
user
module.exports = Tower.Generator.Resources
|
[
{
"context": "mails to the person who submitted the patch, or to Nick, George, or Scott.\n watchers = (w for w in wat",
"end": 865,
"score": 0.9972600936889648,
"start": 861,
"tag": "NAME",
"value": "Nick"
},
{
"context": "to the person who submitted the patch, or to Nick, George,... | server/commons/notify.coffee | johanvl/codecombat | 2 | slack = require '../slack'
sendwithus = require '../sendwithus'
User = require '../models/User'
# TODO: Refactor notification (slack, watcher emails) logic here
module.exports =
notifyChangesMadeToDoc: (req, doc) ->
# TODO: Stop using headers to pass edit paths. Perhaps should be a method property for Mongoose models
editPath = req.headers['x-current-path']
docLink = "http://codecombat.com#{editPath}" # TODO: Dynamically generate URL with server/commons/urls.makeHostUrl
# Post a message on Slack
message = "#{req.user.get('name')} saved a change to #{doc.get('name')}: #{doc.get('commitMessage') or '(no commit message)'} #{docLink}"
slack.sendSlackMessage message, ['artisans']
# Send emails to watchers
watchers = doc.get('watchers') or []
# Don't send these emails to the person who submitted the patch, or to Nick, George, or Scott.
watchers = (w for w in watchers when not w.equals(req.user._id) and not (w.toHexString() in ['512ef4805a67a8c507000001', '5162fab9c92b4c751e000274', '51538fdb812dd9af02000001']))
if watchers.length
User.find({_id:{$in:watchers}}).select({email:1, name:1}).exec (err, watchers) ->
for watcher in watchers
continue if not watcher.get('email')
context =
email_id: sendwithus.templates.change_made_notify_watcher
recipient:
address: watcher.get('email')
name: watcher.get('name')
email_data:
doc_name: doc.get('name') or '???'
submitter_name: req.user.get('name') or '???'
doc_link: if editPath then docLink else null
commit_message: doc.get('commitMessage')
sendwithus.api.send context, _.noop
| 84744 | slack = require '../slack'
sendwithus = require '../sendwithus'
User = require '../models/User'
# TODO: Refactor notification (slack, watcher emails) logic here
module.exports =
notifyChangesMadeToDoc: (req, doc) ->
# TODO: Stop using headers to pass edit paths. Perhaps should be a method property for Mongoose models
editPath = req.headers['x-current-path']
docLink = "http://codecombat.com#{editPath}" # TODO: Dynamically generate URL with server/commons/urls.makeHostUrl
# Post a message on Slack
message = "#{req.user.get('name')} saved a change to #{doc.get('name')}: #{doc.get('commitMessage') or '(no commit message)'} #{docLink}"
slack.sendSlackMessage message, ['artisans']
# Send emails to watchers
watchers = doc.get('watchers') or []
# Don't send these emails to the person who submitted the patch, or to <NAME>, <NAME>, or <NAME>.
watchers = (w for w in watchers when not w.equals(req.user._id) and not (w.toHexString() in ['512ef4805a67a8c507000001', '5162fab9c92b4c751e000274', '51538fdb812dd9af02000001']))
if watchers.length
User.find({_id:{$in:watchers}}).select({email:1, name:1}).exec (err, watchers) ->
for watcher in watchers
continue if not watcher.get('email')
context =
email_id: sendwithus.templates.change_made_notify_watcher
recipient:
address: watcher.get('email')
name: watcher.get('name')
email_data:
doc_name: doc.get('name') or '???'
submitter_name: req.user.get('name') or '???'
doc_link: if editPath then docLink else null
commit_message: doc.get('commitMessage')
sendwithus.api.send context, _.noop
| true | slack = require '../slack'
sendwithus = require '../sendwithus'
User = require '../models/User'
# TODO: Refactor notification (slack, watcher emails) logic here
module.exports =
notifyChangesMadeToDoc: (req, doc) ->
# TODO: Stop using headers to pass edit paths. Perhaps should be a method property for Mongoose models
editPath = req.headers['x-current-path']
docLink = "http://codecombat.com#{editPath}" # TODO: Dynamically generate URL with server/commons/urls.makeHostUrl
# Post a message on Slack
message = "#{req.user.get('name')} saved a change to #{doc.get('name')}: #{doc.get('commitMessage') or '(no commit message)'} #{docLink}"
slack.sendSlackMessage message, ['artisans']
# Send emails to watchers
watchers = doc.get('watchers') or []
# Don't send these emails to the person who submitted the patch, or to PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI, or PI:NAME:<NAME>END_PI.
watchers = (w for w in watchers when not w.equals(req.user._id) and not (w.toHexString() in ['512ef4805a67a8c507000001', '5162fab9c92b4c751e000274', '51538fdb812dd9af02000001']))
if watchers.length
User.find({_id:{$in:watchers}}).select({email:1, name:1}).exec (err, watchers) ->
for watcher in watchers
continue if not watcher.get('email')
context =
email_id: sendwithus.templates.change_made_notify_watcher
recipient:
address: watcher.get('email')
name: watcher.get('name')
email_data:
doc_name: doc.get('name') or '???'
submitter_name: req.user.get('name') or '???'
doc_link: if editPath then docLink else null
commit_message: doc.get('commitMessage')
sendwithus.api.send context, _.noop
|
[
{
"context": "@fileoverview Tests for new-parens rule.\n# @author Ilya Volodin\n###\n\n'use strict'\n\n#-----------------------------",
"end": 70,
"score": 0.9997806549072266,
"start": 58,
"tag": "NAME",
"value": "Ilya Volodin"
}
] | src/tests/rules/new-parens.coffee | danielbayley/eslint-plugin-coffee | 21 | ###*
# @fileoverview Tests for new-parens rule.
# @author Ilya Volodin
###
'use strict'
#------------------------------------------------------------------------------
# Requirements
#------------------------------------------------------------------------------
rule = require 'eslint/lib/rules/new-parens'
{RuleTester} = require 'eslint'
path = require 'path'
#------------------------------------------------------------------------------
# Tests
#------------------------------------------------------------------------------
ruleTester = new RuleTester parser: path.join __dirname, '../../..'
ruleTester.run 'new-parens', rule,
valid: [
'a = new Date()'
'a = new Date(() ->)'
'a = new (Date)()'
'a = new ((Date))()'
'a = (new Date())'
'a = new foo.Bar()'
'a = (new Foo()).bar'
]
invalid: [
code: 'a = new Date'
output: 'a = new Date()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new Date'
output: 'a = new Date()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new (Date)'
output: 'a = new (Date)()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new (Date)'
output: 'a = new (Date)()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = (new Date)'
output: 'a = (new Date())'
errors: [
message: "Missing '()' invoking a constructor."
type: 'NewExpression'
]
,
# This `()` is `CallExpression`'s. This is a call of the result of `new Date`.
code: 'a = (new Date)()'
output: 'a = (new Date())()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new foo.Bar'
output: 'a = new foo.Bar()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = (new Foo).bar'
output: 'a = (new Foo()).bar'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
]
| 67947 | ###*
# @fileoverview Tests for new-parens rule.
# @author <NAME>
###
'use strict'
#------------------------------------------------------------------------------
# Requirements
#------------------------------------------------------------------------------
rule = require 'eslint/lib/rules/new-parens'
{RuleTester} = require 'eslint'
path = require 'path'
#------------------------------------------------------------------------------
# Tests
#------------------------------------------------------------------------------
ruleTester = new RuleTester parser: path.join __dirname, '../../..'
ruleTester.run 'new-parens', rule,
valid: [
'a = new Date()'
'a = new Date(() ->)'
'a = new (Date)()'
'a = new ((Date))()'
'a = (new Date())'
'a = new foo.Bar()'
'a = (new Foo()).bar'
]
invalid: [
code: 'a = new Date'
output: 'a = new Date()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new Date'
output: 'a = new Date()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new (Date)'
output: 'a = new (Date)()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new (Date)'
output: 'a = new (Date)()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = (new Date)'
output: 'a = (new Date())'
errors: [
message: "Missing '()' invoking a constructor."
type: 'NewExpression'
]
,
# This `()` is `CallExpression`'s. This is a call of the result of `new Date`.
code: 'a = (new Date)()'
output: 'a = (new Date())()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new foo.Bar'
output: 'a = new foo.Bar()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = (new Foo).bar'
output: 'a = (new Foo()).bar'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
]
| true | ###*
# @fileoverview Tests for new-parens rule.
# @author PI:NAME:<NAME>END_PI
###
'use strict'
#------------------------------------------------------------------------------
# Requirements
#------------------------------------------------------------------------------
rule = require 'eslint/lib/rules/new-parens'
{RuleTester} = require 'eslint'
path = require 'path'
#------------------------------------------------------------------------------
# Tests
#------------------------------------------------------------------------------
ruleTester = new RuleTester parser: path.join __dirname, '../../..'
ruleTester.run 'new-parens', rule,
valid: [
'a = new Date()'
'a = new Date(() ->)'
'a = new (Date)()'
'a = new ((Date))()'
'a = (new Date())'
'a = new foo.Bar()'
'a = (new Foo()).bar'
]
invalid: [
code: 'a = new Date'
output: 'a = new Date()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new Date'
output: 'a = new Date()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new (Date)'
output: 'a = new (Date)()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new (Date)'
output: 'a = new (Date)()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = (new Date)'
output: 'a = (new Date())'
errors: [
message: "Missing '()' invoking a constructor."
type: 'NewExpression'
]
,
# This `()` is `CallExpression`'s. This is a call of the result of `new Date`.
code: 'a = (new Date)()'
output: 'a = (new Date())()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = new foo.Bar'
output: 'a = new foo.Bar()'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
,
code: 'a = (new Foo).bar'
output: 'a = (new Foo()).bar'
errors: [
message: "Missing '()' invoking a constructor.", type: 'NewExpression'
]
]
|
[
{
"context": ", step) ->\n\t\t\tpath = step.path.split(\".\")\n\t\t\tkey = path.pop()\n\t\t\tsavePath = path.join(\".\")\n\t\t\tobj = deepGet( or",
"end": 3055,
"score": 0.848397433757782,
"start": 3045,
"tag": "KEY",
"value": "path.pop()"
},
{
"context": "p) ->\n\t\t\tpath = step.pa... | coffee/src/history.coffee | csidro/history-object | 1 | ###
Basic helper functions
###
###
# Checks if given value is type of something
###
isType = ( val, type ) ->
classToType =
'[object Boolean]': 'boolean'
'[object Number]': 'number'
'[object String]': 'string'
'[object Function]': 'function'
'[object Array]': 'array'
'[object Date]': 'date'
'[object RegExp]': 'regexp'
'[object Object]': 'object'
'[object Null]': 'null'
'[object Undefined]': 'undefined'
classToType[Object::toString.call(val)] is type
fixNumber = ( val ) ->
val = +val if isType( val, "number" )
return val
###
# Reads value from object through path
# @param obj {Object}
# @param path {String} - e.g. 'a.foo.1.bar'
###
deepGet = (obj, path) ->
# reversing the path to use Array::pop()
path = (path.split ".").reverse().map( fixNumber ) if not isType( path, "array" )
key = path.pop()
# if we reach the end of the path, or the current value is undefined
# return the current value
if path.length is 0 or not Object::hasOwnProperty.call(obj, key)
return obj[key]
deepGet obj[key], path
###
# Writes value to object through path
# @param obj {Object}
# @param path {String} - e.g. 'a.foo.bar'
# @param value {Mixed}
# @param create {Boolean} - whether it should build non-existent tree or not
###
deepSet = (obj, path, value, create) ->
create = true if not create? or create is undefined
# reversing the path to use Array::pop()
path = (path.split ".").reverse().map( fixNumber ) if not isType( path, "array" )
key = path.pop()
if path.length is 0
return obj[key] = value
if not Object::hasOwnProperty.call(obj, key) or obj[key] is undefined
if create is on
# if next key is number create an array, else create object
if isType( path[path.length-1], "number" )
obj[key] = []
else
obj[key] = {}
else
throw new Error("Value not set, because creation is set to false!")
console.log obj, path, value
deepSet obj[key], path, value, create
return
###
# Checks if path is in a whitelisted place
###
isInList = (path, whitelist) ->
# if whitelist is empty or not defined, instantly whitelist path
return true if not whitelist? or whitelist is undefined or whitelist.length is 0
matches = 0
for item in whitelist
# increment matches if path starts with whitelist item or vica versa
matches++ if path.indexOf( item ) isnt -1 or item.indexOf( path ) isnt -1
matches > 0
###
End of helper functions
###
undo = ( store ) ->
# return instantly if no record in forward history
return if store.__History__._backwards.length is 0
store.__History__.options.bypassRecording = on
store.__History__.options.emptyOnSet = off
# get the next step from backwards history
step = store.__History__._backwards.pop()
# set current state
switch step.type
when "delete" then ( (origin, store, step) ->
define.call( origin, store, step.path, step.value )
store.__History__._forwards.push path: step.path, value: step.value, type: "delete"
)(@, store, step)
when "add" then ( (origin, store, step) ->
path = step.path.split(".")
key = path.pop()
savePath = path.join(".")
obj = deepGet( origin, savePath )
remove.call( origin, store, obj, step.path, key )
store.__History__._forwards.push path: step.path, value: step.value, type: "add"
)(@, store, step)
when "update" then ( (origin, store, step) ->
store.__History__._forwards.push path: step.path, value: deepGet(origin, step.path), type: "update"
deepSet( origin, step.path, step.value )
)(@, store, step)
store.__History__.options.emptyOnSet = on
store.__History__.options.bypassRecording = off
return
redo = ( store ) ->
# return instantly if no record in forward history
return if store.__History__._forwards.length is 0
store.__History__.options.bypassRecording = on
store.__History__.options.emptyOnSet = off
# get the next step from forwards history
step = store.__History__._forwards.pop()
# set current state
switch step.type
when "delete" then ( (origin, store, step) ->
path = step.path.split(".")
key = path.pop()
savePath = path.join(".")
obj = deepGet( origin, savePath )
remove.call( origin, store, obj, step.path, key )
store.__History__._backwards.push path: step.path, value: step.value, type: "delete"
)(@, store, step)
when "add" then ( (origin, store, step) ->
define.call( origin, store, step.path, step.value )
store.__History__._backwards.push path: step.path, value: step.value, type: "add"
)(@, store, step)
when "update" then ( (origin, store, step) ->
store.__History__._backwards.push path: step.path, value: deepGet(origin, step.path), type: "update"
deepSet( origin, step.path, step.value )
)(@, store, step)
store.__History__.options.emptyOnSet = on
store.__History__.options.bypassRecording = off
return
define = ( store, path, value ) ->
if deepGet( @, path ) is undefined
deepSet( @, path, value, true )
store.__History__.record( path: path, value: value, type: "add" )
historyObject.config.observe( @, [path] )
return
remove = ( store, obj, path, key ) ->
store.__History__.record( path: path, value: obj[key], type: "delete" )
delete obj[key]
return
module.exports = historyObject =
config:
# where to store the history states ("self"|{Object})
store: "self"
defaultWhitelist: []
enableExtension: off
enableDeep: on
# if these features are on, all objects will be extended with the following properties
# .define(path, value), .remove(property), .observe(path), .unobserve(path)
enableDefine: on
enableRemove: on
enableObserve: on
enableUnobserve: on
class: class History
constructor: ( @origin ) ->
@_backwards = []
@_forwards = []
options:
maxLength: 100
emptyOnSet: on
bypassRecording: off
record: ( state ) ->
return if @options.bypassRecording is on
state.type = "update" if state.type is undefined
@_backwards.push( state )
# empty forward history if set
@_forwards = [] if @options.emptyOnSet is on
# remove first item in history if reached limit
@_backwards.shift() if @_backwards.length > @options.maxLength
return
observe: (obj, whitelist = historyObject.config.defaultWhitelist, extension = historyObject.config.enableExtension, deep = historyObject.config.enableDeep, origin, path) ->
origin = obj if not origin? or origin is undefined
store = origin if historyObject.config.store is "self"
store = historyObject.config.store if historyObject.config.store isnt "self" and isType( historyObject.config.store, "object" )
path = [] if not path? or path is undefined
path = path.split( "." ) if not isType( path, "array" )
savePath = path.join(".")
# extend the object with whitelist values here if extension is on
# extend only if whitelist is an array
if extension is on and isType( whitelist, "array" )
# handle every item in whitelist as paths, so we can define them with deepSet() easily
for extendPath in whitelist
do ( extendPath ) ->
# if extendPath is undefined in the object define it with null value
if deepGet( obj, extendPath ) is undefined
deepSet( obj, extendPath, null, true )
return
# turn extension off, to be sure we only try to extend once
extension = off
# end of extension
# if starting to record extend the object with a non-enumerable History object,
# which handles the overall history,
# and extend whitelisted values with the capability of undoing and redoing
# only register __History__, redo and undo, if they're not present
# using option enumerable: false is for preventing the History related properties to show in Object.keys()
# configurable set to true to keep the possibility of property deletion
# writable is set to false because we dont want users to mess with it!
if not store.hasOwnProperty( "__History__" )
Object.defineProperty store, "__History__",
enumerable: false
configurable: true
value: new historyObject.class( origin )
if not store.hasOwnProperty( "undo" )
Object.defineProperty store, "undo",
configurable: true
enumerable: false
writable: false
value: ( n ) ->
n = 1 if not isType( n, "number" )
while n--
undo.call( origin, store )
return
if not store.hasOwnProperty( "redo" )
Object.defineProperty store, "redo",
configurable: true
enumerable: false
writable: false
value: ( n ) ->
n = 1 if not isType( n, "number" )
while n--
redo.call( origin, store )
return
# register define and remove function to every object
# if property is defined through this function,
# it will also be deeply observable
# remove is saving current value before actually removing the item
if isType( obj, "object" ) or isType( obj, "array" )
if not obj.hasOwnProperty( "define" ) and historyObject.config.enableDefine is on
( (origin, store, obj, path)->
Object.defineProperty obj, "define",
configurable: true
enumerable: false
writable: false
value: ( key, value ) ->
path.push(key)
savePath = path.join(".")
path.pop()
define.call( origin, store, savePath, value )
return
)(origin, store, obj, path)
if not obj.hasOwnProperty( "remove" ) and historyObject.config.enableRemove is on
( (origin, store, obj, path)->
Object.defineProperty obj, "remove",
configurable: true
enumerable: false
writable: false
value: ( key ) ->
path.push(key)
savePath = path.join(".")
path.pop()
remove.call( origin, store, obj, savePath, key )
return
)(origin, store, obj, path)
# register observe and unobserve function to everything
# unobserve is blacklisting the given path
if not obj.hasOwnProperty( "unobserve" ) and historyObject.config.enableUnobserve is on
Object.defineProperty obj, "unobserve",
configurable: true
enumerable: false
writable: false
value: ( path ) ->
if not path? or path is undefined
historyObject.unobserve( origin, [savePath] )
else
historyObject.unobserve( obj, [path] )
return
if not obj.hasOwnProperty( "observe" ) and historyObject.config.enableObserve is on
Object.defineProperty obj, "observe",
configurable: true
enumerable: false
writable: false
value: ( path ) ->
if not path? or path is undefined
historyObject.observe( origin, [savePath] )
else
historyObject.observe( obj, [path] )
return
# default to observe everything in object
keys = Object.keys( obj )
for prop in keys
do (prop) ->
value = obj[prop]
# build up path object
path.push( prop )
# define path as String not to pass by reference
savePath = path.join(".")
# only go forward if path is in whitelisted area
if isInList( savePath, whitelist )
# observe recursively if deep observe is turned on
if value? and ( isType( value, 'object') or isType( value, 'array') ) and deep is on
historyObject.observe( value, whitelist, extension, deep, origin, savePath )
# otherwise observe object property
# if deep observe is turned off, we cant observe objects and arrays
else
# define property in self-calling function to avoid variable reference
((store, obj, prop, savePath)->
Object.defineProperty obj, prop,
enumerable: true
configurable: true
# getter remains the same
get: () ->
prop
# setter modified to save old values to __History__ before setting the new one
set: ( val ) ->
step = path: savePath, value: prop
store.__History__.record step
prop = val
# set initial value
store.__History__.options.bypassRecording = on
obj[prop] = value
store.__History__.options.bypassRecording = off
return
)(store, obj, prop, savePath)
# remove last item from path to correct for next item
path.pop()
return
return
unobserve: (obj, blacklist, path) ->
path = [] if not path? or path is undefined
path = path.split( "." ) if not isType( path, "array" )
for prop, val of obj
do (prop, val) ->
# build up path object
path.push( prop )
# define path as String not to pass by reference
savePath = path.join(".")
# continue only if path is blacklistable
if isInList( savePath, blacklist )
if val? and isType( val, "object" ) or isType( val, "array" )
historyObject.unobserve( val, blacklist, savePath )
else
# remove the history related properties
delete obj.__History__ if obj.hasOwnProperty( "__History__" )
delete obj.undo if obj.hasOwnProperty( "undo" )
delete obj.redo if obj.hasOwnProperty( "redo" )
delete obj.define if obj.hasOwnProperty( "define" )
delete obj.remove if obj.hasOwnProperty( "remove" )
delete obj.observe if obj.hasOwnProperty( "observe" )
delete obj.unobserve if obj.hasOwnProperty( "unobserve" )
# redefine property with current value
Object.defineProperty obj, prop,
writable: true
configurable: true
enumerable: true
value: val
# remove last item from path to correct for next item
path.pop()
return
return | 125277 | ###
Basic helper functions
###
###
# Checks if given value is type of something
###
isType = ( val, type ) ->
classToType =
'[object Boolean]': 'boolean'
'[object Number]': 'number'
'[object String]': 'string'
'[object Function]': 'function'
'[object Array]': 'array'
'[object Date]': 'date'
'[object RegExp]': 'regexp'
'[object Object]': 'object'
'[object Null]': 'null'
'[object Undefined]': 'undefined'
classToType[Object::toString.call(val)] is type
fixNumber = ( val ) ->
val = +val if isType( val, "number" )
return val
###
# Reads value from object through path
# @param obj {Object}
# @param path {String} - e.g. 'a.foo.1.bar'
###
deepGet = (obj, path) ->
# reversing the path to use Array::pop()
path = (path.split ".").reverse().map( fixNumber ) if not isType( path, "array" )
key = path.pop()
# if we reach the end of the path, or the current value is undefined
# return the current value
if path.length is 0 or not Object::hasOwnProperty.call(obj, key)
return obj[key]
deepGet obj[key], path
###
# Writes value to object through path
# @param obj {Object}
# @param path {String} - e.g. 'a.foo.bar'
# @param value {Mixed}
# @param create {Boolean} - whether it should build non-existent tree or not
###
deepSet = (obj, path, value, create) ->
create = true if not create? or create is undefined
# reversing the path to use Array::pop()
path = (path.split ".").reverse().map( fixNumber ) if not isType( path, "array" )
key = path.pop()
if path.length is 0
return obj[key] = value
if not Object::hasOwnProperty.call(obj, key) or obj[key] is undefined
if create is on
# if next key is number create an array, else create object
if isType( path[path.length-1], "number" )
obj[key] = []
else
obj[key] = {}
else
throw new Error("Value not set, because creation is set to false!")
console.log obj, path, value
deepSet obj[key], path, value, create
return
###
# Checks if path is in a whitelisted place
###
isInList = (path, whitelist) ->
# if whitelist is empty or not defined, instantly whitelist path
return true if not whitelist? or whitelist is undefined or whitelist.length is 0
matches = 0
for item in whitelist
# increment matches if path starts with whitelist item or vica versa
matches++ if path.indexOf( item ) isnt -1 or item.indexOf( path ) isnt -1
matches > 0
###
End of helper functions
###
undo = ( store ) ->
# return instantly if no record in forward history
return if store.__History__._backwards.length is 0
store.__History__.options.bypassRecording = on
store.__History__.options.emptyOnSet = off
# get the next step from backwards history
step = store.__History__._backwards.pop()
# set current state
switch step.type
when "delete" then ( (origin, store, step) ->
define.call( origin, store, step.path, step.value )
store.__History__._forwards.push path: step.path, value: step.value, type: "delete"
)(@, store, step)
when "add" then ( (origin, store, step) ->
path = step.path.split(".")
key = <KEY>
savePath = path.join(".")
obj = deepGet( origin, savePath )
remove.call( origin, store, obj, step.path, key )
store.__History__._forwards.push path: step.path, value: step.value, type: "add"
)(@, store, step)
when "update" then ( (origin, store, step) ->
store.__History__._forwards.push path: step.path, value: deepGet(origin, step.path), type: "update"
deepSet( origin, step.path, step.value )
)(@, store, step)
store.__History__.options.emptyOnSet = on
store.__History__.options.bypassRecording = off
return
redo = ( store ) ->
# return instantly if no record in forward history
return if store.__History__._forwards.length is 0
store.__History__.options.bypassRecording = on
store.__History__.options.emptyOnSet = off
# get the next step from forwards history
step = store.__History__._forwards.pop()
# set current state
switch step.type
when "delete" then ( (origin, store, step) ->
path = step.path.split(".")
key = path.<KEY>()
savePath = path.join(".")
obj = deepGet( origin, savePath )
remove.call( origin, store, obj, step.path, key )
store.__History__._backwards.push path: step.path, value: step.value, type: "delete"
)(@, store, step)
when "add" then ( (origin, store, step) ->
define.call( origin, store, step.path, step.value )
store.__History__._backwards.push path: step.path, value: step.value, type: "add"
)(@, store, step)
when "update" then ( (origin, store, step) ->
store.__History__._backwards.push path: step.path, value: deepGet(origin, step.path), type: "update"
deepSet( origin, step.path, step.value )
)(@, store, step)
store.__History__.options.emptyOnSet = on
store.__History__.options.bypassRecording = off
return
define = ( store, path, value ) ->
if deepGet( @, path ) is undefined
deepSet( @, path, value, true )
store.__History__.record( path: path, value: value, type: "add" )
historyObject.config.observe( @, [path] )
return
remove = ( store, obj, path, key ) ->
store.__History__.record( path: path, value: obj[key], type: "delete" )
delete obj[key]
return
module.exports = historyObject =
config:
# where to store the history states ("self"|{Object})
store: "self"
defaultWhitelist: []
enableExtension: off
enableDeep: on
# if these features are on, all objects will be extended with the following properties
# .define(path, value), .remove(property), .observe(path), .unobserve(path)
enableDefine: on
enableRemove: on
enableObserve: on
enableUnobserve: on
class: class History
constructor: ( @origin ) ->
@_backwards = []
@_forwards = []
options:
maxLength: 100
emptyOnSet: on
bypassRecording: off
record: ( state ) ->
return if @options.bypassRecording is on
state.type = "update" if state.type is undefined
@_backwards.push( state )
# empty forward history if set
@_forwards = [] if @options.emptyOnSet is on
# remove first item in history if reached limit
@_backwards.shift() if @_backwards.length > @options.maxLength
return
observe: (obj, whitelist = historyObject.config.defaultWhitelist, extension = historyObject.config.enableExtension, deep = historyObject.config.enableDeep, origin, path) ->
origin = obj if not origin? or origin is undefined
store = origin if historyObject.config.store is "self"
store = historyObject.config.store if historyObject.config.store isnt "self" and isType( historyObject.config.store, "object" )
path = [] if not path? or path is undefined
path = path.split( "." ) if not isType( path, "array" )
savePath = path.join(".")
# extend the object with whitelist values here if extension is on
# extend only if whitelist is an array
if extension is on and isType( whitelist, "array" )
# handle every item in whitelist as paths, so we can define them with deepSet() easily
for extendPath in whitelist
do ( extendPath ) ->
# if extendPath is undefined in the object define it with null value
if deepGet( obj, extendPath ) is undefined
deepSet( obj, extendPath, null, true )
return
# turn extension off, to be sure we only try to extend once
extension = off
# end of extension
# if starting to record extend the object with a non-enumerable History object,
# which handles the overall history,
# and extend whitelisted values with the capability of undoing and redoing
# only register __History__, redo and undo, if they're not present
# using option enumerable: false is for preventing the History related properties to show in Object.keys()
# configurable set to true to keep the possibility of property deletion
# writable is set to false because we dont want users to mess with it!
if not store.hasOwnProperty( "__History__" )
Object.defineProperty store, "__History__",
enumerable: false
configurable: true
value: new historyObject.class( origin )
if not store.hasOwnProperty( "undo" )
Object.defineProperty store, "undo",
configurable: true
enumerable: false
writable: false
value: ( n ) ->
n = 1 if not isType( n, "number" )
while n--
undo.call( origin, store )
return
if not store.hasOwnProperty( "redo" )
Object.defineProperty store, "redo",
configurable: true
enumerable: false
writable: false
value: ( n ) ->
n = 1 if not isType( n, "number" )
while n--
redo.call( origin, store )
return
# register define and remove function to every object
# if property is defined through this function,
# it will also be deeply observable
# remove is saving current value before actually removing the item
if isType( obj, "object" ) or isType( obj, "array" )
if not obj.hasOwnProperty( "define" ) and historyObject.config.enableDefine is on
( (origin, store, obj, path)->
Object.defineProperty obj, "define",
configurable: true
enumerable: false
writable: false
value: ( key, value ) ->
path.push(key)
savePath = path.join(".")
path.pop()
define.call( origin, store, savePath, value )
return
)(origin, store, obj, path)
if not obj.hasOwnProperty( "remove" ) and historyObject.config.enableRemove is on
( (origin, store, obj, path)->
Object.defineProperty obj, "remove",
configurable: true
enumerable: false
writable: false
value: ( key ) ->
path.push(key)
savePath = path.join(".")
path.pop()
remove.call( origin, store, obj, savePath, key )
return
)(origin, store, obj, path)
# register observe and unobserve function to everything
# unobserve is blacklisting the given path
if not obj.hasOwnProperty( "unobserve" ) and historyObject.config.enableUnobserve is on
Object.defineProperty obj, "unobserve",
configurable: true
enumerable: false
writable: false
value: ( path ) ->
if not path? or path is undefined
historyObject.unobserve( origin, [savePath] )
else
historyObject.unobserve( obj, [path] )
return
if not obj.hasOwnProperty( "observe" ) and historyObject.config.enableObserve is on
Object.defineProperty obj, "observe",
configurable: true
enumerable: false
writable: false
value: ( path ) ->
if not path? or path is undefined
historyObject.observe( origin, [savePath] )
else
historyObject.observe( obj, [path] )
return
# default to observe everything in object
keys = Object.keys( obj )
for prop in keys
do (prop) ->
value = obj[prop]
# build up path object
path.push( prop )
# define path as String not to pass by reference
savePath = path.join(".")
# only go forward if path is in whitelisted area
if isInList( savePath, whitelist )
# observe recursively if deep observe is turned on
if value? and ( isType( value, 'object') or isType( value, 'array') ) and deep is on
historyObject.observe( value, whitelist, extension, deep, origin, savePath )
# otherwise observe object property
# if deep observe is turned off, we cant observe objects and arrays
else
# define property in self-calling function to avoid variable reference
((store, obj, prop, savePath)->
Object.defineProperty obj, prop,
enumerable: true
configurable: true
# getter remains the same
get: () ->
prop
# setter modified to save old values to __History__ before setting the new one
set: ( val ) ->
step = path: savePath, value: prop
store.__History__.record step
prop = val
# set initial value
store.__History__.options.bypassRecording = on
obj[prop] = value
store.__History__.options.bypassRecording = off
return
)(store, obj, prop, savePath)
# remove last item from path to correct for next item
path.pop()
return
return
unobserve: (obj, blacklist, path) ->
path = [] if not path? or path is undefined
path = path.split( "." ) if not isType( path, "array" )
for prop, val of obj
do (prop, val) ->
# build up path object
path.push( prop )
# define path as String not to pass by reference
savePath = path.join(".")
# continue only if path is blacklistable
if isInList( savePath, blacklist )
if val? and isType( val, "object" ) or isType( val, "array" )
historyObject.unobserve( val, blacklist, savePath )
else
# remove the history related properties
delete obj.__History__ if obj.hasOwnProperty( "__History__" )
delete obj.undo if obj.hasOwnProperty( "undo" )
delete obj.redo if obj.hasOwnProperty( "redo" )
delete obj.define if obj.hasOwnProperty( "define" )
delete obj.remove if obj.hasOwnProperty( "remove" )
delete obj.observe if obj.hasOwnProperty( "observe" )
delete obj.unobserve if obj.hasOwnProperty( "unobserve" )
# redefine property with current value
Object.defineProperty obj, prop,
writable: true
configurable: true
enumerable: true
value: val
# remove last item from path to correct for next item
path.pop()
return
return | true | ###
Basic helper functions
###
###
# Checks if given value is type of something
###
isType = ( val, type ) ->
classToType =
'[object Boolean]': 'boolean'
'[object Number]': 'number'
'[object String]': 'string'
'[object Function]': 'function'
'[object Array]': 'array'
'[object Date]': 'date'
'[object RegExp]': 'regexp'
'[object Object]': 'object'
'[object Null]': 'null'
'[object Undefined]': 'undefined'
classToType[Object::toString.call(val)] is type
fixNumber = ( val ) ->
val = +val if isType( val, "number" )
return val
###
# Reads value from object through path
# @param obj {Object}
# @param path {String} - e.g. 'a.foo.1.bar'
###
deepGet = (obj, path) ->
# reversing the path to use Array::pop()
path = (path.split ".").reverse().map( fixNumber ) if not isType( path, "array" )
key = path.pop()
# if we reach the end of the path, or the current value is undefined
# return the current value
if path.length is 0 or not Object::hasOwnProperty.call(obj, key)
return obj[key]
deepGet obj[key], path
###
# Writes value to object through path
# @param obj {Object}
# @param path {String} - e.g. 'a.foo.bar'
# @param value {Mixed}
# @param create {Boolean} - whether it should build non-existent tree or not
###
deepSet = (obj, path, value, create) ->
create = true if not create? or create is undefined
# reversing the path to use Array::pop()
path = (path.split ".").reverse().map( fixNumber ) if not isType( path, "array" )
key = path.pop()
if path.length is 0
return obj[key] = value
if not Object::hasOwnProperty.call(obj, key) or obj[key] is undefined
if create is on
# if next key is number create an array, else create object
if isType( path[path.length-1], "number" )
obj[key] = []
else
obj[key] = {}
else
throw new Error("Value not set, because creation is set to false!")
console.log obj, path, value
deepSet obj[key], path, value, create
return
###
# Checks if path is in a whitelisted place
###
isInList = (path, whitelist) ->
# if whitelist is empty or not defined, instantly whitelist path
return true if not whitelist? or whitelist is undefined or whitelist.length is 0
matches = 0
for item in whitelist
# increment matches if path starts with whitelist item or vica versa
matches++ if path.indexOf( item ) isnt -1 or item.indexOf( path ) isnt -1
matches > 0
###
End of helper functions
###
undo = ( store ) ->
# return instantly if no record in forward history
return if store.__History__._backwards.length is 0
store.__History__.options.bypassRecording = on
store.__History__.options.emptyOnSet = off
# get the next step from backwards history
step = store.__History__._backwards.pop()
# set current state
switch step.type
when "delete" then ( (origin, store, step) ->
define.call( origin, store, step.path, step.value )
store.__History__._forwards.push path: step.path, value: step.value, type: "delete"
)(@, store, step)
when "add" then ( (origin, store, step) ->
path = step.path.split(".")
key = PI:KEY:<KEY>END_PI
savePath = path.join(".")
obj = deepGet( origin, savePath )
remove.call( origin, store, obj, step.path, key )
store.__History__._forwards.push path: step.path, value: step.value, type: "add"
)(@, store, step)
when "update" then ( (origin, store, step) ->
store.__History__._forwards.push path: step.path, value: deepGet(origin, step.path), type: "update"
deepSet( origin, step.path, step.value )
)(@, store, step)
store.__History__.options.emptyOnSet = on
store.__History__.options.bypassRecording = off
return
redo = ( store ) ->
# return instantly if no record in forward history
return if store.__History__._forwards.length is 0
store.__History__.options.bypassRecording = on
store.__History__.options.emptyOnSet = off
# get the next step from forwards history
step = store.__History__._forwards.pop()
# set current state
switch step.type
when "delete" then ( (origin, store, step) ->
path = step.path.split(".")
key = path.PI:KEY:<KEY>END_PI()
savePath = path.join(".")
obj = deepGet( origin, savePath )
remove.call( origin, store, obj, step.path, key )
store.__History__._backwards.push path: step.path, value: step.value, type: "delete"
)(@, store, step)
when "add" then ( (origin, store, step) ->
define.call( origin, store, step.path, step.value )
store.__History__._backwards.push path: step.path, value: step.value, type: "add"
)(@, store, step)
when "update" then ( (origin, store, step) ->
store.__History__._backwards.push path: step.path, value: deepGet(origin, step.path), type: "update"
deepSet( origin, step.path, step.value )
)(@, store, step)
store.__History__.options.emptyOnSet = on
store.__History__.options.bypassRecording = off
return
define = ( store, path, value ) ->
if deepGet( @, path ) is undefined
deepSet( @, path, value, true )
store.__History__.record( path: path, value: value, type: "add" )
historyObject.config.observe( @, [path] )
return
remove = ( store, obj, path, key ) ->
store.__History__.record( path: path, value: obj[key], type: "delete" )
delete obj[key]
return
module.exports = historyObject =
config:
# where to store the history states ("self"|{Object})
store: "self"
defaultWhitelist: []
enableExtension: off
enableDeep: on
# if these features are on, all objects will be extended with the following properties
# .define(path, value), .remove(property), .observe(path), .unobserve(path)
enableDefine: on
enableRemove: on
enableObserve: on
enableUnobserve: on
class: class History
constructor: ( @origin ) ->
@_backwards = []
@_forwards = []
options:
maxLength: 100
emptyOnSet: on
bypassRecording: off
record: ( state ) ->
return if @options.bypassRecording is on
state.type = "update" if state.type is undefined
@_backwards.push( state )
# empty forward history if set
@_forwards = [] if @options.emptyOnSet is on
# remove first item in history if reached limit
@_backwards.shift() if @_backwards.length > @options.maxLength
return
observe: (obj, whitelist = historyObject.config.defaultWhitelist, extension = historyObject.config.enableExtension, deep = historyObject.config.enableDeep, origin, path) ->
origin = obj if not origin? or origin is undefined
store = origin if historyObject.config.store is "self"
store = historyObject.config.store if historyObject.config.store isnt "self" and isType( historyObject.config.store, "object" )
path = [] if not path? or path is undefined
path = path.split( "." ) if not isType( path, "array" )
savePath = path.join(".")
# extend the object with whitelist values here if extension is on
# extend only if whitelist is an array
if extension is on and isType( whitelist, "array" )
# handle every item in whitelist as paths, so we can define them with deepSet() easily
for extendPath in whitelist
do ( extendPath ) ->
# if extendPath is undefined in the object define it with null value
if deepGet( obj, extendPath ) is undefined
deepSet( obj, extendPath, null, true )
return
# turn extension off, to be sure we only try to extend once
extension = off
# end of extension
# if starting to record extend the object with a non-enumerable History object,
# which handles the overall history,
# and extend whitelisted values with the capability of undoing and redoing
# only register __History__, redo and undo, if they're not present
# using option enumerable: false is for preventing the History related properties to show in Object.keys()
# configurable set to true to keep the possibility of property deletion
# writable is set to false because we dont want users to mess with it!
if not store.hasOwnProperty( "__History__" )
Object.defineProperty store, "__History__",
enumerable: false
configurable: true
value: new historyObject.class( origin )
if not store.hasOwnProperty( "undo" )
Object.defineProperty store, "undo",
configurable: true
enumerable: false
writable: false
value: ( n ) ->
n = 1 if not isType( n, "number" )
while n--
undo.call( origin, store )
return
if not store.hasOwnProperty( "redo" )
Object.defineProperty store, "redo",
configurable: true
enumerable: false
writable: false
value: ( n ) ->
n = 1 if not isType( n, "number" )
while n--
redo.call( origin, store )
return
# register define and remove function to every object
# if property is defined through this function,
# it will also be deeply observable
# remove is saving current value before actually removing the item
if isType( obj, "object" ) or isType( obj, "array" )
if not obj.hasOwnProperty( "define" ) and historyObject.config.enableDefine is on
( (origin, store, obj, path)->
Object.defineProperty obj, "define",
configurable: true
enumerable: false
writable: false
value: ( key, value ) ->
path.push(key)
savePath = path.join(".")
path.pop()
define.call( origin, store, savePath, value )
return
)(origin, store, obj, path)
if not obj.hasOwnProperty( "remove" ) and historyObject.config.enableRemove is on
( (origin, store, obj, path)->
Object.defineProperty obj, "remove",
configurable: true
enumerable: false
writable: false
value: ( key ) ->
path.push(key)
savePath = path.join(".")
path.pop()
remove.call( origin, store, obj, savePath, key )
return
)(origin, store, obj, path)
# register observe and unobserve function to everything
# unobserve is blacklisting the given path
if not obj.hasOwnProperty( "unobserve" ) and historyObject.config.enableUnobserve is on
Object.defineProperty obj, "unobserve",
configurable: true
enumerable: false
writable: false
value: ( path ) ->
if not path? or path is undefined
historyObject.unobserve( origin, [savePath] )
else
historyObject.unobserve( obj, [path] )
return
if not obj.hasOwnProperty( "observe" ) and historyObject.config.enableObserve is on
Object.defineProperty obj, "observe",
configurable: true
enumerable: false
writable: false
value: ( path ) ->
if not path? or path is undefined
historyObject.observe( origin, [savePath] )
else
historyObject.observe( obj, [path] )
return
# default to observe everything in object
keys = Object.keys( obj )
for prop in keys
do (prop) ->
value = obj[prop]
# build up path object
path.push( prop )
# define path as String not to pass by reference
savePath = path.join(".")
# only go forward if path is in whitelisted area
if isInList( savePath, whitelist )
# observe recursively if deep observe is turned on
if value? and ( isType( value, 'object') or isType( value, 'array') ) and deep is on
historyObject.observe( value, whitelist, extension, deep, origin, savePath )
# otherwise observe object property
# if deep observe is turned off, we cant observe objects and arrays
else
# define property in self-calling function to avoid variable reference
((store, obj, prop, savePath)->
Object.defineProperty obj, prop,
enumerable: true
configurable: true
# getter remains the same
get: () ->
prop
# setter modified to save old values to __History__ before setting the new one
set: ( val ) ->
step = path: savePath, value: prop
store.__History__.record step
prop = val
# set initial value
store.__History__.options.bypassRecording = on
obj[prop] = value
store.__History__.options.bypassRecording = off
return
)(store, obj, prop, savePath)
# remove last item from path to correct for next item
path.pop()
return
return
unobserve: (obj, blacklist, path) ->
path = [] if not path? or path is undefined
path = path.split( "." ) if not isType( path, "array" )
for prop, val of obj
do (prop, val) ->
# build up path object
path.push( prop )
# define path as String not to pass by reference
savePath = path.join(".")
# continue only if path is blacklistable
if isInList( savePath, blacklist )
if val? and isType( val, "object" ) or isType( val, "array" )
historyObject.unobserve( val, blacklist, savePath )
else
# remove the history related properties
delete obj.__History__ if obj.hasOwnProperty( "__History__" )
delete obj.undo if obj.hasOwnProperty( "undo" )
delete obj.redo if obj.hasOwnProperty( "redo" )
delete obj.define if obj.hasOwnProperty( "define" )
delete obj.remove if obj.hasOwnProperty( "remove" )
delete obj.observe if obj.hasOwnProperty( "observe" )
delete obj.unobserve if obj.hasOwnProperty( "unobserve" )
# redefine property with current value
Object.defineProperty obj, prop,
writable: true
configurable: true
enumerable: true
value: val
# remove last item from path to correct for next item
path.pop()
return
return |
[
{
"context": " TO 'hubot_mysql'@'hubot_host' IDENTIFIED BY 'some_pass';\n# !! Warning. In order to collect a profile t",
"end": 230,
"score": 0.7548943758010864,
"start": 226,
"tag": "PASSWORD",
"value": "pass"
},
{
"context": "pendencies:\n# \"cli-table\" : \"https://github.com/... | src/mysql-profile.coffee | samlambert/hubot-mysql-chatops | 51 | # Description:
# Profile a MySQL Query
#
# Notes:
# This script requires a MySQL user with SELECT priviliges.
# You can create a user like so: GRANT SELECT ON some_db.* TO 'hubot_mysql'@'hubot_host' IDENTIFIED BY 'some_pass';
# !! Warning. In order to collect a profile the query is executed. It is very strongly recommended that you use a read only user on a MySQL slave !!
#
# Dependencies:
# "cli-table" : "https://github.com/LearnBoost/cli-table"
# "mysql" : "https://github.com/felixge/node-mysql"
# "validator" : "https://github.com/chriso/validator.js"
#
# Configuration:
# HUBOT_MYSQL_CHATOPS_HOST
# HUBOT_MYSQL_CHATOPS_DATABASE
# HUBOT_MYSQL_CHATOPS_USER
# HUBOT_MYSQL_CHATOPS_PASS
#
# Commands:
# hubot mysql profile <sql> - Run MySQL profile on <sql>
mysql = require 'mysql'
table = require 'cli-table'
validator = require 'validator'
module.exports = (robot) ->
robot.respond /mysql profile (.*)/i, (msg) ->
msg.reply "This will run and profile a query against MySQL. To run this fo realz use mysql profile!. Be careful ;)"
return
robot.respond /mysql profile! (.*)/i, (msg) ->
query = validator.blacklist(msg.match[1], [';'])
unless process.env.HUBOT_MYSQL_CHATOPS_HOST?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_HOST"
return
unless process.env.HUBOT_MYSQL_CHATOPS_DATABASE?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_DATABASE"
return
unless process.env.HUBOT_MYSQL_CHATOPS_USER?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_USER"
return
unless process.env.HUBOT_MYSQL_CHATOPS_PASS?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_PASS"
return
@client = mysql.createClient
host: "#{process.env.HUBOT_MYSQL_CHATOPS_HOST}"
database: "#{process.env.HUBOT_MYSQL_CHATOPS_DATABASE}"
user: "#{process.env.HUBOT_MYSQL_CHATOPS_USER}"
password: "#{process.env.HUBOT_MYSQL_CHATOPS_PASS}"
@client.on 'error', (err) ->
robot.emit 'error', err, msg
@client.query "SET PROFILING = 1", (err, results) =>
if err
msg.reply err
return
@client.query "#{query}", (err, results) =>
if err
msg.reply err
return
@client.query "SHOW PROFILE FOR QUERY 1", (err, results) =>
if err
msg.reply err
return
status_max = 0
duration_max = 0
rows = []
for row in results
profile = ["#{row.Status}", "#{row.Duration}"]
padding = 8
if profile[0].length + padding > status_max
status_max = profile[0].length + padding
if profile[1].length + padding > duration_max
duration_max = profile[1].length + padding
rows.push profile
@grid = new table
head: ['Status', 'Duration (secs)']
style: { head: false }
colWidths: [status_max, duration_max]
for row in rows
@grid.push row
msg.reply "\n#{@grid.toString()}"
@client.destroy()
| 191464 | # Description:
# Profile a MySQL Query
#
# Notes:
# This script requires a MySQL user with SELECT priviliges.
# You can create a user like so: GRANT SELECT ON some_db.* TO 'hubot_mysql'@'hubot_host' IDENTIFIED BY 'some_<PASSWORD>';
# !! Warning. In order to collect a profile the query is executed. It is very strongly recommended that you use a read only user on a MySQL slave !!
#
# Dependencies:
# "cli-table" : "https://github.com/LearnBoost/cli-table"
# "mysql" : "https://github.com/felixge/node-mysql"
# "validator" : "https://github.com/chriso/validator.js"
#
# Configuration:
# HUBOT_MYSQL_CHATOPS_HOST
# HUBOT_MYSQL_CHATOPS_DATABASE
# HUBOT_MYSQL_CHATOPS_USER
# HUBOT_MYSQL_CHATOPS_PASS
#
# Commands:
# hubot mysql profile <sql> - Run MySQL profile on <sql>
mysql = require 'mysql'
table = require 'cli-table'
validator = require 'validator'
module.exports = (robot) ->
robot.respond /mysql profile (.*)/i, (msg) ->
msg.reply "This will run and profile a query against MySQL. To run this fo realz use mysql profile!. Be careful ;)"
return
robot.respond /mysql profile! (.*)/i, (msg) ->
query = validator.blacklist(msg.match[1], [';'])
unless process.env.HUBOT_MYSQL_CHATOPS_HOST?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_HOST"
return
unless process.env.HUBOT_MYSQL_CHATOPS_DATABASE?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_DATABASE"
return
unless process.env.HUBOT_MYSQL_CHATOPS_USER?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_USER"
return
unless process.env.HUBOT_MYSQL_CHATOPS_PASS?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_PASS"
return
@client = mysql.createClient
host: "#{process.env.HUBOT_MYSQL_CHATOPS_HOST}"
database: "#{process.env.HUBOT_MYSQL_CHATOPS_DATABASE}"
user: "#{process.env.HUBOT_MYSQL_CHATOPS_USER}"
password: "#{<PASSWORD>}"
@client.on 'error', (err) ->
robot.emit 'error', err, msg
@client.query "SET PROFILING = 1", (err, results) =>
if err
msg.reply err
return
@client.query "#{query}", (err, results) =>
if err
msg.reply err
return
@client.query "SHOW PROFILE FOR QUERY 1", (err, results) =>
if err
msg.reply err
return
status_max = 0
duration_max = 0
rows = []
for row in results
profile = ["#{row.Status}", "#{row.Duration}"]
padding = 8
if profile[0].length + padding > status_max
status_max = profile[0].length + padding
if profile[1].length + padding > duration_max
duration_max = profile[1].length + padding
rows.push profile
@grid = new table
head: ['Status', 'Duration (secs)']
style: { head: false }
colWidths: [status_max, duration_max]
for row in rows
@grid.push row
msg.reply "\n#{@grid.toString()}"
@client.destroy()
| true | # Description:
# Profile a MySQL Query
#
# Notes:
# This script requires a MySQL user with SELECT priviliges.
# You can create a user like so: GRANT SELECT ON some_db.* TO 'hubot_mysql'@'hubot_host' IDENTIFIED BY 'some_PI:PASSWORD:<PASSWORD>END_PI';
# !! Warning. In order to collect a profile the query is executed. It is very strongly recommended that you use a read only user on a MySQL slave !!
#
# Dependencies:
# "cli-table" : "https://github.com/LearnBoost/cli-table"
# "mysql" : "https://github.com/felixge/node-mysql"
# "validator" : "https://github.com/chriso/validator.js"
#
# Configuration:
# HUBOT_MYSQL_CHATOPS_HOST
# HUBOT_MYSQL_CHATOPS_DATABASE
# HUBOT_MYSQL_CHATOPS_USER
# HUBOT_MYSQL_CHATOPS_PASS
#
# Commands:
# hubot mysql profile <sql> - Run MySQL profile on <sql>
mysql = require 'mysql'
table = require 'cli-table'
validator = require 'validator'
module.exports = (robot) ->
robot.respond /mysql profile (.*)/i, (msg) ->
msg.reply "This will run and profile a query against MySQL. To run this fo realz use mysql profile!. Be careful ;)"
return
robot.respond /mysql profile! (.*)/i, (msg) ->
query = validator.blacklist(msg.match[1], [';'])
unless process.env.HUBOT_MYSQL_CHATOPS_HOST?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_HOST"
return
unless process.env.HUBOT_MYSQL_CHATOPS_DATABASE?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_DATABASE"
return
unless process.env.HUBOT_MYSQL_CHATOPS_USER?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_USER"
return
unless process.env.HUBOT_MYSQL_CHATOPS_PASS?
msg.reply "Would love to, but kind of missing HUBOT_MYSQL_CHATOPS_PASS"
return
@client = mysql.createClient
host: "#{process.env.HUBOT_MYSQL_CHATOPS_HOST}"
database: "#{process.env.HUBOT_MYSQL_CHATOPS_DATABASE}"
user: "#{process.env.HUBOT_MYSQL_CHATOPS_USER}"
password: "#{PI:PASSWORD:<PASSWORD>END_PI}"
@client.on 'error', (err) ->
robot.emit 'error', err, msg
@client.query "SET PROFILING = 1", (err, results) =>
if err
msg.reply err
return
@client.query "#{query}", (err, results) =>
if err
msg.reply err
return
@client.query "SHOW PROFILE FOR QUERY 1", (err, results) =>
if err
msg.reply err
return
status_max = 0
duration_max = 0
rows = []
for row in results
profile = ["#{row.Status}", "#{row.Duration}"]
padding = 8
if profile[0].length + padding > status_max
status_max = profile[0].length + padding
if profile[1].length + padding > duration_max
duration_max = profile[1].length + padding
rows.push profile
@grid = new table
head: ['Status', 'Duration (secs)']
style: { head: false }
colWidths: [status_max, duration_max]
for row in rows
@grid.push row
msg.reply "\n#{@grid.toString()}"
@client.destroy()
|
[
{
"context": ", 'User Name')\n .option('-s, --pwd [Password]', 'Password')\n .option('-a, --action [search|summary]', 'Act",
"end": 671,
"score": 0.9591154456138611,
"start": 663,
"tag": "PASSWORD",
"value": "Password"
},
{
"context": "ries'\n cbLogin: program.cobranduser\n cbPas... | index.coffee | yury-sannikov/yodlee-api-sample | 1 | require 'colors'
program = require 'commander'
workflow = new (require('events').EventEmitter)();
Q = require('q');
# Workflow
workflow.on 'cbLogin', require('./workflow/cobrand_login.coffee').cbLogin
workflow.on 'cbUserLogin', require('./workflow/cobrand_userlogin.coffee').cbUserLogin
workflow.on 'search', require('./workflow/action_search.coffee').search
workflow.on 'summary', require('./workflow/action_summary.coffee').summary
program
.version '0.0.1'
.option('-u, --cobranduser [User]', 'Cobrand User Name')
.option('-p, --cobrandpwd [Password]', 'Cobrand Password')
.option('-l, --user [User]', 'User Name')
.option('-s, --pwd [Password]', 'Password')
.option('-a, --action [search|summary]', 'Action to perform against this user')
.option('-d, --data [data]', 'Action data')
.parse(process.argv);
if not program.cobranduser or program.cobranduser.length == 0
console.log 'You should specify user name using --cobranduser [User]'.red.bold
process.exit 1
if not program.cobrandpwd or program.cobrandpwd.length == 0
console.log 'You should specify password using --cobrandpwd [Password]'.red.bold
process.exit 2
console.log 'Running sample for ' + "#{program.cobranduser}".green
context =
workflow: workflow
baseUrl: 'https://rest.developer.yodlee.com/services/srest/restserver/v1.0'
eventUrl:
coLogin: '/authenticate/coblogin'
uLogin: '/authenticate/login'
search: '/jsonsdk/SiteTraversal/searchSite'
summary: '/jsonsdk/DataService/getItemSummaries'
cbLogin: program.cobranduser
cbPassword: program.cobrandpwd
uLogin: program.user
uPassword: program.pwd
action: program.action
actionData: program.data
workflow.emit 'cbLogin', context
| 193559 | require 'colors'
program = require 'commander'
workflow = new (require('events').EventEmitter)();
Q = require('q');
# Workflow
workflow.on 'cbLogin', require('./workflow/cobrand_login.coffee').cbLogin
workflow.on 'cbUserLogin', require('./workflow/cobrand_userlogin.coffee').cbUserLogin
workflow.on 'search', require('./workflow/action_search.coffee').search
workflow.on 'summary', require('./workflow/action_summary.coffee').summary
program
.version '0.0.1'
.option('-u, --cobranduser [User]', 'Cobrand User Name')
.option('-p, --cobrandpwd [Password]', 'Cobrand Password')
.option('-l, --user [User]', 'User Name')
.option('-s, --pwd [Password]', '<PASSWORD>')
.option('-a, --action [search|summary]', 'Action to perform against this user')
.option('-d, --data [data]', 'Action data')
.parse(process.argv);
if not program.cobranduser or program.cobranduser.length == 0
console.log 'You should specify user name using --cobranduser [User]'.red.bold
process.exit 1
if not program.cobrandpwd or program.cobrandpwd.length == 0
console.log 'You should specify password using --cobrandpwd [Password]'.red.bold
process.exit 2
console.log 'Running sample for ' + "#{program.cobranduser}".green
context =
workflow: workflow
baseUrl: 'https://rest.developer.yodlee.com/services/srest/restserver/v1.0'
eventUrl:
coLogin: '/authenticate/coblogin'
uLogin: '/authenticate/login'
search: '/jsonsdk/SiteTraversal/searchSite'
summary: '/jsonsdk/DataService/getItemSummaries'
cbLogin: program.cobranduser
cbPassword: <PASSWORD>
uLogin: program.user
uPassword: <PASSWORD>
action: program.action
actionData: program.data
workflow.emit 'cbLogin', context
| true | require 'colors'
program = require 'commander'
workflow = new (require('events').EventEmitter)();
Q = require('q');
# Workflow
workflow.on 'cbLogin', require('./workflow/cobrand_login.coffee').cbLogin
workflow.on 'cbUserLogin', require('./workflow/cobrand_userlogin.coffee').cbUserLogin
workflow.on 'search', require('./workflow/action_search.coffee').search
workflow.on 'summary', require('./workflow/action_summary.coffee').summary
program
.version '0.0.1'
.option('-u, --cobranduser [User]', 'Cobrand User Name')
.option('-p, --cobrandpwd [Password]', 'Cobrand Password')
.option('-l, --user [User]', 'User Name')
.option('-s, --pwd [Password]', 'PI:PASSWORD:<PASSWORD>END_PI')
.option('-a, --action [search|summary]', 'Action to perform against this user')
.option('-d, --data [data]', 'Action data')
.parse(process.argv);
if not program.cobranduser or program.cobranduser.length == 0
console.log 'You should specify user name using --cobranduser [User]'.red.bold
process.exit 1
if not program.cobrandpwd or program.cobrandpwd.length == 0
console.log 'You should specify password using --cobrandpwd [Password]'.red.bold
process.exit 2
console.log 'Running sample for ' + "#{program.cobranduser}".green
context =
workflow: workflow
baseUrl: 'https://rest.developer.yodlee.com/services/srest/restserver/v1.0'
eventUrl:
coLogin: '/authenticate/coblogin'
uLogin: '/authenticate/login'
search: '/jsonsdk/SiteTraversal/searchSite'
summary: '/jsonsdk/DataService/getItemSummaries'
cbLogin: program.cobranduser
cbPassword: PI:PASSWORD:<PASSWORD>END_PI
uLogin: program.user
uPassword: PI:PASSWORD:<PASSWORD>END_PI
action: program.action
actionData: program.data
workflow.emit 'cbLogin', context
|
[
{
"context": "ecord: (record) ->\n record.account_name = \"MARKET\" if record.issuer_account_id == -2\n reco",
"end": 1160,
"score": 0.6487039923667908,
"start": 1156,
"tag": "NAME",
"value": "MARK"
},
{
"context": "d: (record) ->\n record.account_name = \"MARKET... | programs/web_wallet/app/js/services/blockchain.coffee | larkx/LarkX | 0 | class Blockchain
constructor: (@client, @network, @rpc, @blockchain_api, @utils, @q, @interval) ->
# # # # #
# Blockchain Config
config : {}
get_info : () ->
if Object.keys(@config).length > 0
deferred = @q.defer()
deferred.resolve(@config)
return deferred.promise
else
@rpc.request("blockchain_get_info", []).then (result) =>
@config = result.result
@config.page_count = 20
return @config
list_accounts: (start_name, limit) ->
@rpc.request('blockchain_list_accounts', [start_name, limit]).then (response) ->
reg = []
angular.forEach response.result, (val, key) =>
reg.push
name: val.name
owner_key: val.owner_key
public_data: val.public_data
registration_date: val.registration_date
reg
# # # # #
# Asset Records
asset_records: {}
symbol2records: {}
asset_records_deferred: null
populate_asset_record: (record) ->
record.account_name = "MARKET" if record.issuer_account_id == -2
record.account_name = "GENESIS" if record.issuer_account_id == 0
@asset_records[record.id] = record
@symbol2records[record.symbol] = record
return @asset_records[record.id]
refresh_asset_records: ->
return @asset_records_deferred.promise if @asset_records_deferred
@asset_records_deferred = deferred = @q.defer()
if Object.keys(@asset_records).length > 10
deferred.resolve(@asset_records)
@asset_records_deferred = null
return deferred.promise
promise = @blockchain_api.list_assets("", -1)
promise.then (result) =>
angular.forEach result, (record) =>
@populate_asset_record record
deferred.resolve(@asset_records)
@asset_records_deferred = null
, (error) ->
deferred.reject(error)
@asset_records_deferred = null
return deferred.promise
get_asset: (id) ->
if !$.isNumeric(id)
record = @symbol2records[id]
return record if record
if $.isNumeric(id) and @asset_records[id]
deferred = @q.defer()
deferred.resolve(@asset_records[id])
return deferred.promise
@blockchain_api.get_asset(id).then (result) =>
record = @populate_asset_record result
return record
get_markets: ->
markets = []
markets_hash = {}
angular.forEach @asset_records, (asset1) =>
angular.forEach @asset_records, (asset2) =>
asset1_symbol = if asset1.issuer_account_id == -2 then "Bit" + asset1.symbol else asset1.symbol
asset2_symbol = if asset2.issuer_account_id == -2 then "Bit" + asset2.symbol else asset2.symbol
if asset1.id > asset2.id
value = asset1_symbol + ":" + asset2_symbol
markets_hash[value] = value
else if asset2.id > asset1.id
value = asset2_symbol + ":" + asset1_symbol
markets_hash[value] = value
angular.forEach markets_hash, (key, value) ->
markets.push value
#console.log markets
markets
# Asset records
# # # # #
block_head_num : 0
recent_blocks_count : 20
recent_blocks :
value : []
last_block_timestamp: ""
last_block_round : 0
get_blocks_with_missed: (first_block, blocks_to_fetch) ->
@blockchain_api.get_block_count().then (head_block) =>
if first_block > head_block
def = @q.defer()
def.resolve([])
return def.promise
if first_block + blocks_to_fetch > head_block
blocks_to_fetch = head_block - first_block
requests =
blocks: @blockchain_api.list_blocks(first_block, blocks_to_fetch)
signers: @rpc.request("batch", ["blockchain_get_block_signee", [i] for i in [first_block...first_block+blocks_to_fetch]])
missed: @rpc.request("batch", ["blockchain_list_missing_block_delegates", [i] for i in [first_block...first_block+blocks_to_fetch]])
config: @get_info()
@q.all(requests).then (results) =>
blocks = results.blocks
missed = results.missed.result
signers = results.signers.result
config = results.config
merged = []
for i in [0...blocks.length]
blocks[i].delegate_name = signers[i]
blocks[i].timestamp = @utils.toDate(blocks[i].timestamp)
blocks[i].latency = blocks[i].latency/1000000
for j in [0...missed[i].length]
timestamp = new Date(+blocks[i].timestamp - ((missed[i].length - j)) * (1000 * config.block_interval))
merged.push
block_num: -2
timestamp: timestamp
delegate_name: missed[i][j]
merged.push blocks[i]
return merged
get_last_block_round: ->
if @recent_blocks.last_block_round
deferred = @q.defer()
deferred.resolve(@recent_blocks.last_block_round)
return deferred.promise
else
@q.all({ head_num: @blockchain_api.get_block_count(), config: @get_info() }).then (results) =>
console.log results
@recent_blocks.last_block_round = Math.floor((results.head_num - 1) / (results.config.page_count))
@block_head_num = results.head_num
return @recent_blocks.last_block_round
##
# Delegates
active_delegates: []
inactive_delegates: []
all_delegates: {}
id_delegates: {}
delegate_active_hash_map: {}
delegate_inactive_hash_map: {}
avg_act_del_pay_rate=0
# TODO: finish this mapping, may be in some config or settings
type_name_map :
withdraw_op_type : "Withdraw Operation"
deposit_op_type : "Deposit Operation"
create_asset_op_type : "Create Asset Operation"
update_asset_op_type : "Update Asset Operation"
withdraw_pay_op_type : "Withdraw Pay Operation"
register_account_op_type : "Register Account Operation"
update_account_op_type : "Update Account Operation"
issue_asset_op_type : "Issue Asset Operation"
submit_proposal_op_type : "Submit Proposal Operation"
vote_proposal_op_type : "Vote Proposal Operation"
bid_op_type : "Bid Operation"
ask_op_type : "Ask Operation"
short_op_type : "Short Operation"
cover_op_type : "Cover Operation"
add_collateral_op_type : "Add Collateral Operation"
remove_collateral_op_type : "Remove Collateral Operation"
# TODO
populate_delegate: (record, active, rank) ->
record.active = active
record.rank = rank
@all_delegates[record.name] = record
# record.feeds ||= []
# if active and record.feeds.length == 0
# @blockchain_api.get_feeds_from_delegate(record.name).then (result) ->
# record.feeds.push r.asset_symbol for r in result
record
refresh_delegates: ->
# TODO: delegates paginator is needed
@avg_act_del_pay_rate=0
@q.all({dels: @blockchain_api.list_delegates(0, 10000), config: @get_info()}).then (results) =>
for i in [0 ... results.config.delegate_num]
@active_delegates[i] = @populate_delegate(results.dels[i], true, i+1)
@id_delegates[results.dels[i].id] = results.dels[i]
@delegate_active_hash_map[@active_delegates[i].name]=true
@avg_act_del_pay_rate+=@active_delegates[i].delegate_info.pay_rate
@avg_act_del_pay_rate=@avg_act_del_pay_rate/results.config.delegate_num
for i in [results.config.delegate_num ... results.dels.length]
@inactive_delegates[i - results.config.delegate_num] = @populate_delegate(results.dels[i], false, i+1)
@id_delegates[results.dels[i].id] = results.dels[i]
@delegate_inactive_hash_map[@inactive_delegates[i-results.config.delegate_num].name]=true
price_history: (quote_symbol, base_symbol, start_time, duration, granularity) ->
#@blockchain_api.market_price_history(quote_symbol, base_symbol, start_time, duration, granularity).then (result) ->
# console.log 'price_history -----', result
json = '''
[[
"20200101T175300",{
"highest_bid": {
"ratio": "0.045",
"quote_asset_id": 1,
"base_asset_id": 0
},
"lowest_ask": {
"ratio": "0.0656",
"quote_asset_id": 1,
"base_asset_id": 0
},
"volume": 1
}
],
"20200101T175400",{
"highest_bid": {
"ratio": "0.045",
"quote_asset_id": 1,
"base_asset_id": 0
},
"lowest_ask": {
"ratio": "0.0656",
"quote_asset_id": 1,
"base_asset_id": 0
},
"volume": 1
}
]
'''
deferred = @q.defer()
deferred.resolve(JSON.parse(json))
return deferred.promise
angular.module("app").service("Blockchain", ["Client", "NetworkAPI", "RpcService", "BlockchainAPI", "Utils", "$q", "$interval", Blockchain])
| 131194 | class Blockchain
constructor: (@client, @network, @rpc, @blockchain_api, @utils, @q, @interval) ->
# # # # #
# Blockchain Config
config : {}
get_info : () ->
if Object.keys(@config).length > 0
deferred = @q.defer()
deferred.resolve(@config)
return deferred.promise
else
@rpc.request("blockchain_get_info", []).then (result) =>
@config = result.result
@config.page_count = 20
return @config
list_accounts: (start_name, limit) ->
@rpc.request('blockchain_list_accounts', [start_name, limit]).then (response) ->
reg = []
angular.forEach response.result, (val, key) =>
reg.push
name: val.name
owner_key: val.owner_key
public_data: val.public_data
registration_date: val.registration_date
reg
# # # # #
# Asset Records
asset_records: {}
symbol2records: {}
asset_records_deferred: null
populate_asset_record: (record) ->
record.account_name = "<NAME> <PASSWORD>" if record.issuer_account_id == -2
record.account_name = "<KEY> <PASSWORD>" if record.issuer_account_id == 0
@asset_records[record.id] = record
@symbol2records[record.symbol] = record
return @asset_records[record.id]
refresh_asset_records: ->
return @asset_records_deferred.promise if @asset_records_deferred
@asset_records_deferred = deferred = @q.defer()
if Object.keys(@asset_records).length > 10
deferred.resolve(@asset_records)
@asset_records_deferred = null
return deferred.promise
promise = @blockchain_api.list_assets("", -1)
promise.then (result) =>
angular.forEach result, (record) =>
@populate_asset_record record
deferred.resolve(@asset_records)
@asset_records_deferred = null
, (error) ->
deferred.reject(error)
@asset_records_deferred = null
return deferred.promise
get_asset: (id) ->
if !$.isNumeric(id)
record = @symbol2records[id]
return record if record
if $.isNumeric(id) and @asset_records[id]
deferred = @q.defer()
deferred.resolve(@asset_records[id])
return deferred.promise
@blockchain_api.get_asset(id).then (result) =>
record = @populate_asset_record result
return record
get_markets: ->
markets = []
markets_hash = {}
angular.forEach @asset_records, (asset1) =>
angular.forEach @asset_records, (asset2) =>
asset1_symbol = if asset1.issuer_account_id == -2 then "Bit" + asset1.symbol else asset1.symbol
asset2_symbol = if asset2.issuer_account_id == -2 then "Bit" + asset2.symbol else asset2.symbol
if asset1.id > asset2.id
value = asset1_symbol + ":" + asset2_symbol
markets_hash[value] = value
else if asset2.id > asset1.id
value = asset2_symbol + ":" + asset1_symbol
markets_hash[value] = value
angular.forEach markets_hash, (key, value) ->
markets.push value
#console.log markets
markets
# Asset records
# # # # #
block_head_num : 0
recent_blocks_count : 20
recent_blocks :
value : []
last_block_timestamp: ""
last_block_round : 0
get_blocks_with_missed: (first_block, blocks_to_fetch) ->
@blockchain_api.get_block_count().then (head_block) =>
if first_block > head_block
def = @q.defer()
def.resolve([])
return def.promise
if first_block + blocks_to_fetch > head_block
blocks_to_fetch = head_block - first_block
requests =
blocks: @blockchain_api.list_blocks(first_block, blocks_to_fetch)
signers: @rpc.request("batch", ["blockchain_get_block_signee", [i] for i in [first_block...first_block+blocks_to_fetch]])
missed: @rpc.request("batch", ["blockchain_list_missing_block_delegates", [i] for i in [first_block...first_block+blocks_to_fetch]])
config: @get_info()
@q.all(requests).then (results) =>
blocks = results.blocks
missed = results.missed.result
signers = results.signers.result
config = results.config
merged = []
for i in [0...blocks.length]
blocks[i].delegate_name = signers[i]
blocks[i].timestamp = @utils.toDate(blocks[i].timestamp)
blocks[i].latency = blocks[i].latency/1000000
for j in [0...missed[i].length]
timestamp = new Date(+blocks[i].timestamp - ((missed[i].length - j)) * (1000 * config.block_interval))
merged.push
block_num: -2
timestamp: timestamp
delegate_name: missed[i][j]
merged.push blocks[i]
return merged
get_last_block_round: ->
if @recent_blocks.last_block_round
deferred = @q.defer()
deferred.resolve(@recent_blocks.last_block_round)
return deferred.promise
else
@q.all({ head_num: @blockchain_api.get_block_count(), config: @get_info() }).then (results) =>
console.log results
@recent_blocks.last_block_round = Math.floor((results.head_num - 1) / (results.config.page_count))
@block_head_num = results.head_num
return @recent_blocks.last_block_round
##
# Delegates
active_delegates: []
inactive_delegates: []
all_delegates: {}
id_delegates: {}
delegate_active_hash_map: {}
delegate_inactive_hash_map: {}
avg_act_del_pay_rate=0
# TODO: finish this mapping, may be in some config or settings
type_name_map :
withdraw_op_type : "Withdraw Operation"
deposit_op_type : "Deposit Operation"
create_asset_op_type : "Create Asset Operation"
update_asset_op_type : "Update Asset Operation"
withdraw_pay_op_type : "Withdraw Pay Operation"
register_account_op_type : "Register Account Operation"
update_account_op_type : "Update Account Operation"
issue_asset_op_type : "Issue Asset Operation"
submit_proposal_op_type : "Submit Proposal Operation"
vote_proposal_op_type : "Vote Proposal Operation"
bid_op_type : "Bid Operation"
ask_op_type : "Ask Operation"
short_op_type : "Short Operation"
cover_op_type : "Cover Operation"
add_collateral_op_type : "Add Collateral Operation"
remove_collateral_op_type : "Remove Collateral Operation"
# TODO
populate_delegate: (record, active, rank) ->
record.active = active
record.rank = rank
@all_delegates[record.name] = record
# record.feeds ||= []
# if active and record.feeds.length == 0
# @blockchain_api.get_feeds_from_delegate(record.name).then (result) ->
# record.feeds.push r.asset_symbol for r in result
record
refresh_delegates: ->
# TODO: delegates paginator is needed
@avg_act_del_pay_rate=0
@q.all({dels: @blockchain_api.list_delegates(0, 10000), config: @get_info()}).then (results) =>
for i in [0 ... results.config.delegate_num]
@active_delegates[i] = @populate_delegate(results.dels[i], true, i+1)
@id_delegates[results.dels[i].id] = results.dels[i]
@delegate_active_hash_map[@active_delegates[i].name]=true
@avg_act_del_pay_rate+=@active_delegates[i].delegate_info.pay_rate
@avg_act_del_pay_rate=@avg_act_del_pay_rate/results.config.delegate_num
for i in [results.config.delegate_num ... results.dels.length]
@inactive_delegates[i - results.config.delegate_num] = @populate_delegate(results.dels[i], false, i+1)
@id_delegates[results.dels[i].id] = results.dels[i]
@delegate_inactive_hash_map[@inactive_delegates[i-results.config.delegate_num].name]=true
price_history: (quote_symbol, base_symbol, start_time, duration, granularity) ->
#@blockchain_api.market_price_history(quote_symbol, base_symbol, start_time, duration, granularity).then (result) ->
# console.log 'price_history -----', result
json = '''
[[
"20200101T175300",{
"highest_bid": {
"ratio": "0.045",
"quote_asset_id": 1,
"base_asset_id": 0
},
"lowest_ask": {
"ratio": "0.0656",
"quote_asset_id": 1,
"base_asset_id": 0
},
"volume": 1
}
],
"20200101T175400",{
"highest_bid": {
"ratio": "0.045",
"quote_asset_id": 1,
"base_asset_id": 0
},
"lowest_ask": {
"ratio": "0.0656",
"quote_asset_id": 1,
"base_asset_id": 0
},
"volume": 1
}
]
'''
deferred = @q.defer()
deferred.resolve(JSON.parse(json))
return deferred.promise
angular.module("app").service("Blockchain", ["Client", "NetworkAPI", "RpcService", "BlockchainAPI", "Utils", "$q", "$interval", Blockchain])
| true | class Blockchain
constructor: (@client, @network, @rpc, @blockchain_api, @utils, @q, @interval) ->
# # # # #
# Blockchain Config
config : {}
get_info : () ->
if Object.keys(@config).length > 0
deferred = @q.defer()
deferred.resolve(@config)
return deferred.promise
else
@rpc.request("blockchain_get_info", []).then (result) =>
@config = result.result
@config.page_count = 20
return @config
list_accounts: (start_name, limit) ->
@rpc.request('blockchain_list_accounts', [start_name, limit]).then (response) ->
reg = []
angular.forEach response.result, (val, key) =>
reg.push
name: val.name
owner_key: val.owner_key
public_data: val.public_data
registration_date: val.registration_date
reg
# # # # #
# Asset Records
asset_records: {}
symbol2records: {}
asset_records_deferred: null
populate_asset_record: (record) ->
record.account_name = "PI:NAME:<NAME>END_PI PI:PASSWORD:<PASSWORD>END_PI" if record.issuer_account_id == -2
record.account_name = "PI:KEY:<KEY>END_PI PI:PASSWORD:<PASSWORD>END_PI" if record.issuer_account_id == 0
@asset_records[record.id] = record
@symbol2records[record.symbol] = record
return @asset_records[record.id]
refresh_asset_records: ->
return @asset_records_deferred.promise if @asset_records_deferred
@asset_records_deferred = deferred = @q.defer()
if Object.keys(@asset_records).length > 10
deferred.resolve(@asset_records)
@asset_records_deferred = null
return deferred.promise
promise = @blockchain_api.list_assets("", -1)
promise.then (result) =>
angular.forEach result, (record) =>
@populate_asset_record record
deferred.resolve(@asset_records)
@asset_records_deferred = null
, (error) ->
deferred.reject(error)
@asset_records_deferred = null
return deferred.promise
get_asset: (id) ->
if !$.isNumeric(id)
record = @symbol2records[id]
return record if record
if $.isNumeric(id) and @asset_records[id]
deferred = @q.defer()
deferred.resolve(@asset_records[id])
return deferred.promise
@blockchain_api.get_asset(id).then (result) =>
record = @populate_asset_record result
return record
get_markets: ->
markets = []
markets_hash = {}
angular.forEach @asset_records, (asset1) =>
angular.forEach @asset_records, (asset2) =>
asset1_symbol = if asset1.issuer_account_id == -2 then "Bit" + asset1.symbol else asset1.symbol
asset2_symbol = if asset2.issuer_account_id == -2 then "Bit" + asset2.symbol else asset2.symbol
if asset1.id > asset2.id
value = asset1_symbol + ":" + asset2_symbol
markets_hash[value] = value
else if asset2.id > asset1.id
value = asset2_symbol + ":" + asset1_symbol
markets_hash[value] = value
angular.forEach markets_hash, (key, value) ->
markets.push value
#console.log markets
markets
# Asset records
# # # # #
block_head_num : 0
recent_blocks_count : 20
recent_blocks :
value : []
last_block_timestamp: ""
last_block_round : 0
get_blocks_with_missed: (first_block, blocks_to_fetch) ->
@blockchain_api.get_block_count().then (head_block) =>
if first_block > head_block
def = @q.defer()
def.resolve([])
return def.promise
if first_block + blocks_to_fetch > head_block
blocks_to_fetch = head_block - first_block
requests =
blocks: @blockchain_api.list_blocks(first_block, blocks_to_fetch)
signers: @rpc.request("batch", ["blockchain_get_block_signee", [i] for i in [first_block...first_block+blocks_to_fetch]])
missed: @rpc.request("batch", ["blockchain_list_missing_block_delegates", [i] for i in [first_block...first_block+blocks_to_fetch]])
config: @get_info()
@q.all(requests).then (results) =>
blocks = results.blocks
missed = results.missed.result
signers = results.signers.result
config = results.config
merged = []
for i in [0...blocks.length]
blocks[i].delegate_name = signers[i]
blocks[i].timestamp = @utils.toDate(blocks[i].timestamp)
blocks[i].latency = blocks[i].latency/1000000
for j in [0...missed[i].length]
timestamp = new Date(+blocks[i].timestamp - ((missed[i].length - j)) * (1000 * config.block_interval))
merged.push
block_num: -2
timestamp: timestamp
delegate_name: missed[i][j]
merged.push blocks[i]
return merged
get_last_block_round: ->
if @recent_blocks.last_block_round
deferred = @q.defer()
deferred.resolve(@recent_blocks.last_block_round)
return deferred.promise
else
@q.all({ head_num: @blockchain_api.get_block_count(), config: @get_info() }).then (results) =>
console.log results
@recent_blocks.last_block_round = Math.floor((results.head_num - 1) / (results.config.page_count))
@block_head_num = results.head_num
return @recent_blocks.last_block_round
##
# Delegates
active_delegates: []
inactive_delegates: []
all_delegates: {}
id_delegates: {}
delegate_active_hash_map: {}
delegate_inactive_hash_map: {}
avg_act_del_pay_rate=0
# TODO: finish this mapping, may be in some config or settings
type_name_map :
withdraw_op_type : "Withdraw Operation"
deposit_op_type : "Deposit Operation"
create_asset_op_type : "Create Asset Operation"
update_asset_op_type : "Update Asset Operation"
withdraw_pay_op_type : "Withdraw Pay Operation"
register_account_op_type : "Register Account Operation"
update_account_op_type : "Update Account Operation"
issue_asset_op_type : "Issue Asset Operation"
submit_proposal_op_type : "Submit Proposal Operation"
vote_proposal_op_type : "Vote Proposal Operation"
bid_op_type : "Bid Operation"
ask_op_type : "Ask Operation"
short_op_type : "Short Operation"
cover_op_type : "Cover Operation"
add_collateral_op_type : "Add Collateral Operation"
remove_collateral_op_type : "Remove Collateral Operation"
# TODO
populate_delegate: (record, active, rank) ->
record.active = active
record.rank = rank
@all_delegates[record.name] = record
# record.feeds ||= []
# if active and record.feeds.length == 0
# @blockchain_api.get_feeds_from_delegate(record.name).then (result) ->
# record.feeds.push r.asset_symbol for r in result
record
refresh_delegates: ->
# TODO: delegates paginator is needed
@avg_act_del_pay_rate=0
@q.all({dels: @blockchain_api.list_delegates(0, 10000), config: @get_info()}).then (results) =>
for i in [0 ... results.config.delegate_num]
@active_delegates[i] = @populate_delegate(results.dels[i], true, i+1)
@id_delegates[results.dels[i].id] = results.dels[i]
@delegate_active_hash_map[@active_delegates[i].name]=true
@avg_act_del_pay_rate+=@active_delegates[i].delegate_info.pay_rate
@avg_act_del_pay_rate=@avg_act_del_pay_rate/results.config.delegate_num
for i in [results.config.delegate_num ... results.dels.length]
@inactive_delegates[i - results.config.delegate_num] = @populate_delegate(results.dels[i], false, i+1)
@id_delegates[results.dels[i].id] = results.dels[i]
@delegate_inactive_hash_map[@inactive_delegates[i-results.config.delegate_num].name]=true
price_history: (quote_symbol, base_symbol, start_time, duration, granularity) ->
#@blockchain_api.market_price_history(quote_symbol, base_symbol, start_time, duration, granularity).then (result) ->
# console.log 'price_history -----', result
json = '''
[[
"20200101T175300",{
"highest_bid": {
"ratio": "0.045",
"quote_asset_id": 1,
"base_asset_id": 0
},
"lowest_ask": {
"ratio": "0.0656",
"quote_asset_id": 1,
"base_asset_id": 0
},
"volume": 1
}
],
"20200101T175400",{
"highest_bid": {
"ratio": "0.045",
"quote_asset_id": 1,
"base_asset_id": 0
},
"lowest_ask": {
"ratio": "0.0656",
"quote_asset_id": 1,
"base_asset_id": 0
},
"volume": 1
}
]
'''
deferred = @q.defer()
deferred.resolve(JSON.parse(json))
return deferred.promise
angular.module("app").service("Blockchain", ["Client", "NetworkAPI", "RpcService", "BlockchainAPI", "Utils", "$q", "$interval", Blockchain])
|
[
{
"context": " avatar: '//placehold.it/44x44'\n author: 'Elena Smith'\n like: '234'\n }\n {\n title: 'Sout",
"end": 183,
"score": 0.9998867511749268,
"start": 172,
"tag": "NAME",
"value": "Elena Smith"
},
{
"context": " avatar: '//placehold.it/44x44'\n ... | 14-06-04-video-panel/src/js/main.coffee | unmric/front-end-exercise | 0 | video_item_data =
ret : 0
item : [
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'Elena Smith'
like: '234'
}
]
template_cache = {}
template = (template, data) ->
content = template_cache[template]
unless content
content = "var s='';s+='" + template.replace(/[\r\t\n]/g, " ").split("'").join("\\'").replace(/\{\{#([\w]*)\}\}(.*)\{\{\/(\1)\}\}/g, (match, $1, $2) ->
"';var i=0,l=data." + $1 + ".length,d=data." + $1 + ";for(;i<l;i++){s+='" + $2.replace(/\{\{(\.|this)\}\}/g, "'+d[i]+'").replace(/\{\{([\w]*)\}\}/g, "'+d[i].$1+'") + "'}s+='"
).replace(/\{\{(.+?)\}\}/g, "'+data.$1+'") + "';return s;"
template_cache[template] = content
(if data then new Function("data", content)(data) else new Function("data", content))
$c = $ '.video-content'
add_video_item = (data)->
video_item_template = '{{#item}}
<div class="video-item"><img src="{{img}}" class="video-item__img">
<div class="video-item__over">
<div class="video-item__caption"><a href="" class="video-item__title">{{title}}</a><span class="video-item__line"></span><a href="{{url}}" class="video-item__play-button"></a></div>
<div class="video-item__author"><img src="{{avatar}}" class="video-item__avatar">By<a href="" class="video-item__name">{{author}}</a></div><a href="" class="video-item__like">{{like}}</a></div>
</div>{{/item}}'
$c.append template video_item_template, data
update_width()
update_width = ->
cw = $c.width()
item_width = cw / Math.floor cw / 300
$ '.video-item'
.width(item_width)
$ window
.on 'ready', ->
add_video_item video_item_data
$c.show()
.on 'resize', ->
update_width()
$ '.scroll-down__button'
.on 'click', (e)->
add_video_item video_item_data
e.preventDefault() | 221692 | video_item_data =
ret : 0
item : [
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: '<NAME>'
like: '234'
}
]
template_cache = {}
template = (template, data) ->
content = template_cache[template]
unless content
content = "var s='';s+='" + template.replace(/[\r\t\n]/g, " ").split("'").join("\\'").replace(/\{\{#([\w]*)\}\}(.*)\{\{\/(\1)\}\}/g, (match, $1, $2) ->
"';var i=0,l=data." + $1 + ".length,d=data." + $1 + ";for(;i<l;i++){s+='" + $2.replace(/\{\{(\.|this)\}\}/g, "'+d[i]+'").replace(/\{\{([\w]*)\}\}/g, "'+d[i].$1+'") + "'}s+='"
).replace(/\{\{(.+?)\}\}/g, "'+data.$1+'") + "';return s;"
template_cache[template] = content
(if data then new Function("data", content)(data) else new Function("data", content))
$c = $ '.video-content'
add_video_item = (data)->
video_item_template = '{{#item}}
<div class="video-item"><img src="{{img}}" class="video-item__img">
<div class="video-item__over">
<div class="video-item__caption"><a href="" class="video-item__title">{{title}}</a><span class="video-item__line"></span><a href="{{url}}" class="video-item__play-button"></a></div>
<div class="video-item__author"><img src="{{avatar}}" class="video-item__avatar">By<a href="" class="video-item__name">{{author}}</a></div><a href="" class="video-item__like">{{like}}</a></div>
</div>{{/item}}'
$c.append template video_item_template, data
update_width()
update_width = ->
cw = $c.width()
item_width = cw / Math.floor cw / 300
$ '.video-item'
.width(item_width)
$ window
.on 'ready', ->
add_video_item video_item_data
$c.show()
.on 'resize', ->
update_width()
$ '.scroll-down__button'
.on 'click', (e)->
add_video_item video_item_data
e.preventDefault() | true | video_item_data =
ret : 0
item : [
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-1@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-2@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-3@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
{
title: 'South America'
img: 'img/item-4@2x.jpg'
url: '#'
avatar: '//placehold.it/44x44'
author: 'PI:NAME:<NAME>END_PI'
like: '234'
}
]
template_cache = {}
template = (template, data) ->
content = template_cache[template]
unless content
content = "var s='';s+='" + template.replace(/[\r\t\n]/g, " ").split("'").join("\\'").replace(/\{\{#([\w]*)\}\}(.*)\{\{\/(\1)\}\}/g, (match, $1, $2) ->
"';var i=0,l=data." + $1 + ".length,d=data." + $1 + ";for(;i<l;i++){s+='" + $2.replace(/\{\{(\.|this)\}\}/g, "'+d[i]+'").replace(/\{\{([\w]*)\}\}/g, "'+d[i].$1+'") + "'}s+='"
).replace(/\{\{(.+?)\}\}/g, "'+data.$1+'") + "';return s;"
template_cache[template] = content
(if data then new Function("data", content)(data) else new Function("data", content))
$c = $ '.video-content'
add_video_item = (data)->
video_item_template = '{{#item}}
<div class="video-item"><img src="{{img}}" class="video-item__img">
<div class="video-item__over">
<div class="video-item__caption"><a href="" class="video-item__title">{{title}}</a><span class="video-item__line"></span><a href="{{url}}" class="video-item__play-button"></a></div>
<div class="video-item__author"><img src="{{avatar}}" class="video-item__avatar">By<a href="" class="video-item__name">{{author}}</a></div><a href="" class="video-item__like">{{like}}</a></div>
</div>{{/item}}'
$c.append template video_item_template, data
update_width()
update_width = ->
cw = $c.width()
item_width = cw / Math.floor cw / 300
$ '.video-item'
.width(item_width)
$ window
.on 'ready', ->
add_video_item video_item_data
$c.show()
.on 'resize', ->
update_width()
$ '.scroll-down__button'
.on 'click', (e)->
add_video_item video_item_data
e.preventDefault() |
[
{
"context": " 참고해주시기 바랍니다.\n\nnaver = {\n id = '네이버 아이디'\n pw = '네이버 비밀번호'\n chat-room = 'xxxxxxxxx:xxxxxxxxxxxxxx' # 채팅방",
"end": 184,
"score": 0.8133633136749268,
"start": 176,
"tag": "PASSWORD",
"value": "네이버 비밀번호"
},
{
"context": " ssh 여부\n nick = 'never' ... | sample-config.cson | yoo2001818/never-cafe-chat | 3 | # 이 파일은 샘플입니다.
# 이 파일을 복사하여 같은 경로에 config.cson 파일을 만들고 원하는 정보로 수정하시면 됩니다.
# 이 설정파일의 포맷에 대해서는 http://noe.mearie.org/cson/ 이 문서를 참고해주시기 바랍니다.
naver = {
id = '네이버 아이디'
pw = '네이버 비밀번호'
chat-room = 'xxxxxxxxx:xxxxxxxxxxxxxx' # 채팅방 ID
}
irc = {
server = 'irc.ozinger.org' # 봇이 들어갈 irc 서버.
port = 6667 # irc 서버 포트.
secure = false # ssh 여부
nick = 'never' # 봇 닉네임
channel = '#never_cafe_chat' # 접속할 irc 채널
optional-relay = false # 봇이 멘션된 경우에만 카페 채팅으로 중계
}
| 182881 | # 이 파일은 샘플입니다.
# 이 파일을 복사하여 같은 경로에 config.cson 파일을 만들고 원하는 정보로 수정하시면 됩니다.
# 이 설정파일의 포맷에 대해서는 http://noe.mearie.org/cson/ 이 문서를 참고해주시기 바랍니다.
naver = {
id = '네이버 아이디'
pw = '<PASSWORD>'
chat-room = 'xxxxxxxxx:xxxxxxxxxxxxxx' # 채팅방 ID
}
irc = {
server = 'irc.ozinger.org' # 봇이 들어갈 irc 서버.
port = 6667 # irc 서버 포트.
secure = false # ssh 여부
nick = 'never' # <NAME> 닉네임
channel = '#never_cafe_chat' # 접속할 irc 채널
optional-relay = false # 봇이 멘션된 경우에만 카페 채팅으로 중계
}
| true | # 이 파일은 샘플입니다.
# 이 파일을 복사하여 같은 경로에 config.cson 파일을 만들고 원하는 정보로 수정하시면 됩니다.
# 이 설정파일의 포맷에 대해서는 http://noe.mearie.org/cson/ 이 문서를 참고해주시기 바랍니다.
naver = {
id = '네이버 아이디'
pw = 'PI:PASSWORD:<PASSWORD>END_PI'
chat-room = 'xxxxxxxxx:xxxxxxxxxxxxxx' # 채팅방 ID
}
irc = {
server = 'irc.ozinger.org' # 봇이 들어갈 irc 서버.
port = 6667 # irc 서버 포트.
secure = false # ssh 여부
nick = 'never' # PI:NAME:<NAME>END_PI 닉네임
channel = '#never_cafe_chat' # 접속할 irc 채널
optional-relay = false # 봇이 멘션된 경우에만 카페 채팅으로 중계
}
|
[
{
"context": "elper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->\n ",
"end": 434,
"score": 0.9997072219848633,
"start": 430,
"tag": "NAME",
"value": "John"
},
{
"context": "ay.customer.create {firstName: 'John', lastName: 'Smith'}, ... | spec/integration/braintree/payment_method_gateway_spec.coffee | StreamCo/braintree_node | 0 | require('../../spec_helper')
_ = require('underscore')._
braintree = specHelper.braintree
util = require('util')
{Config} = require('../../../lib/braintree/config')
{Nonces} = require('../../../lib/braintree/test/nonces')
describe "PaymentMethodGateway", ->
describe "create", ->
customerId = null
it 'works with an unknown payment method nonce', (done) ->
specHelper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->
customerId = response.customer.id
paymentMethodParams =
customerId: customerId
paymentMethodNonce: Nonces.AbstractTransactable
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isNotNull(response.paymentMethod.token)
done()
context 'Apple Pay', ->
it "vaults an Apple Pay card from the nonce", (done) ->
specHelper.defaultGateway.customer.create {firstName: 'John', lastName: 'Appleseed'}, (err, response) ->
customerId = response.customer.id
paymentMethodParams =
customerId: customerId
paymentMethodNonce: Nonces.ApplePayAmEx
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isNotNull(response.paymentMethod.token)
assert.isNotNull(response.paymentMethod.card_type)
done()
context 'with a credit card payment method nonce', ->
it 'creates a credit card from the nonce', (done) ->
specHelper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.maskedNumber, '411111******1111')
done()
it 'respects verify_card and verification_merchant_account_id when included outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4000111111111115'
expirationMonth: '11'
expirationYear: '2099'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
options:
verifyCard: "true"
verificationMerchantAccountId: specHelper.nonDefaultMerchantAccountId
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
assert.equal(response.verification.merchantAccountId, specHelper.nonDefaultMerchantAccountId)
done()
it 'respects failOnDuplicatePaymentMethod when included outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4111111111111111'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '05/2012'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
options:
failOnDuplicatePaymentMethod: 'true'
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.errors.deepErrors()[0].code, '81724')
done()
it 'allows passing the billing address outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "123 Abc Way")
done()
it 'overrides the billing address in the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
billingAddress:
streetAddress: "456 Xyz Way"
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "123 Abc Way")
done()
it 'does not override the billing address for a vaulted credit card', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
billingAddress:
streetAddress: "456 Xyz Way"
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
assert.equal(statusCode, "201")
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "456 Xyz Way")
done()
it 'allows passing a billing address id outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
addressParams =
customerId: customerId
firstName: "Bobby"
lastName: "Tables"
specHelper.defaultGateway.address.create addressParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddressId: response.address.id
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.firstName, "Bobby")
assert.equal(creditCard.billingAddress.lastName, "Tables")
done()
context 'with a paypal account payment method nonce', ->
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->
customerId = response.customer.id
done()
it 'does not return an error if credit card options are present for a paypal nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
options:
verifyCard: "true"
failOnDuplicatePaymentMethod: "true"
verificationMerchantAccountId: "notARealMerchantAccountId"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it 'ignores passed billing address params', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it 'ignores passed billing address id', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddressId: "address_id"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it "creates a paypal account from a payment method nonce", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isString(response.paymentMethod.email)
assert.isString(response.paymentMethod.imageUrl)
done()
it "can create a payment method and set the token and default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
creditCardParams =
customerId: response.customer.id
number: '5105105105105100'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodToken = specHelper.randomId()
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
token: paymentMethodToken
options:
makeDefault: true
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.default)
assert.equal(paymentMethodToken, response.paymentMethod.token)
done()
it "returns an error when trying to create a paypal account only authorized for one-time use", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
paypalAccount: {
accessToken: 'PAYPAL_ACCESS_TOKEN'
}
}
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(
response.errors.for('paypalAccount').on('base')[0].code,
'82902'
)
done()
it "handles errors", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
paypalAccount: {}
}
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.errors.for('paypalAccount').on('base')[0].code, '82902')
done()
context 'with a fake apple pay nonce', ->
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->
customerId = response.customer.id
done()
it 'creates a payment method', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
applePayCardParams =
paymentMethodNonce: Nonces.ApplePayMasterCard
customerId: customerId
specHelper.defaultGateway.paymentMethod.create applePayCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, applePayCard) ->
assert.isNull(err)
assert.isTrue(applePayCard != null)
done()
describe "find", ->
context 'credit card', ->
paymentMethodToken = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->
customerId = response.customer.id
paymentMethodToken = specHelper.randomId()
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
token: paymentMethodToken
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, creditCard) ->
done()
it 'finds the card', (done) ->
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '411111******1111')
done()
context 'paypal account', ->
it "finds the paypal account", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
paymentMethodParams =
customerId: response.customer.id
paymentMethodNonce: Nonces.PayPalFuturePayment
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, paypalAccount) ->
assert.isNull(err)
assert.isString(paypalAccount.email)
done()
context 'unkown payment method', ->
it "finds the unknown payment method", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
paymentMethodParams =
customerId: response.customer.id
paymentMethodNonce: Nonces.AbstractTransactable
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, paymentMethod) ->
assert.isNull(err)
assert.isString(paymentMethod.token)
done()
it "handles not finding the paypal account", (done) ->
specHelper.defaultGateway.paymentMethod.find 'NON_EXISTENT_TOKEN', (err, paypalAccount) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles whitespace", (done) ->
specHelper.defaultGateway.paymentMethod.find ' ', (err, paypalAccount) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "update", ->
context 'credit card', ->
it "updates the credit card", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: 'Original Holder'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: 'New Holder'
cvv: '456'
number: '5555555555554444'
expirationDate: '06/2013'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.token, creditCard.token)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.cardholderName, 'New Holder')
assert.equal(updatedCreditCard.bin, '555555')
assert.equal(updatedCreditCard.last4, '4444')
assert.equal(updatedCreditCard.expirationDate, '06/2013')
done()
it "handles a not found error correctly", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
updateParams =
cardholderName: 'New Holder'
cvv: '456'
number: '5555555555554444'
expirationDate: '06/2013'
specHelper.defaultGateway.paymentMethod.update "doesNotExist", updateParams, (err, response) ->
assert.isNull(response)
assert.isNotNull(err)
done()
it "can pass expirationMonth and expirationYear", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
expirationMonth: '07'
expirationYear: '2011'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.expirationMonth, '07')
assert.equal(updatedCreditCard.expirationYear, '2011')
assert.equal(updatedCreditCard.expirationDate, '07/2011')
done()
it "verifies the update if options[verify_card]=true", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: 'Original Holder'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: 'New Holder'
cvv: '456'
number: '5105105105105100'
expirationDate: '06/2013'
options:
verifyCard: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.isNull(response.verification.gatewayRejectionReason)
done()
it "returns an error if invalid", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: 'Original Holder'
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: 'New Holder'
number: 'invalid'
expirationDate: '05/2014'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.errors.for('creditCard').on('number')[0].message, "Credit card number must be 12-19 digits.")
done()
it "can update the default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2009'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard1 = response.creditCard
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard2 = response.creditCard
assert.isTrue(creditCard1.default)
assert.isFalse(creditCard2.default)
updateParams =
options:
makeDefault: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard2.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paymentMethod.find creditCard1.token, (err, creditCard) ->
assert.isNull(err)
assert.isFalse(creditCard.default)
specHelper.defaultGateway.paymentMethod.find creditCard2.token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard.default)
done()
context 'billing address', ->
it "creates a new billing address by default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
region: "IL"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.region, 'IL')
assert.isNull(updatedCreditCard.billingAddress.streetAddress)
differentAddresses = (updatedCreditCard.billingAddress.id != creditCard.billingAddress.id)
assert.isTrue(differentAddresses)
done()
it "updates the billing address if option is specified", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
options:
updateExisting: 'true'
region: "IL"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.region, 'IL')
assert.equal(updatedCreditCard.billingAddress.streetAddress, '123 Nigeria Ave')
sameAddresses = (updatedCreditCard.billingAddress.id == creditCard.billingAddress.id)
assert.isTrue(sameAddresses)
done()
it "updates the country via codes", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
countryName: "American Samoa"
countryCodeAlpha2: "AS"
countryCodeAlpha3: "ASM"
countryCodeNumeric: "016"
options:
updateExisting: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.countryName, 'American Samoa')
assert.equal(updatedCreditCard.billingAddress.countryCodeAlpha2, 'AS')
assert.equal(updatedCreditCard.billingAddress.countryCodeAlpha3, 'ASM')
assert.equal(updatedCreditCard.billingAddress.countryCodeNumeric, '016')
done()
it "can update the billing address", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholder_name: 'Original Holder'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
firstName: "Old First Name"
lastName: "Old Last Name"
Company: "Old Company"
streetAddress: "123 Old St"
extendedAddress: "Apt Old"
locality: "Old City"
region: "Old State"
postalCode: "12345"
countryName: "Canada"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
options:
verifyCard: 'false'
billingAddress:
firstName: "New First Name"
lastName: "New Last Name"
company: "New Company"
streetAddress: "123 New St"
extendedAddress: "Apt New"
locality: "New City"
region: "New State"
postalCode: "56789"
countryName: "United States of America"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
address = response.paymentMethod.billingAddress
assert.equal(address.firstName, "New First Name")
assert.equal(address.lastName, "New Last Name")
assert.equal(address.company, "New Company")
assert.equal(address.streetAddress, "123 New St")
assert.equal(address.extendedAddress, "Apt New")
assert.equal(address.locality, "New City")
assert.equal(address.region, "New State")
assert.equal(address.postalCode, "56789")
assert.equal(address.countryName, "United States of America")
done()
context 'paypal accounts', ->
it "updates a paypal account's token", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
originalToken = "paypal-account-#{specHelper.randomId()}"
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: originalToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
originalResult = response.paymentMethod
updatedToken = "UPDATED-TOKEN-#{specHelper.randomId()}"
updateParams =
token: updatedToken
specHelper.defaultGateway.paymentMethod.update originalToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paypalAccount.find updatedToken, (err, paypalAccount) ->
assert.isNull(err)
assert.equal(paypalAccount.email, originalResult.email)
specHelper.defaultGateway.paypalAccount.find originalToken, (err, paypalAccount) ->
assert.isNull(paypalAccount)
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "can make a paypal account the default payment method", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: 'Original Holder'
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2009'
options:
makeDefault: 'true'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
originalToken = response.paymentMethod.token
assert.isFalse(response.paymentMethod.default)
updateParams =
options:
makeDefault: 'true'
specHelper.defaultGateway.paymentMethod.update originalToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paypalAccount.find originalToken, (err, paypalAccount) ->
assert.isTrue(paypalAccount.default)
specHelper.defaultGateway.creditCard.find creditCard.token, (err, creditCard) ->
assert.isFalse(creditCard.default)
done()
it "returns an error if a token for account is used to attempt an update", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
firstToken = "paypal-account-#{specHelper.randomId()}"
secondToken = "paypal-account-#{specHelper.randomId()}"
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: firstToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
firstNonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: firstNonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
firstResult = response.paymentMethod
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: secondToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
secondNonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: secondNonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
secondResult = response.paymentMethod
updateParams =
token: secondToken
specHelper.defaultGateway.paymentMethod.update firstToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.errors.deepErrors()[0].code, "92906")
done()
describe "delete", (done) ->
paymentMethodToken = null
context 'credit card', ->
before (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
done()
it 'deletes the credit card', (done) ->
specHelper.defaultGateway.paymentMethod.delete paymentMethodToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
context 'paypal account', ->
before (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
done()
it "deletes the paypal account", (done) ->
specHelper.defaultGateway.paymentMethod.delete paymentMethodToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.paypalAccount.find paymentMethodToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles invalid tokens", (done) ->
specHelper.defaultGateway.paymentMethod.delete 'NONEXISTENT_TOKEN', (err) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
| 27018 | require('../../spec_helper')
_ = require('underscore')._
braintree = specHelper.braintree
util = require('util')
{Config} = require('../../../lib/braintree/config')
{Nonces} = require('../../../lib/braintree/test/nonces')
describe "PaymentMethodGateway", ->
describe "create", ->
customerId = null
it 'works with an unknown payment method nonce', (done) ->
specHelper.defaultGateway.customer.create {firstName: '<NAME>', lastName: '<NAME>'}, (err, response) ->
customerId = response.customer.id
paymentMethodParams =
customerId: customerId
paymentMethodNonce: Nonces.AbstractTransactable
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isNotNull(response.paymentMethod.token)
done()
context 'Apple Pay', ->
it "vaults an Apple Pay card from the nonce", (done) ->
specHelper.defaultGateway.customer.create {firstName: '<NAME>', lastName: '<NAME>'}, (err, response) ->
customerId = response.customer.id
paymentMethodParams =
customerId: customerId
paymentMethodNonce: Nonces.ApplePayAmEx
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isNotNull(response.paymentMethod.token)
assert.isNotNull(response.paymentMethod.card_type)
done()
context 'with a credit card payment method nonce', ->
it 'creates a credit card from the nonce', (done) ->
specHelper.defaultGateway.customer.create {firstName: '<NAME>', lastName: '<NAME>'}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.maskedNumber, '411111******1111')
done()
it 'respects verify_card and verification_merchant_account_id when included outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4000111111111115'
expirationMonth: '11'
expirationYear: '2099'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
options:
verifyCard: "true"
verificationMerchantAccountId: specHelper.nonDefaultMerchantAccountId
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
assert.equal(response.verification.merchantAccountId, specHelper.nonDefaultMerchantAccountId)
done()
it 'respects failOnDuplicatePaymentMethod when included outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4111111111111111'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '05/2012'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
options:
failOnDuplicatePaymentMethod: 'true'
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.errors.deepErrors()[0].code, '81724')
done()
it 'allows passing the billing address outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "123 Abc Way")
done()
it 'overrides the billing address in the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
billingAddress:
streetAddress: "456 Xyz Way"
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "123 Abc Way")
done()
it 'does not override the billing address for a vaulted credit card', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
billingAddress:
streetAddress: "456 Xyz Way"
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
assert.equal(statusCode, "201")
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "456 Xyz Way")
done()
it 'allows passing a billing address id outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
addressParams =
customerId: customerId
firstName: "<NAME>"
lastName: "<NAME>"
specHelper.defaultGateway.address.create addressParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddressId: response.address.id
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.firstName, "<NAME>")
assert.equal(creditCard.billingAddress.lastName, "<NAME>")
done()
context 'with a paypal account payment method nonce', ->
before (done) ->
specHelper.defaultGateway.customer.create {firstName: '<NAME>', lastName: '<NAME>'}, (err, response) ->
customerId = response.customer.id
done()
it 'does not return an error if credit card options are present for a paypal nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
options:
verifyCard: "true"
failOnDuplicatePaymentMethod: "true"
verificationMerchantAccountId: "notARealMerchantAccountId"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it 'ignores passed billing address params', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it 'ignores passed billing address id', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddressId: "address_id"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it "creates a paypal account from a payment method nonce", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isString(response.paymentMethod.email)
assert.isString(response.paymentMethod.imageUrl)
done()
it "can create a payment method and set the token and default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
creditCardParams =
customerId: response.customer.id
number: '5105105105105100'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodToken = specHelper.random<PASSWORD>()
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
token: paymentMethodToken
options:
makeDefault: true
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.default)
assert.equal(paymentMethodToken, response.paymentMethod.token)
done()
it "returns an error when trying to create a paypal account only authorized for one-time use", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
paypalAccount: {
accessToken: 'PAYPAL_ACCESS_TOKEN'
}
}
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(
response.errors.for('paypalAccount').on('base')[0].code,
'82902'
)
done()
it "handles errors", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
paypalAccount: {}
}
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.errors.for('paypalAccount').on('base')[0].code, '82902')
done()
context 'with a fake apple pay nonce', ->
before (done) ->
specHelper.defaultGateway.customer.create {firstName: '<NAME>', lastName: '<NAME>'}, (err, response) ->
customerId = response.customer.id
done()
it 'creates a payment method', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
applePayCardParams =
paymentMethodNonce: Nonces.ApplePayMasterCard
customerId: customerId
specHelper.defaultGateway.paymentMethod.create applePayCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, applePayCard) ->
assert.isNull(err)
assert.isTrue(applePayCard != null)
done()
describe "find", ->
context 'credit card', ->
paymentMethodToken = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: '<NAME>', lastName: '<NAME>'}, (err, response) ->
customerId = response.customer.id
paymentMethodToken = specHelper.randomId()
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
token: paymentMethodToken
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, creditCard) ->
done()
it 'finds the card', (done) ->
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '411111******1111')
done()
context 'paypal account', ->
it "finds the paypal account", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
paymentMethodParams =
customerId: response.customer.id
paymentMethodNonce: Nonces.PayPalFuturePayment
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, paypalAccount) ->
assert.isNull(err)
assert.isString(paypalAccount.email)
done()
context 'unkown payment method', ->
it "finds the unknown payment method", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
paymentMethodParams =
customerId: response.customer.id
paymentMethodNonce: Nonces.AbstractTransactable
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, paymentMethod) ->
assert.isNull(err)
assert.isString(paymentMethod.token)
done()
it "handles not finding the paypal account", (done) ->
specHelper.defaultGateway.paymentMethod.find 'NON_EXISTENT_TOKEN', (err, paypalAccount) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles whitespace", (done) ->
specHelper.defaultGateway.paymentMethod.find ' ', (err, paypalAccount) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "update", ->
context 'credit card', ->
it "updates the credit card", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: '<NAME>'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: '<NAME>'
cvv: '456'
number: '5555555555554444'
expirationDate: '06/2013'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.token, creditCard.token)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.cardholderName, '<NAME>')
assert.equal(updatedCreditCard.bin, '555555')
assert.equal(updatedCreditCard.last4, '4444')
assert.equal(updatedCreditCard.expirationDate, '06/2013')
done()
it "handles a not found error correctly", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
updateParams =
cardholderName: '<NAME>'
cvv: '456'
number: '5555555555554444'
expirationDate: '06/2013'
specHelper.defaultGateway.paymentMethod.update "doesNotExist", updateParams, (err, response) ->
assert.isNull(response)
assert.isNotNull(err)
done()
it "can pass expirationMonth and expirationYear", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
expirationMonth: '07'
expirationYear: '2011'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.expirationMonth, '07')
assert.equal(updatedCreditCard.expirationYear, '2011')
assert.equal(updatedCreditCard.expirationDate, '07/2011')
done()
it "verifies the update if options[verify_card]=true", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: '<NAME>'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: '<NAME>'
cvv: '456'
number: '5105105105105100'
expirationDate: '06/2013'
options:
verifyCard: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.isNull(response.verification.gatewayRejectionReason)
done()
it "returns an error if invalid", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: '<NAME>'
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: '<NAME>'
number: 'invalid'
expirationDate: '05/2014'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.errors.for('creditCard').on('number')[0].message, "Credit card number must be 12-19 digits.")
done()
it "can update the default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2009'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard1 = response.creditCard
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard2 = response.creditCard
assert.isTrue(creditCard1.default)
assert.isFalse(creditCard2.default)
updateParams =
options:
makeDefault: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard2.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paymentMethod.find creditCard1.token, (err, creditCard) ->
assert.isNull(err)
assert.isFalse(creditCard.default)
specHelper.defaultGateway.paymentMethod.find creditCard2.token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard.default)
done()
context 'billing address', ->
it "creates a new billing address by default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
region: "IL"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.region, 'IL')
assert.isNull(updatedCreditCard.billingAddress.streetAddress)
differentAddresses = (updatedCreditCard.billingAddress.id != creditCard.billingAddress.id)
assert.isTrue(differentAddresses)
done()
it "updates the billing address if option is specified", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
options:
updateExisting: 'true'
region: "IL"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.region, 'IL')
assert.equal(updatedCreditCard.billingAddress.streetAddress, '123 Nigeria Ave')
sameAddresses = (updatedCreditCard.billingAddress.id == creditCard.billingAddress.id)
assert.isTrue(sameAddresses)
done()
it "updates the country via codes", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
countryName: "American Samoa"
countryCodeAlpha2: "AS"
countryCodeAlpha3: "ASM"
countryCodeNumeric: "016"
options:
updateExisting: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.countryName, 'American Samoa')
assert.equal(updatedCreditCard.billingAddress.countryCodeAlpha2, 'AS')
assert.equal(updatedCreditCard.billingAddress.countryCodeAlpha3, 'ASM')
assert.equal(updatedCreditCard.billingAddress.countryCodeNumeric, '016')
done()
it "can update the billing address", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholder_name: '<NAME>'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
firstName: "<NAME>"
lastName: "Old <NAME>"
Company: "Old Company"
streetAddress: "123 Old St"
extendedAddress: "Apt Old"
locality: "Old City"
region: "Old State"
postalCode: "12345"
countryName: "Canada"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
options:
verifyCard: 'false'
billingAddress:
firstName: "<NAME>"
lastName: "<NAME>"
company: "New Company"
streetAddress: "123 New St"
extendedAddress: "Apt New"
locality: "New City"
region: "New State"
postalCode: "56789"
countryName: "United States of America"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
address = response.paymentMethod.billingAddress
assert.equal(address.firstName, "New First Name")
assert.equal(address.lastName, "New Last Name")
assert.equal(address.company, "New Company")
assert.equal(address.streetAddress, "123 New St")
assert.equal(address.extendedAddress, "Apt New")
assert.equal(address.locality, "New City")
assert.equal(address.region, "New State")
assert.equal(address.postalCode, "56789")
assert.equal(address.countryName, "United States of America")
done()
context 'paypal accounts', ->
it "updates a paypal account's token", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
originalToken = "<PASSWORD>-#{specHelper.randomId()}"
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: originalToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
originalResult = response.paymentMethod
updatedToken = "<PASSWORD>-#{specHelper.randomId()}"
updateParams =
token: updatedToken
specHelper.defaultGateway.paymentMethod.update originalToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paypalAccount.find updatedToken, (err, paypalAccount) ->
assert.isNull(err)
assert.equal(paypalAccount.email, originalResult.email)
specHelper.defaultGateway.paypalAccount.find originalToken, (err, paypalAccount) ->
assert.isNull(paypalAccount)
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "can make a paypal account the default payment method", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: '<NAME>'
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2009'
options:
makeDefault: 'true'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
originalToken = response.paymentMethod.token
assert.isFalse(response.paymentMethod.default)
updateParams =
options:
makeDefault: 'true'
specHelper.defaultGateway.paymentMethod.update originalToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paypalAccount.find originalToken, (err, paypalAccount) ->
assert.isTrue(paypalAccount.default)
specHelper.defaultGateway.creditCard.find creditCard.token, (err, creditCard) ->
assert.isFalse(creditCard.default)
done()
it "returns an error if a token for account is used to attempt an update", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
firstToken = "<KEY>#{specHelper.randomId()}"
secondToken = "<KEY>#{specHelper.randomId()}"
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: firstToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
firstNonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: firstNonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
firstResult = response.paymentMethod
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: secondToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
secondNonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: secondNonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
secondResult = response.paymentMethod
updateParams =
token: secondToken
specHelper.defaultGateway.paymentMethod.update firstToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.errors.deepErrors()[0].code, "92906")
done()
describe "delete", (done) ->
paymentMethodToken = null
context 'credit card', ->
before (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
done()
it 'deletes the credit card', (done) ->
specHelper.defaultGateway.paymentMethod.delete paymentMethodToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
context 'paypal account', ->
before (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
done()
it "deletes the paypal account", (done) ->
specHelper.defaultGateway.paymentMethod.delete paymentMethodToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.paypalAccount.find paymentMethodToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles invalid tokens", (done) ->
specHelper.defaultGateway.paymentMethod.delete 'NONEXISTENT_TOKEN', (err) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
| true | require('../../spec_helper')
_ = require('underscore')._
braintree = specHelper.braintree
util = require('util')
{Config} = require('../../../lib/braintree/config')
{Nonces} = require('../../../lib/braintree/test/nonces')
describe "PaymentMethodGateway", ->
describe "create", ->
customerId = null
it 'works with an unknown payment method nonce', (done) ->
specHelper.defaultGateway.customer.create {firstName: 'PI:NAME:<NAME>END_PI', lastName: 'PI:NAME:<NAME>END_PI'}, (err, response) ->
customerId = response.customer.id
paymentMethodParams =
customerId: customerId
paymentMethodNonce: Nonces.AbstractTransactable
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isNotNull(response.paymentMethod.token)
done()
context 'Apple Pay', ->
it "vaults an Apple Pay card from the nonce", (done) ->
specHelper.defaultGateway.customer.create {firstName: 'PI:NAME:<NAME>END_PI', lastName: 'PI:NAME:<NAME>END_PI'}, (err, response) ->
customerId = response.customer.id
paymentMethodParams =
customerId: customerId
paymentMethodNonce: Nonces.ApplePayAmEx
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isNotNull(response.paymentMethod.token)
assert.isNotNull(response.paymentMethod.card_type)
done()
context 'with a credit card payment method nonce', ->
it 'creates a credit card from the nonce', (done) ->
specHelper.defaultGateway.customer.create {firstName: 'PI:NAME:<NAME>END_PI', lastName: 'PI:NAME:<NAME>END_PI'}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.maskedNumber, '411111******1111')
done()
it 'respects verify_card and verification_merchant_account_id when included outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4000111111111115'
expirationMonth: '11'
expirationYear: '2099'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
options:
verifyCard: "true"
verificationMerchantAccountId: specHelper.nonDefaultMerchantAccountId
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
assert.equal(response.verification.merchantAccountId, specHelper.nonDefaultMerchantAccountId)
done()
it 'respects failOnDuplicatePaymentMethod when included outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4111111111111111'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '05/2012'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
options:
failOnDuplicatePaymentMethod: 'true'
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.errors.deepErrors()[0].code, '81724')
done()
it 'allows passing the billing address outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "123 Abc Way")
done()
it 'overrides the billing address in the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
billingAddress:
streetAddress: "456 Xyz Way"
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "123 Abc Way")
done()
it 'does not override the billing address for a vaulted credit card', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
billingAddress:
streetAddress: "456 Xyz Way"
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
assert.equal(statusCode, "201")
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.streetAddress, "456 Xyz Way")
done()
it 'allows passing a billing address id outside of the nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationMonth: '12'
expirationYear: '2020'
options:
validate: 'false'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
addressParams =
customerId: customerId
firstName: "PI:NAME:<NAME>END_PI"
lastName: "PI:NAME:<NAME>END_PI"
specHelper.defaultGateway.address.create addressParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
creditCardParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddressId: response.address.id
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.constructor.name == "CreditCard")
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard != null)
assert.equal(creditCard.billingAddress.firstName, "PI:NAME:<NAME>END_PI")
assert.equal(creditCard.billingAddress.lastName, "PI:NAME:<NAME>END_PI")
done()
context 'with a paypal account payment method nonce', ->
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'PI:NAME:<NAME>END_PI', lastName: 'PI:NAME:<NAME>END_PI'}, (err, response) ->
customerId = response.customer.id
done()
it 'does not return an error if credit card options are present for a paypal nonce', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
options:
verifyCard: "true"
failOnDuplicatePaymentMethod: "true"
verificationMerchantAccountId: "notARealMerchantAccountId"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it 'ignores passed billing address params', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddress:
streetAddress: "123 Abc Way"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it 'ignores passed billing address id', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
billingAddressId: "address_id"
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.constructor.name, "PayPalAccount")
assert.isTrue(response.paymentMethod.imageUrl != null)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, paypalAccount) ->
assert.isNull(err)
assert.isTrue(paypalAccount != null)
done()
it "creates a paypal account from a payment method nonce", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isString(response.paymentMethod.email)
assert.isString(response.paymentMethod.imageUrl)
done()
it "can create a payment method and set the token and default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
creditCardParams =
customerId: response.customer.id
number: '5105105105105100'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodToken = specHelper.randomPI:PASSWORD:<PASSWORD>END_PI()
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
token: paymentMethodToken
options:
makeDefault: true
specHelper.defaultGateway.paymentMethod.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.isTrue(response.paymentMethod.default)
assert.equal(paymentMethodToken, response.paymentMethod.token)
done()
it "returns an error when trying to create a paypal account only authorized for one-time use", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
paypalAccount: {
accessToken: 'PAYPAL_ACCESS_TOKEN'
}
}
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(
response.errors.for('paypalAccount').on('base')[0].code,
'82902'
)
done()
it "handles errors", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
paypalAccount: {}
}
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.errors.for('paypalAccount').on('base')[0].code, '82902')
done()
context 'with a fake apple pay nonce', ->
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'PI:NAME:<NAME>END_PI', lastName: 'PI:NAME:<NAME>END_PI'}, (err, response) ->
customerId = response.customer.id
done()
it 'creates a payment method', (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
applePayCardParams =
paymentMethodNonce: Nonces.ApplePayMasterCard
customerId: customerId
specHelper.defaultGateway.paymentMethod.create applePayCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
token = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find token, (err, applePayCard) ->
assert.isNull(err)
assert.isTrue(applePayCard != null)
done()
describe "find", ->
context 'credit card', ->
paymentMethodToken = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'PI:NAME:<NAME>END_PI', lastName: 'PI:NAME:<NAME>END_PI'}, (err, response) ->
customerId = response.customer.id
paymentMethodToken = specHelper.randomId()
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
token: paymentMethodToken
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, creditCard) ->
done()
it 'finds the card', (done) ->
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '411111******1111')
done()
context 'paypal account', ->
it "finds the paypal account", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
paymentMethodParams =
customerId: response.customer.id
paymentMethodNonce: Nonces.PayPalFuturePayment
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, paypalAccount) ->
assert.isNull(err)
assert.isString(paypalAccount.email)
done()
context 'unkown payment method', ->
it "finds the unknown payment method", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
paymentMethodParams =
customerId: response.customer.id
paymentMethodNonce: Nonces.AbstractTransactable
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, paymentMethod) ->
assert.isNull(err)
assert.isString(paymentMethod.token)
done()
it "handles not finding the paypal account", (done) ->
specHelper.defaultGateway.paymentMethod.find 'NON_EXISTENT_TOKEN', (err, paypalAccount) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles whitespace", (done) ->
specHelper.defaultGateway.paymentMethod.find ' ', (err, paypalAccount) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "update", ->
context 'credit card', ->
it "updates the credit card", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
cvv: '456'
number: '5555555555554444'
expirationDate: '06/2013'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.paymentMethod.token, creditCard.token)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.cardholderName, 'PI:NAME:<NAME>END_PI')
assert.equal(updatedCreditCard.bin, '555555')
assert.equal(updatedCreditCard.last4, '4444')
assert.equal(updatedCreditCard.expirationDate, '06/2013')
done()
it "handles a not found error correctly", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
updateParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
cvv: '456'
number: '5555555555554444'
expirationDate: '06/2013'
specHelper.defaultGateway.paymentMethod.update "doesNotExist", updateParams, (err, response) ->
assert.isNull(response)
assert.isNotNull(err)
done()
it "can pass expirationMonth and expirationYear", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
expirationMonth: '07'
expirationYear: '2011'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.expirationMonth, '07')
assert.equal(updatedCreditCard.expirationYear, '2011')
assert.equal(updatedCreditCard.expirationDate, '07/2011')
done()
it "verifies the update if options[verify_card]=true", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
cvv: '456'
number: '5105105105105100'
expirationDate: '06/2013'
options:
verifyCard: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.isNull(response.verification.gatewayRejectionReason)
done()
it "returns an error if invalid", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
number: 'invalid'
expirationDate: '05/2014'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.errors.for('creditCard').on('number')[0].message, "Credit card number must be 12-19 digits.")
done()
it "can update the default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2009'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard1 = response.creditCard
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard2 = response.creditCard
assert.isTrue(creditCard1.default)
assert.isFalse(creditCard2.default)
updateParams =
options:
makeDefault: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard2.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paymentMethod.find creditCard1.token, (err, creditCard) ->
assert.isNull(err)
assert.isFalse(creditCard.default)
specHelper.defaultGateway.paymentMethod.find creditCard2.token, (err, creditCard) ->
assert.isNull(err)
assert.isTrue(creditCard.default)
done()
context 'billing address', ->
it "creates a new billing address by default", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
region: "IL"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.region, 'IL')
assert.isNull(updatedCreditCard.billingAddress.streetAddress)
differentAddresses = (updatedCreditCard.billingAddress.id != creditCard.billingAddress.id)
assert.isTrue(differentAddresses)
done()
it "updates the billing address if option is specified", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
options:
updateExisting: 'true'
region: "IL"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.region, 'IL')
assert.equal(updatedCreditCard.billingAddress.streetAddress, '123 Nigeria Ave')
sameAddresses = (updatedCreditCard.billingAddress.id == creditCard.billingAddress.id)
assert.isTrue(sameAddresses)
done()
it "updates the country via codes", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
streetAddress: "123 Nigeria Ave"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
billingAddress:
countryName: "American Samoa"
countryCodeAlpha2: "AS"
countryCodeAlpha3: "ASM"
countryCodeNumeric: "016"
options:
updateExisting: 'true'
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
updatedCreditCard = response.paymentMethod
assert.equal(updatedCreditCard.billingAddress.countryName, 'American Samoa')
assert.equal(updatedCreditCard.billingAddress.countryCodeAlpha2, 'AS')
assert.equal(updatedCreditCard.billingAddress.countryCodeAlpha3, 'ASM')
assert.equal(updatedCreditCard.billingAddress.countryCodeNumeric, '016')
done()
it "can update the billing address", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholder_name: 'PI:NAME:<NAME>END_PI'
customerId: customerId
cvv: '123'
number: '4012888888881881'
expirationDate: '05/2012'
billingAddress:
firstName: "PI:NAME:<NAME>END_PI"
lastName: "Old PI:NAME:<NAME>END_PI"
Company: "Old Company"
streetAddress: "123 Old St"
extendedAddress: "Apt Old"
locality: "Old City"
region: "Old State"
postalCode: "12345"
countryName: "Canada"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
updateParams =
options:
verifyCard: 'false'
billingAddress:
firstName: "PI:NAME:<NAME>END_PI"
lastName: "PI:NAME:<NAME>END_PI"
company: "New Company"
streetAddress: "123 New St"
extendedAddress: "Apt New"
locality: "New City"
region: "New State"
postalCode: "56789"
countryName: "United States of America"
specHelper.defaultGateway.paymentMethod.update creditCard.token, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
address = response.paymentMethod.billingAddress
assert.equal(address.firstName, "New First Name")
assert.equal(address.lastName, "New Last Name")
assert.equal(address.company, "New Company")
assert.equal(address.streetAddress, "123 New St")
assert.equal(address.extendedAddress, "Apt New")
assert.equal(address.locality, "New City")
assert.equal(address.region, "New State")
assert.equal(address.postalCode, "56789")
assert.equal(address.countryName, "United States of America")
done()
context 'paypal accounts', ->
it "updates a paypal account's token", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
originalToken = "PI:PASSWORD:<PASSWORD>END_PI-#{specHelper.randomId()}"
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: originalToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
originalResult = response.paymentMethod
updatedToken = "PI:PASSWORD:<PASSWORD>END_PI-#{specHelper.randomId()}"
updateParams =
token: updatedToken
specHelper.defaultGateway.paymentMethod.update originalToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paypalAccount.find updatedToken, (err, paypalAccount) ->
assert.isNull(err)
assert.equal(paypalAccount.email, originalResult.email)
specHelper.defaultGateway.paypalAccount.find originalToken, (err, paypalAccount) ->
assert.isNull(paypalAccount)
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "can make a paypal account the default payment method", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
creditCardParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
customerId: customerId
number: '4012888888881881'
expirationDate: '05/2009'
options:
makeDefault: 'true'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isTrue(response.success)
creditCard = response.creditCard
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: nonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
originalToken = response.paymentMethod.token
assert.isFalse(response.paymentMethod.default)
updateParams =
options:
makeDefault: 'true'
specHelper.defaultGateway.paymentMethod.update originalToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
specHelper.defaultGateway.paypalAccount.find originalToken, (err, paypalAccount) ->
assert.isTrue(paypalAccount.default)
specHelper.defaultGateway.creditCard.find creditCard.token, (err, creditCard) ->
assert.isFalse(creditCard.default)
done()
it "returns an error if a token for account is used to attempt an update", (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
firstToken = "PI:KEY:<KEY>END_PI#{specHelper.randomId()}"
secondToken = "PI:KEY:<KEY>END_PI#{specHelper.randomId()}"
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: firstToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
firstNonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: firstNonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
firstResult = response.paymentMethod
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'consent-code'
token: secondToken
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
secondNonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
paymentMethodNonce: secondNonce
customerId: customerId
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
secondResult = response.paymentMethod
updateParams =
token: secondToken
specHelper.defaultGateway.paymentMethod.update firstToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.errors.deepErrors()[0].code, "92906")
done()
describe "delete", (done) ->
paymentMethodToken = null
context 'credit card', ->
before (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
creditCard:
number: '4111111111111111'
expirationDate: '01/2020'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
paymentMethodParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paymentMethodParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
done()
it 'deletes the credit card', (done) ->
specHelper.defaultGateway.paymentMethod.delete paymentMethodToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.paymentMethod.find paymentMethodToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
context 'paypal account', ->
before (done) ->
specHelper.defaultGateway.customer.create {}, (err, response) ->
customerId = response.customer.id
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params =
authorizationFingerprint: authorizationFingerprint
paypalAccount:
consentCode: 'PAYPAL_CONSENT_CODE'
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
myHttp.post "/client_api/v1/payment_methods/paypal_accounts.json", params, (statusCode, body) ->
nonce = JSON.parse(body).paypalAccounts[0].nonce
paypalAccountParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.paymentMethod.create paypalAccountParams, (err, response) ->
paymentMethodToken = response.paymentMethod.token
done()
it "deletes the paypal account", (done) ->
specHelper.defaultGateway.paymentMethod.delete paymentMethodToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.paypalAccount.find paymentMethodToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles invalid tokens", (done) ->
specHelper.defaultGateway.paymentMethod.delete 'NONEXISTENT_TOKEN', (err) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
|
[
{
"context": "->\n ann = {}\n permissions.setUser({userId: 'alice', consumerKey: 'fookey'})\n $(el).trigger('befo",
"end": 411,
"score": 0.9966668486595154,
"start": 406,
"tag": "USERNAME",
"value": "alice"
},
{
"context": "rmissions.setUser({userId: 'alice', consumerKey: 'f... | inception-html-editor/src/main/js/annotatorjs/test/spec/plugin/annotateitpermissions_spec.coffee | CPHI-TVHS/inception | 377 | describe 'Annotator.Plugin.AnnotateItPermissions', ->
el = null
permissions = null
beforeEach ->
el = $("<div class='annotator-viewer'></div>").appendTo('body')[0]
permissions = new Annotator.Plugin.AnnotateItPermissions(el)
afterEach -> $(el).remove()
it "it should set user for newly created annotations on beforeAnnotationCreated", ->
ann = {}
permissions.setUser({userId: 'alice', consumerKey: 'fookey'})
$(el).trigger('beforeAnnotationCreated', [ann])
assert.equal(ann.user, 'alice')
it "it should set consumer for newly created annotations on beforeAnnotationCreated", ->
ann = {}
permissions.setUser({userId: 'alice', consumerKey: 'fookey'})
$(el).trigger('beforeAnnotationCreated', [ann])
assert.equal(ann.consumer, 'fookey')
describe 'authorize', ->
annotations = null
beforeEach ->
annotations = [
{} # 0
{ user: 'alice' } # 1
{ user: 'alice', consumer: 'annotateit' } # 2
{ permissions: {} } # 3
{ # 4
permissions: {
'read': ['group:__world__']
}
}
{ # 5
permissions: {
'update': ['group:__authenticated__']
}
}
{ # 6
consumer: 'annotateit'
permissions: {
'read': ['group:__consumer__']
}
}
]
it 'should NOT allow any action for an annotation with no owner info and no permissions', ->
a = annotations[0]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: 'annotateit'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should NOT allow any action if an annotation has only user set (but no consumer)', ->
a = annotations[1]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: 'annotateit'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should allow any action if the current auth info identifies the owner of the annotation', ->
a = annotations[2]
permissions.setUser({userId: 'alice', consumerKey: 'annotateit'})
assert.isTrue(permissions.authorize(null, a))
assert.isTrue(permissions.authorize('foo', a))
it 'should NOT allow any action for an annotation with no owner info and empty permissions field', ->
a = annotations[3]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: 'annotateit'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should allow an action when the action field contains the world group', ->
a = annotations[4]
assert.isTrue(permissions.authorize('read', a))
permissions.setUser({userId: 'alice', consumerKey: 'annotateit'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the action field contains the authenticated group and the plugin has auth info', ->
a = annotations[5]
assert.isFalse(permissions.authorize('update', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isTrue(permissions.authorize('update', a))
it 'should allow an action when the action field contains the consumer group and the plugin has auth info with a matching consumer', ->
a = annotations[6]
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'annotateit'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the action field contains the consumer group and the plugin has auth info with a matching consumer', ->
a = annotations[6]
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'annotateit'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the user is an admin of the annotation\'s consumer', ->
a = annotations[2]
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere', admin: true})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'annotateit', admin: true})
assert.isTrue(permissions.authorize('read', a))
| 110914 | describe 'Annotator.Plugin.AnnotateItPermissions', ->
el = null
permissions = null
beforeEach ->
el = $("<div class='annotator-viewer'></div>").appendTo('body')[0]
permissions = new Annotator.Plugin.AnnotateItPermissions(el)
afterEach -> $(el).remove()
it "it should set user for newly created annotations on beforeAnnotationCreated", ->
ann = {}
permissions.setUser({userId: 'alice', consumerKey: '<KEY>'})
$(el).trigger('beforeAnnotationCreated', [ann])
assert.equal(ann.user, 'alice')
it "it should set consumer for newly created annotations on beforeAnnotationCreated", ->
ann = {}
permissions.setUser({userId: 'alice', consumerKey: '<KEY>'})
$(el).trigger('beforeAnnotationCreated', [ann])
assert.equal(ann.consumer, 'fookey')
describe 'authorize', ->
annotations = null
beforeEach ->
annotations = [
{} # 0
{ user: 'alice' } # 1
{ user: 'alice', consumer: 'annotateit' } # 2
{ permissions: {} } # 3
{ # 4
permissions: {
'read': ['group:__world__']
}
}
{ # 5
permissions: {
'update': ['group:__authenticated__']
}
}
{ # 6
consumer: 'annotateit'
permissions: {
'read': ['group:__consumer__']
}
}
]
it 'should NOT allow any action for an annotation with no owner info and no permissions', ->
a = annotations[0]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: '<KEY>'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should NOT allow any action if an annotation has only user set (but no consumer)', ->
a = annotations[1]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: '<KEY>'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should allow any action if the current auth info identifies the owner of the annotation', ->
a = annotations[2]
permissions.setUser({userId: 'alice', consumerKey: '<KEY>'})
assert.isTrue(permissions.authorize(null, a))
assert.isTrue(permissions.authorize('foo', a))
it 'should NOT allow any action for an annotation with no owner info and empty permissions field', ->
a = annotations[3]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: '<KEY>'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should allow an action when the action field contains the world group', ->
a = annotations[4]
assert.isTrue(permissions.authorize('read', a))
permissions.setUser({userId: 'alice', consumerKey: '<KEY>'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the action field contains the authenticated group and the plugin has auth info', ->
a = annotations[5]
assert.isFalse(permissions.authorize('update', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isTrue(permissions.authorize('update', a))
it 'should allow an action when the action field contains the consumer group and the plugin has auth info with a matching consumer', ->
a = annotations[6]
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: '<KEY>'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the action field contains the consumer group and the plugin has auth info with a matching consumer', ->
a = annotations[6]
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: '<KEY>'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the user is an admin of the annotation\'s consumer', ->
a = annotations[2]
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere', admin: true})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: '<KEY>', admin: true})
assert.isTrue(permissions.authorize('read', a))
| true | describe 'Annotator.Plugin.AnnotateItPermissions', ->
el = null
permissions = null
beforeEach ->
el = $("<div class='annotator-viewer'></div>").appendTo('body')[0]
permissions = new Annotator.Plugin.AnnotateItPermissions(el)
afterEach -> $(el).remove()
it "it should set user for newly created annotations on beforeAnnotationCreated", ->
ann = {}
permissions.setUser({userId: 'alice', consumerKey: 'PI:KEY:<KEY>END_PI'})
$(el).trigger('beforeAnnotationCreated', [ann])
assert.equal(ann.user, 'alice')
it "it should set consumer for newly created annotations on beforeAnnotationCreated", ->
ann = {}
permissions.setUser({userId: 'alice', consumerKey: 'PI:KEY:<KEY>END_PI'})
$(el).trigger('beforeAnnotationCreated', [ann])
assert.equal(ann.consumer, 'fookey')
describe 'authorize', ->
annotations = null
beforeEach ->
annotations = [
{} # 0
{ user: 'alice' } # 1
{ user: 'alice', consumer: 'annotateit' } # 2
{ permissions: {} } # 3
{ # 4
permissions: {
'read': ['group:__world__']
}
}
{ # 5
permissions: {
'update': ['group:__authenticated__']
}
}
{ # 6
consumer: 'annotateit'
permissions: {
'read': ['group:__consumer__']
}
}
]
it 'should NOT allow any action for an annotation with no owner info and no permissions', ->
a = annotations[0]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: 'PI:KEY:<KEY>END_PI'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should NOT allow any action if an annotation has only user set (but no consumer)', ->
a = annotations[1]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: 'PI:KEY:<KEY>END_PI'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should allow any action if the current auth info identifies the owner of the annotation', ->
a = annotations[2]
permissions.setUser({userId: 'alice', consumerKey: 'PI:KEY:<KEY>END_PI'})
assert.isTrue(permissions.authorize(null, a))
assert.isTrue(permissions.authorize('foo', a))
it 'should NOT allow any action for an annotation with no owner info and empty permissions field', ->
a = annotations[3]
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
permissions.setUser({userId: 'alice', consumerKey: 'PI:KEY:<KEY>END_PI'})
assert.isFalse(permissions.authorize(null, a))
assert.isFalse(permissions.authorize('foo', a))
it 'should allow an action when the action field contains the world group', ->
a = annotations[4]
assert.isTrue(permissions.authorize('read', a))
permissions.setUser({userId: 'alice', consumerKey: 'PI:KEY:<KEY>END_PI'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the action field contains the authenticated group and the plugin has auth info', ->
a = annotations[5]
assert.isFalse(permissions.authorize('update', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isTrue(permissions.authorize('update', a))
it 'should allow an action when the action field contains the consumer group and the plugin has auth info with a matching consumer', ->
a = annotations[6]
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'PI:KEY:<KEY>END_PI'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the action field contains the consumer group and the plugin has auth info with a matching consumer', ->
a = annotations[6]
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere'})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'PI:KEY:<KEY>END_PI'})
assert.isTrue(permissions.authorize('read', a))
it 'should allow an action when the user is an admin of the annotation\'s consumer', ->
a = annotations[2]
permissions.setUser({userId: 'anyone', consumerKey: 'anywhere', admin: true})
assert.isFalse(permissions.authorize('read', a))
permissions.setUser({userId: 'anyone', consumerKey: 'PI:KEY:<KEY>END_PI', admin: true})
assert.isTrue(permissions.authorize('read', a))
|
[
{
"context": "ion:\n# HUBOT_ESA_SLACK_DECORATOR\n#\n# Author:\n# hmsk <k.hamasaki@gmail.com>\n#\n\nslackChannelsCacheKey =",
"end": 345,
"score": 0.9996417164802551,
"start": 341,
"tag": "USERNAME",
"value": "hmsk"
},
{
"context": " HUBOT_ESA_SLACK_DECORATOR\n#\n# Author:\n# h... | src/esa-slack.coffee | hmsk/hubot-esa | 9 | # Descriptipn
# Hubot script decorated message from webhook of https://esa.io
#
# Dependencies:
# hubot-esa
# hubot-slack
#
# Commands:
# hubot esa channel list - Show cache data of channel list
# hubot esa channel restore - Fetch brand new channel list immediately
#
# Configuration:
# HUBOT_ESA_SLACK_DECORATOR
#
# Author:
# hmsk <k.hamasaki@gmail.com>
#
slackChannelsCacheKey = 'esaWebhookSlackChannels'
class ChannelSelector
constructor: (@robot) ->
@kvs = @robot.brain
@fetchSlackChannels: (robot, slack_token) ->
kvs = robot.brain
robot.http('https://slack.com/api/channels.list')
.query({token: slack_token, exclude_archived: '1'})
.header('Accept', 'application/json')
.get() (error, response, body) ->
if response.statusCode is 200
availableChannels = []
for availableChannel in JSON.parse(body).channels
if availableChannel.is_member
availableChannels.push availableChannel.name
cache =
channels: availableChannels
savedAt: new Date().getTime()
kvs.set slackChannelsCacheKey, cache
@refetchSlackChannelCacheIfNeeded: (robot, slack_token) ->
cache = robot.brain.get(slackChannelsCacheKey) or {}
if !('savedAt' of cache) || cache.savedAt < new Date().getTime() - 3600 * 1000 * 24
ChannelSelector.fetchSlackChannels(robot, slack_token)
_getCachedAvailableChannels = ->
cache = @kvs.get(slackChannelsCacheKey) or {}
unless 'channels' of cache
cache =
channels: []
savedAt: null
cache.channels
selectByTitle: (entry_title, default_channels) ->
selectedChannels = []
availableChannels = _getCachedAvailableChannels.call @
tagsPattern = /#(\w+)/g
while (matches = tagsPattern.exec(entry_title))
selectedChannels.push matches[1]
selectedChannels = selectedChannels.filter (channel) ->
availableChannels.indexOf(channel) > -1
if selectedChannels.length == 0
dirsPattern = /\/{0,1}(\w+)\//g
while (matches = dirsPattern.exec(entry_title))
selectedChannels = [matches[1]] if availableChannels.indexOf(matches[1]) > -1
selectedChannels = default_channels if selectedChannels.length == 0
selectedChannels
module.exports = (robot) ->
options =
enabled: process.env.HUBOT_ESA_SLACK_DECORATOR == 'true'
default_room: process.env.HUBOT_ESA_WEBHOOK_DEFAULT_ROOM
slack_token: process.env.HUBOT_SLACK_TOKEN
if options.enabled
robot.emit 'esa.debug', 'Slack decorator enabled'
if options.slack_token
ChannelSelector.fetchSlackChannels(robot, options.slack_token)
# https://api.slack.com/docs/attachments
buildContent = (message) ->
content =
color: '#13958D' # Theme color from esa icon
fields: []
pretext: message
fallback: ''
thumb_url: 'https://img.esa.io/uploads/production/pictures/105/6161/image/425c3b1e777d356c34973e818543420e.gif'
robot.on 'esa.slack.attachment', (content, channels) ->
robot.emit 'esa.debug', "emit slack.attachment with\n#{content}"
for channel in channels
robot.messageRoom channel, attachments: [content]
channelsByWebhookContent = (content) ->
defaultChannels = [options.default_room]
if content.title and process.env.HUBOT_ESA_SLACK_ROOM_SELECTOR == 'true'
selector = new ChannelSelector(robot)
return selector.selectByTitle(content.title, defaultChannels)
else
return defaultChannels
robot.on 'esa.webhook', (kind, data) ->
putUserAndPostToContent = (content, user, post) ->
content.author_name = user.screen_name
content.author_icon = user.icon.url
content.title = post.name
content.title_link = post.url
message_by_kind =
'post_create': 'New post created'
'post_update': 'The post updated'
'post_archive': 'The post archived'
'comment_create': 'The comment posted'
'member_join': 'New member joined'
content = buildContent message_by_kind[kind]
putUserAndPostToContent content, data.user, data.post unless kind is 'member_join'
switch kind
when 'post_create', 'post_update'
content.text = data.post.message
when 'comment_create'
content.text = data.comment.body_md
when 'member_join'
content.text = data.user.screen_name
robot.emit 'esa.slack.attachment', content, channelsByWebhookContent(content)
if options.slack_token
ChannelSelector.refetchSlackChannelCacheIfNeeded(robot, options.slack_token)
robot.on 'esa.hear.stats', (res, stats) ->
content = buildContent 'The stats of esa'
fields = [
{ title: 'Posts', value: stats.posts }
{ title: 'Comments', value: stats.comments }
{ title: 'Stars', value: stats.stars }
{ title: 'Daily Active Users', value: stats.daily_active_users }
{ title: 'Weekly Active Users', value: stats.weekly_active_users }
{ title: 'Monthly Active Users', value: stats.monthly_active_users }
]
content.fields = fields.map (item, i) ->
item.short = true
item
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.on 'esa.hear.post', (res, post) ->
content = buildContent ''
content.title = post.full_name
content.title_link = post.url
content.text = post.body_md
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.on 'esa.hear.comment', (res, comment, post) ->
content = buildContent ''
content.title = 'Comment for ' + post.full_name
content.title_link = comment.url
content.text = comment.body_md
content.author_name = comment.created_by.screen_name
content.author_icon = comment.created_by.icon
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.respond /esa channel list/, (res) ->
list = JSON.stringify(robot.brain.get(slackChannelsCacheKey) or {})
res.reply "```\n#{list.replace(/\r\n/g, '\n')}\n```"
robot.respond /esa channel restore/, (res) ->
ChannelSelector.fetchSlackChannels(robot, options.slack_token)
res.reply "Kicked Restore :wink:"
| 142646 | # Descriptipn
# Hubot script decorated message from webhook of https://esa.io
#
# Dependencies:
# hubot-esa
# hubot-slack
#
# Commands:
# hubot esa channel list - Show cache data of channel list
# hubot esa channel restore - Fetch brand new channel list immediately
#
# Configuration:
# HUBOT_ESA_SLACK_DECORATOR
#
# Author:
# hmsk <<EMAIL>>
#
slackChannelsCacheKey = 'esaWebhookSlackChannels'
class ChannelSelector
constructor: (@robot) ->
@kvs = @robot.brain
@fetchSlackChannels: (robot, slack_token) ->
kvs = robot.brain
robot.http('https://slack.com/api/channels.list')
.query({token: slack_token, exclude_archived: '1'})
.header('Accept', 'application/json')
.get() (error, response, body) ->
if response.statusCode is 200
availableChannels = []
for availableChannel in JSON.parse(body).channels
if availableChannel.is_member
availableChannels.push availableChannel.name
cache =
channels: availableChannels
savedAt: new Date().getTime()
kvs.set slackChannelsCacheKey, cache
@refetchSlackChannelCacheIfNeeded: (robot, slack_token) ->
cache = robot.brain.get(slackChannelsCacheKey) or {}
if !('savedAt' of cache) || cache.savedAt < new Date().getTime() - 3600 * 1000 * 24
ChannelSelector.fetchSlackChannels(robot, slack_token)
_getCachedAvailableChannels = ->
cache = @kvs.get(slackChannelsCacheKey) or {}
unless 'channels' of cache
cache =
channels: []
savedAt: null
cache.channels
selectByTitle: (entry_title, default_channels) ->
selectedChannels = []
availableChannels = _getCachedAvailableChannels.call @
tagsPattern = /#(\w+)/g
while (matches = tagsPattern.exec(entry_title))
selectedChannels.push matches[1]
selectedChannels = selectedChannels.filter (channel) ->
availableChannels.indexOf(channel) > -1
if selectedChannels.length == 0
dirsPattern = /\/{0,1}(\w+)\//g
while (matches = dirsPattern.exec(entry_title))
selectedChannels = [matches[1]] if availableChannels.indexOf(matches[1]) > -1
selectedChannels = default_channels if selectedChannels.length == 0
selectedChannels
module.exports = (robot) ->
options =
enabled: process.env.HUBOT_ESA_SLACK_DECORATOR == 'true'
default_room: process.env.HUBOT_ESA_WEBHOOK_DEFAULT_ROOM
slack_token: process.env.HUBOT_SLACK_TOKEN
if options.enabled
robot.emit 'esa.debug', 'Slack decorator enabled'
if options.slack_token
ChannelSelector.fetchSlackChannels(robot, options.slack_token)
# https://api.slack.com/docs/attachments
buildContent = (message) ->
content =
color: '#13958D' # Theme color from esa icon
fields: []
pretext: message
fallback: ''
thumb_url: 'https://img.esa.io/uploads/production/pictures/105/6161/image/425c3b1e777d356c34973e818543420e.gif'
robot.on 'esa.slack.attachment', (content, channels) ->
robot.emit 'esa.debug', "emit slack.attachment with\n#{content}"
for channel in channels
robot.messageRoom channel, attachments: [content]
channelsByWebhookContent = (content) ->
defaultChannels = [options.default_room]
if content.title and process.env.HUBOT_ESA_SLACK_ROOM_SELECTOR == 'true'
selector = new ChannelSelector(robot)
return selector.selectByTitle(content.title, defaultChannels)
else
return defaultChannels
robot.on 'esa.webhook', (kind, data) ->
putUserAndPostToContent = (content, user, post) ->
content.author_name = user.screen_name
content.author_icon = user.icon.url
content.title = post.name
content.title_link = post.url
message_by_kind =
'post_create': 'New post created'
'post_update': 'The post updated'
'post_archive': 'The post archived'
'comment_create': 'The comment posted'
'member_join': 'New member joined'
content = buildContent message_by_kind[kind]
putUserAndPostToContent content, data.user, data.post unless kind is 'member_join'
switch kind
when 'post_create', 'post_update'
content.text = data.post.message
when 'comment_create'
content.text = data.comment.body_md
when 'member_join'
content.text = data.user.screen_name
robot.emit 'esa.slack.attachment', content, channelsByWebhookContent(content)
if options.slack_token
ChannelSelector.refetchSlackChannelCacheIfNeeded(robot, options.slack_token)
robot.on 'esa.hear.stats', (res, stats) ->
content = buildContent 'The stats of esa'
fields = [
{ title: 'Posts', value: stats.posts }
{ title: 'Comments', value: stats.comments }
{ title: 'Stars', value: stats.stars }
{ title: 'Daily Active Users', value: stats.daily_active_users }
{ title: 'Weekly Active Users', value: stats.weekly_active_users }
{ title: 'Monthly Active Users', value: stats.monthly_active_users }
]
content.fields = fields.map (item, i) ->
item.short = true
item
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.on 'esa.hear.post', (res, post) ->
content = buildContent ''
content.title = post.full_name
content.title_link = post.url
content.text = post.body_md
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.on 'esa.hear.comment', (res, comment, post) ->
content = buildContent ''
content.title = 'Comment for ' + post.full_name
content.title_link = comment.url
content.text = comment.body_md
content.author_name = comment.created_by.screen_name
content.author_icon = comment.created_by.icon
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.respond /esa channel list/, (res) ->
list = JSON.stringify(robot.brain.get(slackChannelsCacheKey) or {})
res.reply "```\n#{list.replace(/\r\n/g, '\n')}\n```"
robot.respond /esa channel restore/, (res) ->
ChannelSelector.fetchSlackChannels(robot, options.slack_token)
res.reply "Kicked Restore :wink:"
| true | # Descriptipn
# Hubot script decorated message from webhook of https://esa.io
#
# Dependencies:
# hubot-esa
# hubot-slack
#
# Commands:
# hubot esa channel list - Show cache data of channel list
# hubot esa channel restore - Fetch brand new channel list immediately
#
# Configuration:
# HUBOT_ESA_SLACK_DECORATOR
#
# Author:
# hmsk <PI:EMAIL:<EMAIL>END_PI>
#
slackChannelsCacheKey = 'esaWebhookSlackChannels'
class ChannelSelector
constructor: (@robot) ->
@kvs = @robot.brain
@fetchSlackChannels: (robot, slack_token) ->
kvs = robot.brain
robot.http('https://slack.com/api/channels.list')
.query({token: slack_token, exclude_archived: '1'})
.header('Accept', 'application/json')
.get() (error, response, body) ->
if response.statusCode is 200
availableChannels = []
for availableChannel in JSON.parse(body).channels
if availableChannel.is_member
availableChannels.push availableChannel.name
cache =
channels: availableChannels
savedAt: new Date().getTime()
kvs.set slackChannelsCacheKey, cache
@refetchSlackChannelCacheIfNeeded: (robot, slack_token) ->
cache = robot.brain.get(slackChannelsCacheKey) or {}
if !('savedAt' of cache) || cache.savedAt < new Date().getTime() - 3600 * 1000 * 24
ChannelSelector.fetchSlackChannels(robot, slack_token)
_getCachedAvailableChannels = ->
cache = @kvs.get(slackChannelsCacheKey) or {}
unless 'channels' of cache
cache =
channels: []
savedAt: null
cache.channels
selectByTitle: (entry_title, default_channels) ->
selectedChannels = []
availableChannels = _getCachedAvailableChannels.call @
tagsPattern = /#(\w+)/g
while (matches = tagsPattern.exec(entry_title))
selectedChannels.push matches[1]
selectedChannels = selectedChannels.filter (channel) ->
availableChannels.indexOf(channel) > -1
if selectedChannels.length == 0
dirsPattern = /\/{0,1}(\w+)\//g
while (matches = dirsPattern.exec(entry_title))
selectedChannels = [matches[1]] if availableChannels.indexOf(matches[1]) > -1
selectedChannels = default_channels if selectedChannels.length == 0
selectedChannels
module.exports = (robot) ->
options =
enabled: process.env.HUBOT_ESA_SLACK_DECORATOR == 'true'
default_room: process.env.HUBOT_ESA_WEBHOOK_DEFAULT_ROOM
slack_token: process.env.HUBOT_SLACK_TOKEN
if options.enabled
robot.emit 'esa.debug', 'Slack decorator enabled'
if options.slack_token
ChannelSelector.fetchSlackChannels(robot, options.slack_token)
# https://api.slack.com/docs/attachments
buildContent = (message) ->
content =
color: '#13958D' # Theme color from esa icon
fields: []
pretext: message
fallback: ''
thumb_url: 'https://img.esa.io/uploads/production/pictures/105/6161/image/425c3b1e777d356c34973e818543420e.gif'
robot.on 'esa.slack.attachment', (content, channels) ->
robot.emit 'esa.debug', "emit slack.attachment with\n#{content}"
for channel in channels
robot.messageRoom channel, attachments: [content]
channelsByWebhookContent = (content) ->
defaultChannels = [options.default_room]
if content.title and process.env.HUBOT_ESA_SLACK_ROOM_SELECTOR == 'true'
selector = new ChannelSelector(robot)
return selector.selectByTitle(content.title, defaultChannels)
else
return defaultChannels
robot.on 'esa.webhook', (kind, data) ->
putUserAndPostToContent = (content, user, post) ->
content.author_name = user.screen_name
content.author_icon = user.icon.url
content.title = post.name
content.title_link = post.url
message_by_kind =
'post_create': 'New post created'
'post_update': 'The post updated'
'post_archive': 'The post archived'
'comment_create': 'The comment posted'
'member_join': 'New member joined'
content = buildContent message_by_kind[kind]
putUserAndPostToContent content, data.user, data.post unless kind is 'member_join'
switch kind
when 'post_create', 'post_update'
content.text = data.post.message
when 'comment_create'
content.text = data.comment.body_md
when 'member_join'
content.text = data.user.screen_name
robot.emit 'esa.slack.attachment', content, channelsByWebhookContent(content)
if options.slack_token
ChannelSelector.refetchSlackChannelCacheIfNeeded(robot, options.slack_token)
robot.on 'esa.hear.stats', (res, stats) ->
content = buildContent 'The stats of esa'
fields = [
{ title: 'Posts', value: stats.posts }
{ title: 'Comments', value: stats.comments }
{ title: 'Stars', value: stats.stars }
{ title: 'Daily Active Users', value: stats.daily_active_users }
{ title: 'Weekly Active Users', value: stats.weekly_active_users }
{ title: 'Monthly Active Users', value: stats.monthly_active_users }
]
content.fields = fields.map (item, i) ->
item.short = true
item
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.on 'esa.hear.post', (res, post) ->
content = buildContent ''
content.title = post.full_name
content.title_link = post.url
content.text = post.body_md
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.on 'esa.hear.comment', (res, comment, post) ->
content = buildContent ''
content.title = 'Comment for ' + post.full_name
content.title_link = comment.url
content.text = comment.body_md
content.author_name = comment.created_by.screen_name
content.author_icon = comment.created_by.icon
robot.emit 'esa.slack.attachment', content, [res.envelope.room]
robot.respond /esa channel list/, (res) ->
list = JSON.stringify(robot.brain.get(slackChannelsCacheKey) or {})
res.reply "```\n#{list.replace(/\r\n/g, '\n')}\n```"
robot.respond /esa channel restore/, (res) ->
ChannelSelector.fetchSlackChannels(robot, options.slack_token)
res.reply "Kicked Restore :wink:"
|
[
{
"context": "###\n@Author: Kristinita\n@Date:\t 2017-04-09 09:17:06\n@Last Modified time: ",
"end": 23,
"score": 0.9997982978820801,
"start": 13,
"tag": "NAME",
"value": "Kristinita"
},
{
"context": "\n\n[NOTE] Sticky hover problem:\nhttps://github.com/kazzkiq/balloon.css/issues/152... | themes/sashapelican/static/coffee/Clipboard-js/Clipboard.coffee | Kristinita/--- | 6 | ###
@Author: Kristinita
@Date: 2017-04-09 09:17:06
@Last Modified time: 2018-05-04 08:57:40
###
################
# Clipboard.js #
################
###
[PURPOSE] Copy text by click without Flash:
https://clipboardjs.com/
###
###############
# balloon.css #
###############
###
[PURPOSE] Tooltips without JavaScript:
https://kazzkiq.github.io/balloon.css/
[NOTE] Sticky hover problem:
https://github.com/kazzkiq/balloon.css/issues/152
###
###*
[INFO] Activate Clipboard.js for all elements with “.SashaButton” class:
https://stackoverflow.com/a/33758435/5951529
[LEARN][COFFEESCRIPT] JsDoc in CoffeeScript:
https://stackoverflow.com/a/24348892/5951529
[LEARN][CLOSURE] Any function with “new” keyword must have “@constructor” word:
https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#constructor
https://stackoverflow.com/a/5301591/5951529
@constructor
[DEPRECATED] Now Clipboard.js works for me without it:
[INFO] DOM initialization
http://ru.stackoverflow.com/a/582520/199934
[DECLINED] For web performance purposes I use Pygments instead of Rainbow.js
[INFO] Dinamically usage for Rainbow.js:
http://stackoverflow.com/a/33758293/5951529
###
KiraCodeBlockClipboard = new Clipboard('.SashaButton', text: (trigger) ->
$(trigger).closest('.SashaBlockHighlight').find('pre').text()
)
###
[INFO] Get lang attribute of “<html>” tag:
https://stackoverflow.com/a/5031545/5951529
https://stackoverflow.com/posts/comments/18461817
###
KiraWebPageLanguage = $('html').attr('lang')
###
[LEARN][JAVASCRIPT] “if/else”:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else
https://www.w3schools.com/jsref/jsref_if.asp
[LEARN][COFFEESCRIPT] “if/else”:
https://riptutorial.com/coffeescript/example/15079/if--if---then--if---else--unless--ternary-operator
###
if KiraWebPageLanguage is 'ru'
KiraBalloonCopyIt = 'Кликните, чтобы скопировать код'
KiraBalloonCopied = 'Скопировано!'
###
[LEARN][COFFEESCRIPT] Heredoc multiline syntax:
https://stackoverflow.com/a/19389237/5951529
###
KiraBalloonErrorMessage = '''Произошла ошибка при копировании.
Пожалуйста, сообщите о ней разработчикам сайта.
«OK» — написать сообщение об ошибке, «Cancel» — продолжить пользоваться сайтом.'''
else
KiraBalloonCopyIt = 'Click to copy code to the clipboard'
KiraBalloonCopied = 'Copied!'
KiraBalloonErrorMessage = '''An error occurred while copying.
Please, if possible, inform the site developers about it.
“OK” — write an error message, “Cancel” — continue using the site.'''
###
[LEARN][JAVASCRIPT] Set attribute value for all elements with specific class:
https://stackoverflow.com/a/18455390/5951529
https://stackoverflow.com/a/18455368/5951529
###
$('.SashaButton').attr 'aria-label', KiraBalloonCopyIt
###
[INFO] Use balloon.css for class:
https://github.com/kazzkiq/balloon.css/issues/150#issuecomment-706774970
###
KiraBalloon = (KiraTooltip) ->
KiraTooltip.removeAttribute 'class'
KiraTooltip.setAttribute 'aria-label', KiraBalloonCopied
KiraTooltip.setAttribute 'class', 'SashaClick'
setTimeout (->
KiraTooltip.removeAttribute 'class'
KiraTooltip.removeAttribute 'aria-label'
KiraTooltip.setAttribute 'class', 'SashaButton'
KiraTooltip.setAttribute 'aria-label', KiraBalloonCopyIt
), 2000
###
[INFO] Run function after success and error Clipboard.js copy action:
https://clipboardjs.com/#events
###
KiraCodeBlockClipboard.on 'success', (KiraElement) ->
console.info 'Action:', KiraElement.action
console.info 'Text:', KiraElement.text
console.info 'Trigger:', KiraElement.trigger
###
[EXAMPLE] Clipboard.js events:
http://bit.ly/clipboardjs-events
###
KiraBalloon KiraElement.trigger
KiraElement.clearSelection()
KiraCodeBlockClipboard.on 'error', (KiraElement) ->
console.error 'Action:', KiraElement.action
console.error 'Trigger:', KiraElement.trigger
###
[NOTE] Default “alert” doesn’t support links, use “window.confirm” instead:
https://stackoverflow.com/a/26746479/5951529
[REQUIRED] “if” statement
[INFO] Open link in the new window:
https://stackoverflow.com/a/62119507/5951529
###
if window.confirm(KiraBalloonErrorMessage)
window.open 'https://github.com/Kristinita/KristinitaPelican/issues/new', '_blank'
| 29171 | ###
@Author: <NAME>
@Date: 2017-04-09 09:17:06
@Last Modified time: 2018-05-04 08:57:40
###
################
# Clipboard.js #
################
###
[PURPOSE] Copy text by click without Flash:
https://clipboardjs.com/
###
###############
# balloon.css #
###############
###
[PURPOSE] Tooltips without JavaScript:
https://kazzkiq.github.io/balloon.css/
[NOTE] Sticky hover problem:
https://github.com/kazzkiq/balloon.css/issues/152
###
###*
[INFO] Activate Clipboard.js for all elements with “.SashaButton” class:
https://stackoverflow.com/a/33758435/5951529
[LEARN][COFFEESCRIPT] JsDoc in CoffeeScript:
https://stackoverflow.com/a/24348892/5951529
[LEARN][CLOSURE] Any function with “new” keyword must have “@constructor” word:
https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#constructor
https://stackoverflow.com/a/5301591/5951529
@constructor
[DEPRECATED] Now Clipboard.js works for me without it:
[INFO] DOM initialization
http://ru.stackoverflow.com/a/582520/199934
[DECLINED] For web performance purposes I use Pygments instead of Rainbow.js
[INFO] Dinamically usage for Rainbow.js:
http://stackoverflow.com/a/33758293/5951529
###
KiraCodeBlockClipboard = new Clipboard('.SashaButton', text: (trigger) ->
$(trigger).closest('.SashaBlockHighlight').find('pre').text()
)
###
[INFO] Get lang attribute of “<html>” tag:
https://stackoverflow.com/a/5031545/5951529
https://stackoverflow.com/posts/comments/18461817
###
KiraWebPageLanguage = $('html').attr('lang')
###
[LEARN][JAVASCRIPT] “if/else”:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else
https://www.w3schools.com/jsref/jsref_if.asp
[LEARN][COFFEESCRIPT] “if/else”:
https://riptutorial.com/coffeescript/example/15079/if--if---then--if---else--unless--ternary-operator
###
if KiraWebPageLanguage is 'ru'
KiraBalloonCopyIt = 'Кликните, чтобы скопировать код'
KiraBalloonCopied = 'Скопировано!'
###
[LEARN][COFFEESCRIPT] Heredoc multiline syntax:
https://stackoverflow.com/a/19389237/5951529
###
KiraBalloonErrorMessage = '''Произошла ошибка при копировании.
Пожалуйста, сообщите о ней разработчикам сайта.
«OK» — написать сообщение об ошибке, «Cancel» — продолжить пользоваться сайтом.'''
else
KiraBalloonCopyIt = 'Click to copy code to the clipboard'
KiraBalloonCopied = 'Copied!'
KiraBalloonErrorMessage = '''An error occurred while copying.
Please, if possible, inform the site developers about it.
“OK” — write an error message, “Cancel” — continue using the site.'''
###
[LEARN][JAVASCRIPT] Set attribute value for all elements with specific class:
https://stackoverflow.com/a/18455390/5951529
https://stackoverflow.com/a/18455368/5951529
###
$('.SashaButton').attr 'aria-label', KiraBalloonCopyIt
###
[INFO] Use balloon.css for class:
https://github.com/kazzkiq/balloon.css/issues/150#issuecomment-706774970
###
KiraBalloon = (KiraTooltip) ->
KiraTooltip.removeAttribute 'class'
KiraTooltip.setAttribute 'aria-label', KiraBalloonCopied
KiraTooltip.setAttribute 'class', 'SashaClick'
setTimeout (->
KiraTooltip.removeAttribute 'class'
KiraTooltip.removeAttribute 'aria-label'
KiraTooltip.setAttribute 'class', 'SashaButton'
KiraTooltip.setAttribute 'aria-label', KiraBalloonCopyIt
), 2000
###
[INFO] Run function after success and error Clipboard.js copy action:
https://clipboardjs.com/#events
###
KiraCodeBlockClipboard.on 'success', (KiraElement) ->
console.info 'Action:', KiraElement.action
console.info 'Text:', KiraElement.text
console.info 'Trigger:', KiraElement.trigger
###
[EXAMPLE] Clipboard.js events:
http://bit.ly/clipboardjs-events
###
KiraBalloon KiraElement.trigger
KiraElement.clearSelection()
KiraCodeBlockClipboard.on 'error', (KiraElement) ->
console.error 'Action:', KiraElement.action
console.error 'Trigger:', KiraElement.trigger
###
[NOTE] Default “alert” doesn’t support links, use “window.confirm” instead:
https://stackoverflow.com/a/26746479/5951529
[REQUIRED] “if” statement
[INFO] Open link in the new window:
https://stackoverflow.com/a/62119507/5951529
###
if window.confirm(KiraBalloonErrorMessage)
window.open 'https://github.com/Kristinita/KristinitaPelican/issues/new', '_blank'
| true | ###
@Author: PI:NAME:<NAME>END_PI
@Date: 2017-04-09 09:17:06
@Last Modified time: 2018-05-04 08:57:40
###
################
# Clipboard.js #
################
###
[PURPOSE] Copy text by click without Flash:
https://clipboardjs.com/
###
###############
# balloon.css #
###############
###
[PURPOSE] Tooltips without JavaScript:
https://kazzkiq.github.io/balloon.css/
[NOTE] Sticky hover problem:
https://github.com/kazzkiq/balloon.css/issues/152
###
###*
[INFO] Activate Clipboard.js for all elements with “.SashaButton” class:
https://stackoverflow.com/a/33758435/5951529
[LEARN][COFFEESCRIPT] JsDoc in CoffeeScript:
https://stackoverflow.com/a/24348892/5951529
[LEARN][CLOSURE] Any function with “new” keyword must have “@constructor” word:
https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#constructor
https://stackoverflow.com/a/5301591/5951529
@constructor
[DEPRECATED] Now Clipboard.js works for me without it:
[INFO] DOM initialization
http://ru.stackoverflow.com/a/582520/199934
[DECLINED] For web performance purposes I use Pygments instead of Rainbow.js
[INFO] Dinamically usage for Rainbow.js:
http://stackoverflow.com/a/33758293/5951529
###
KiraCodeBlockClipboard = new Clipboard('.SashaButton', text: (trigger) ->
$(trigger).closest('.SashaBlockHighlight').find('pre').text()
)
###
[INFO] Get lang attribute of “<html>” tag:
https://stackoverflow.com/a/5031545/5951529
https://stackoverflow.com/posts/comments/18461817
###
KiraWebPageLanguage = $('html').attr('lang')
###
[LEARN][JAVASCRIPT] “if/else”:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else
https://www.w3schools.com/jsref/jsref_if.asp
[LEARN][COFFEESCRIPT] “if/else”:
https://riptutorial.com/coffeescript/example/15079/if--if---then--if---else--unless--ternary-operator
###
if KiraWebPageLanguage is 'ru'
KiraBalloonCopyIt = 'Кликните, чтобы скопировать код'
KiraBalloonCopied = 'Скопировано!'
###
[LEARN][COFFEESCRIPT] Heredoc multiline syntax:
https://stackoverflow.com/a/19389237/5951529
###
KiraBalloonErrorMessage = '''Произошла ошибка при копировании.
Пожалуйста, сообщите о ней разработчикам сайта.
«OK» — написать сообщение об ошибке, «Cancel» — продолжить пользоваться сайтом.'''
else
KiraBalloonCopyIt = 'Click to copy code to the clipboard'
KiraBalloonCopied = 'Copied!'
KiraBalloonErrorMessage = '''An error occurred while copying.
Please, if possible, inform the site developers about it.
“OK” — write an error message, “Cancel” — continue using the site.'''
###
[LEARN][JAVASCRIPT] Set attribute value for all elements with specific class:
https://stackoverflow.com/a/18455390/5951529
https://stackoverflow.com/a/18455368/5951529
###
$('.SashaButton').attr 'aria-label', KiraBalloonCopyIt
###
[INFO] Use balloon.css for class:
https://github.com/kazzkiq/balloon.css/issues/150#issuecomment-706774970
###
KiraBalloon = (KiraTooltip) ->
KiraTooltip.removeAttribute 'class'
KiraTooltip.setAttribute 'aria-label', KiraBalloonCopied
KiraTooltip.setAttribute 'class', 'SashaClick'
setTimeout (->
KiraTooltip.removeAttribute 'class'
KiraTooltip.removeAttribute 'aria-label'
KiraTooltip.setAttribute 'class', 'SashaButton'
KiraTooltip.setAttribute 'aria-label', KiraBalloonCopyIt
), 2000
###
[INFO] Run function after success and error Clipboard.js copy action:
https://clipboardjs.com/#events
###
KiraCodeBlockClipboard.on 'success', (KiraElement) ->
console.info 'Action:', KiraElement.action
console.info 'Text:', KiraElement.text
console.info 'Trigger:', KiraElement.trigger
###
[EXAMPLE] Clipboard.js events:
http://bit.ly/clipboardjs-events
###
KiraBalloon KiraElement.trigger
KiraElement.clearSelection()
KiraCodeBlockClipboard.on 'error', (KiraElement) ->
console.error 'Action:', KiraElement.action
console.error 'Trigger:', KiraElement.trigger
###
[NOTE] Default “alert” doesn’t support links, use “window.confirm” instead:
https://stackoverflow.com/a/26746479/5951529
[REQUIRED] “if” statement
[INFO] Open link in the new window:
https://stackoverflow.com/a/62119507/5951529
###
if window.confirm(KiraBalloonErrorMessage)
window.open 'https://github.com/Kristinita/KristinitaPelican/issues/new', '_blank'
|
[
{
"context": "password) ->\n this.native().settings.userName = user\n this.native().settings.password = password\n ",
"end": 5432,
"score": 0.8144521713256836,
"start": 5428,
"tag": "USERNAME",
"value": "user"
},
{
"context": "rName = user\n this.native().settings.password ... | lib/capybara/poltergeist/client/web_page.coffee | JonRowe/poltergeist | 0 | class Poltergeist.WebPage
@CALLBACKS = ['onConsoleMessage','onError',
'onLoadFinished', 'onInitialized', 'onLoadStarted',
'onResourceRequested', 'onResourceReceived', 'onResourceError',
'onNavigationRequested', 'onUrlChanged', 'onPageCreated',
'onClosing']
@DELEGATES = ['open', 'sendEvent', 'uploadFile', 'release', 'render',
'renderBase64', 'goBack', 'goForward']
@COMMANDS = ['currentUrl', 'find', 'nodeCall', 'documentSize',
'beforeUpload', 'afterUpload', 'clearLocalStorage']
@EXTENSIONS = []
constructor: (@_native) ->
@_native or= require('webpage').create()
@id = 0
@source = null
@closed = false
@state = 'default'
@urlWhitelist = []
@urlBlacklist = []
@errors = []
@_networkTraffic = {}
@_tempHeaders = {}
@_blockedUrls = []
@_requestedResources = {}
for callback in WebPage.CALLBACKS
this.bindCallback(callback)
for command in @COMMANDS
do (command) =>
this.prototype[command] =
(args...) -> this.runCommand(command, args)
for delegate in @DELEGATES
do (delegate) =>
this.prototype[delegate] =
-> @_native[delegate].apply(@_native, arguments)
onInitializedNative: ->
@id += 1
@source = null
@injectAgent()
this.removeTempHeaders()
this.setScrollPosition(left: 0, top: 0)
onClosingNative: ->
@handle = null
@closed = true
onConsoleMessageNative: (message) ->
if message == '__DOMContentLoaded'
@source = @_native.content
false
else
console.log(message)
onLoadStartedNative: ->
@state = 'loading'
@requestId = @lastRequestId
@_requestedResources = {}
onLoadFinishedNative: (@status) ->
@state = 'default'
@source or= @_native.content
onErrorNative: (message, stack) ->
stackString = message
stack.forEach (frame) ->
stackString += "\n"
stackString += " at #{frame.file}:#{frame.line}"
stackString += " in #{frame.function}" if frame.function && frame.function != ''
@errors.push(message: message, stack: stackString)
return true
onResourceRequestedNative: (request, net) ->
useWhitelist = @urlWhitelist.length > 0
whitelisted = @urlWhitelist.some (whitelisted_regex) ->
whitelisted_regex.test request.url
blacklisted = @urlBlacklist.some (blacklisted_regex) ->
blacklisted_regex.test request.url
abort = false
if useWhitelist && !whitelisted
abort = true
if blacklisted
abort = true
if abort
@_blockedUrls.push request.url unless request.url in @_blockedUrls
net.abort()
else
@lastRequestId = request.id
if @normalizeURL(request.url) == @redirectURL
@redirectURL = null
@requestId = request.id
@_networkTraffic[request.id] = {
request: request,
responseParts: []
error: null
}
@_requestedResources[request.id] = request.url
return true
onResourceReceivedNative: (response) ->
@_networkTraffic[response.id]?.responseParts.push(response)
if response.stage == 'end'
delete @_requestedResources[response.id]
if @requestId == response.id
if response.redirectURL
@redirectURL = @normalizeURL(response.redirectURL)
else
@statusCode = response.status
@_responseHeaders = response.headers
return true
onResourceErrorNative: (errorResponse) ->
@_networkTraffic[errorResponse.id]?.error = errorResponse
delete @_requestedResources[errorResponse.id]
return true
injectAgent: ->
if this.native().evaluate(-> typeof __poltergeist) == "undefined"
this.native().injectJs "#{phantom.libraryPath}/agent.js"
for extension in WebPage.EXTENSIONS
this.native().injectJs extension
return true
return false
injectExtension: (file) ->
WebPage.EXTENSIONS.push file
this.native().injectJs file
native: ->
if @closed
throw new Poltergeist.NoSuchWindowError
else
@_native
windowName: ->
this.native().windowName
keyCode: (name) ->
this.native().event.key[name]
keyModifierCode: (names) ->
modifiers = this.native().event.modifier
names = names.split(',').map ((name) -> modifiers[name])
names[0] | names[1] # return codes for 1 or 2 modifiers
keyModifierKeys: (names) ->
names.split(',').map (name) =>
this.keyCode(name.charAt(0).toUpperCase() + name.substring(1))
_waitState_until: (state, callback, timeout, timeout_callback) ->
if (@state == state)
callback.call(this)
else
if new Date().getTime() > timeout
timeout_callback.call(this)
else
setTimeout (=> @_waitState_until(state, callback, timeout, timeout_callback)), 100
waitState: (state, callback, max_wait=0, timeout_callback) ->
# callback and timeout_callback will be called with this == the current page
if @state == state
callback.call(this)
else
if max_wait != 0
timeout = new Date().getTime() + (max_wait*1000)
setTimeout (=> @_waitState_until(state, callback, timeout, timeout_callback)), 100
else
setTimeout (=> @waitState(state, callback)), 100
setHttpAuth: (user, password) ->
this.native().settings.userName = user
this.native().settings.password = password
return true
networkTraffic: ->
@_networkTraffic
clearNetworkTraffic: ->
@_networkTraffic = {}
return true
blockedUrls: ->
@_blockedUrls
clearBlockedUrls: ->
@_blockedUrls = []
return true
openResourceRequests: ->
url for own id, url of @_requestedResources
content: ->
this.native().frameContent
title: ->
this.native().frameTitle
frameUrl: (frameNameOrId) ->
query = (frameNameOrId) ->
document.querySelector("iframe[name='#{frameNameOrId}'], iframe[id='#{frameNameOrId}']")?.src
this.evaluate(query, frameNameOrId)
clearErrors: ->
@errors = []
return true
responseHeaders: ->
headers = {}
@_responseHeaders.forEach (item) ->
headers[item.name] = item.value
headers
cookies: ->
this.native().cookies
deleteCookie: (name) ->
this.native().deleteCookie(name)
viewportSize: ->
this.native().viewportSize
setViewportSize: (size) ->
this.native().viewportSize = size
setZoomFactor: (zoom_factor) ->
this.native().zoomFactor = zoom_factor
setPaperSize: (size) ->
this.native().paperSize = size
scrollPosition: ->
this.native().scrollPosition
setScrollPosition: (pos) ->
this.native().scrollPosition = pos
clipRect: ->
this.native().clipRect
setClipRect: (rect) ->
this.native().clipRect = rect
elementBounds: (selector) ->
this.native().evaluate(
(selector) ->
document.querySelector(selector).getBoundingClientRect()
, selector
)
setUserAgent: (userAgent) ->
this.native().settings.userAgent = userAgent
getCustomHeaders: ->
this.native().customHeaders
setCustomHeaders: (headers) ->
this.native().customHeaders = headers
addTempHeader: (header) ->
for name, value of header
@_tempHeaders[name] = value
@_tempHeaders
removeTempHeaders: ->
allHeaders = this.getCustomHeaders()
for name, value of @_tempHeaders
delete allHeaders[name]
this.setCustomHeaders(allHeaders)
pushFrame: (name) ->
return true if this.native().switchToFrame(name)
# if switch by name fails - find index and try again
frame_no = this.native().evaluate(
(frame_name) ->
frames = document.querySelectorAll("iframe, frame")
(idx for f, idx in frames when f?['name'] == frame_name or f?['id'] == frame_name)[0]
, name)
frame_no? and this.native().switchToFrame(frame_no)
popFrame: (pop_all = false)->
if pop_all
this.native().switchToMainFrame()
else
this.native().switchToParentFrame()
dimensions: ->
scroll = this.scrollPosition()
viewport = this.viewportSize()
top: scroll.top, bottom: scroll.top + viewport.height,
left: scroll.left, right: scroll.left + viewport.width,
viewport: viewport
document: this.documentSize()
# A work around for http://code.google.com/p/phantomjs/issues/detail?id=277
validatedDimensions: ->
dimensions = this.dimensions()
document = dimensions.document
if dimensions.right > document.width
dimensions.left = Math.max(0, dimensions.left - (dimensions.right - document.width))
dimensions.right = document.width
if dimensions.bottom > document.height
dimensions.top = Math.max(0, dimensions.top - (dimensions.bottom - document.height))
dimensions.bottom = document.height
this.setScrollPosition(left: dimensions.left, top: dimensions.top)
dimensions
get: (id) ->
new Poltergeist.Node(this, id)
# Before each mouse event we make sure that the mouse is moved to where the
# event will take place. This deals with e.g. :hover changes.
mouseEvent: (name, x, y, button = 'left') ->
this.sendEvent('mousemove', x, y)
this.sendEvent(name, x, y, button)
evaluate: (fn, args...) ->
this.injectAgent()
JSON.parse this.sanitize(this.native().evaluate("function() { return PoltergeistAgent.stringify(#{this.stringifyCall(fn, args)}) }"))
sanitize: (potential_string) ->
if typeof(potential_string) == "string"
# JSON doesn't like \r or \n in strings unless escaped
potential_string.replace("\n","\\n").replace("\r","\\r")
else
potential_string
execute: (fn, args...) ->
this.native().evaluate("function() { #{this.stringifyCall(fn, args)} }")
stringifyCall: (fn, args) ->
if args.length == 0
"(#{fn.toString()})()"
else
# The JSON.stringify happens twice because the second time we are essentially
# escaping the string.
"(#{fn.toString()}).apply(this, PoltergeistAgent.JSON.parse(#{JSON.stringify(JSON.stringify(args))}))"
bindCallback: (name) ->
@native()[name] = =>
result = @[name + 'Native'].apply(@, arguments) if @[name + 'Native']? # For internal callbacks
@[name].apply(@, arguments) if result != false && @[name]? # For externally set callbacks
return true
# Any error raised here or inside the evaluate will get reported to
# phantom.onError. If result is null, that means there was an error
# inside the agent.
runCommand: (name, args) ->
result = this.evaluate(
(name, args) -> __poltergeist.externalCall(name, args),
name, args
)
if result != null
if result.error?
switch result.error.message
when 'PoltergeistAgent.ObsoleteNode'
throw new Poltergeist.ObsoleteNode
when 'PoltergeistAgent.InvalidSelector'
[method, selector] = args
throw new Poltergeist.InvalidSelector(method, selector)
else
throw new Poltergeist.BrowserError(result.error.message, result.error.stack)
else
result.value
canGoBack: ->
this.native().canGoBack
canGoForward: ->
this.native().canGoForward
normalizeURL: (url) ->
parser = document.createElement('a')
parser.href = url
return parser.href
clearMemoryCache: ->
clearMemoryCache = this.native().clearMemoryCache
if typeof clearMemoryCache == "function"
clearMemoryCache()
else
throw new Poltergeist.UnsupportedFeature("clearMemoryCache is supported since PhantomJS 2.0.0")
| 73475 | class Poltergeist.WebPage
@CALLBACKS = ['onConsoleMessage','onError',
'onLoadFinished', 'onInitialized', 'onLoadStarted',
'onResourceRequested', 'onResourceReceived', 'onResourceError',
'onNavigationRequested', 'onUrlChanged', 'onPageCreated',
'onClosing']
@DELEGATES = ['open', 'sendEvent', 'uploadFile', 'release', 'render',
'renderBase64', 'goBack', 'goForward']
@COMMANDS = ['currentUrl', 'find', 'nodeCall', 'documentSize',
'beforeUpload', 'afterUpload', 'clearLocalStorage']
@EXTENSIONS = []
constructor: (@_native) ->
@_native or= require('webpage').create()
@id = 0
@source = null
@closed = false
@state = 'default'
@urlWhitelist = []
@urlBlacklist = []
@errors = []
@_networkTraffic = {}
@_tempHeaders = {}
@_blockedUrls = []
@_requestedResources = {}
for callback in WebPage.CALLBACKS
this.bindCallback(callback)
for command in @COMMANDS
do (command) =>
this.prototype[command] =
(args...) -> this.runCommand(command, args)
for delegate in @DELEGATES
do (delegate) =>
this.prototype[delegate] =
-> @_native[delegate].apply(@_native, arguments)
onInitializedNative: ->
@id += 1
@source = null
@injectAgent()
this.removeTempHeaders()
this.setScrollPosition(left: 0, top: 0)
onClosingNative: ->
@handle = null
@closed = true
onConsoleMessageNative: (message) ->
if message == '__DOMContentLoaded'
@source = @_native.content
false
else
console.log(message)
onLoadStartedNative: ->
@state = 'loading'
@requestId = @lastRequestId
@_requestedResources = {}
onLoadFinishedNative: (@status) ->
@state = 'default'
@source or= @_native.content
onErrorNative: (message, stack) ->
stackString = message
stack.forEach (frame) ->
stackString += "\n"
stackString += " at #{frame.file}:#{frame.line}"
stackString += " in #{frame.function}" if frame.function && frame.function != ''
@errors.push(message: message, stack: stackString)
return true
onResourceRequestedNative: (request, net) ->
useWhitelist = @urlWhitelist.length > 0
whitelisted = @urlWhitelist.some (whitelisted_regex) ->
whitelisted_regex.test request.url
blacklisted = @urlBlacklist.some (blacklisted_regex) ->
blacklisted_regex.test request.url
abort = false
if useWhitelist && !whitelisted
abort = true
if blacklisted
abort = true
if abort
@_blockedUrls.push request.url unless request.url in @_blockedUrls
net.abort()
else
@lastRequestId = request.id
if @normalizeURL(request.url) == @redirectURL
@redirectURL = null
@requestId = request.id
@_networkTraffic[request.id] = {
request: request,
responseParts: []
error: null
}
@_requestedResources[request.id] = request.url
return true
onResourceReceivedNative: (response) ->
@_networkTraffic[response.id]?.responseParts.push(response)
if response.stage == 'end'
delete @_requestedResources[response.id]
if @requestId == response.id
if response.redirectURL
@redirectURL = @normalizeURL(response.redirectURL)
else
@statusCode = response.status
@_responseHeaders = response.headers
return true
onResourceErrorNative: (errorResponse) ->
@_networkTraffic[errorResponse.id]?.error = errorResponse
delete @_requestedResources[errorResponse.id]
return true
injectAgent: ->
if this.native().evaluate(-> typeof __poltergeist) == "undefined"
this.native().injectJs "#{phantom.libraryPath}/agent.js"
for extension in WebPage.EXTENSIONS
this.native().injectJs extension
return true
return false
injectExtension: (file) ->
WebPage.EXTENSIONS.push file
this.native().injectJs file
native: ->
if @closed
throw new Poltergeist.NoSuchWindowError
else
@_native
windowName: ->
this.native().windowName
keyCode: (name) ->
this.native().event.key[name]
keyModifierCode: (names) ->
modifiers = this.native().event.modifier
names = names.split(',').map ((name) -> modifiers[name])
names[0] | names[1] # return codes for 1 or 2 modifiers
keyModifierKeys: (names) ->
names.split(',').map (name) =>
this.keyCode(name.charAt(0).toUpperCase() + name.substring(1))
_waitState_until: (state, callback, timeout, timeout_callback) ->
if (@state == state)
callback.call(this)
else
if new Date().getTime() > timeout
timeout_callback.call(this)
else
setTimeout (=> @_waitState_until(state, callback, timeout, timeout_callback)), 100
waitState: (state, callback, max_wait=0, timeout_callback) ->
# callback and timeout_callback will be called with this == the current page
if @state == state
callback.call(this)
else
if max_wait != 0
timeout = new Date().getTime() + (max_wait*1000)
setTimeout (=> @_waitState_until(state, callback, timeout, timeout_callback)), 100
else
setTimeout (=> @waitState(state, callback)), 100
setHttpAuth: (user, password) ->
this.native().settings.userName = user
this.native().settings.password = <PASSWORD>
return true
networkTraffic: ->
@_networkTraffic
clearNetworkTraffic: ->
@_networkTraffic = {}
return true
blockedUrls: ->
@_blockedUrls
clearBlockedUrls: ->
@_blockedUrls = []
return true
openResourceRequests: ->
url for own id, url of @_requestedResources
content: ->
this.native().frameContent
title: ->
this.native().frameTitle
frameUrl: (frameNameOrId) ->
query = (frameNameOrId) ->
document.querySelector("iframe[name='#{frameNameOrId}'], iframe[id='#{frameNameOrId}']")?.src
this.evaluate(query, frameNameOrId)
clearErrors: ->
@errors = []
return true
responseHeaders: ->
headers = {}
@_responseHeaders.forEach (item) ->
headers[item.name] = item.value
headers
cookies: ->
this.native().cookies
deleteCookie: (name) ->
this.native().deleteCookie(name)
viewportSize: ->
this.native().viewportSize
setViewportSize: (size) ->
this.native().viewportSize = size
setZoomFactor: (zoom_factor) ->
this.native().zoomFactor = zoom_factor
setPaperSize: (size) ->
this.native().paperSize = size
scrollPosition: ->
this.native().scrollPosition
setScrollPosition: (pos) ->
this.native().scrollPosition = pos
clipRect: ->
this.native().clipRect
setClipRect: (rect) ->
this.native().clipRect = rect
elementBounds: (selector) ->
this.native().evaluate(
(selector) ->
document.querySelector(selector).getBoundingClientRect()
, selector
)
setUserAgent: (userAgent) ->
this.native().settings.userAgent = userAgent
getCustomHeaders: ->
this.native().customHeaders
setCustomHeaders: (headers) ->
this.native().customHeaders = headers
addTempHeader: (header) ->
for name, value of header
@_tempHeaders[name] = value
@_tempHeaders
removeTempHeaders: ->
allHeaders = this.getCustomHeaders()
for name, value of @_tempHeaders
delete allHeaders[name]
this.setCustomHeaders(allHeaders)
pushFrame: (name) ->
return true if this.native().switchToFrame(name)
# if switch by name fails - find index and try again
frame_no = this.native().evaluate(
(frame_name) ->
frames = document.querySelectorAll("iframe, frame")
(idx for f, idx in frames when f?['name'] == frame_name or f?['id'] == frame_name)[0]
, name)
frame_no? and this.native().switchToFrame(frame_no)
popFrame: (pop_all = false)->
if pop_all
this.native().switchToMainFrame()
else
this.native().switchToParentFrame()
dimensions: ->
scroll = this.scrollPosition()
viewport = this.viewportSize()
top: scroll.top, bottom: scroll.top + viewport.height,
left: scroll.left, right: scroll.left + viewport.width,
viewport: viewport
document: this.documentSize()
# A work around for http://code.google.com/p/phantomjs/issues/detail?id=277
validatedDimensions: ->
dimensions = this.dimensions()
document = dimensions.document
if dimensions.right > document.width
dimensions.left = Math.max(0, dimensions.left - (dimensions.right - document.width))
dimensions.right = document.width
if dimensions.bottom > document.height
dimensions.top = Math.max(0, dimensions.top - (dimensions.bottom - document.height))
dimensions.bottom = document.height
this.setScrollPosition(left: dimensions.left, top: dimensions.top)
dimensions
get: (id) ->
new Poltergeist.Node(this, id)
# Before each mouse event we make sure that the mouse is moved to where the
# event will take place. This deals with e.g. :hover changes.
mouseEvent: (name, x, y, button = 'left') ->
this.sendEvent('mousemove', x, y)
this.sendEvent(name, x, y, button)
evaluate: (fn, args...) ->
this.injectAgent()
JSON.parse this.sanitize(this.native().evaluate("function() { return PoltergeistAgent.stringify(#{this.stringifyCall(fn, args)}) }"))
sanitize: (potential_string) ->
if typeof(potential_string) == "string"
# JSON doesn't like \r or \n in strings unless escaped
potential_string.replace("\n","\\n").replace("\r","\\r")
else
potential_string
execute: (fn, args...) ->
this.native().evaluate("function() { #{this.stringifyCall(fn, args)} }")
stringifyCall: (fn, args) ->
if args.length == 0
"(#{fn.toString()})()"
else
# The JSON.stringify happens twice because the second time we are essentially
# escaping the string.
"(#{fn.toString()}).apply(this, PoltergeistAgent.JSON.parse(#{JSON.stringify(JSON.stringify(args))}))"
bindCallback: (name) ->
@native()[name] = =>
result = @[name + 'Native'].apply(@, arguments) if @[name + 'Native']? # For internal callbacks
@[name].apply(@, arguments) if result != false && @[name]? # For externally set callbacks
return true
# Any error raised here or inside the evaluate will get reported to
# phantom.onError. If result is null, that means there was an error
# inside the agent.
runCommand: (name, args) ->
result = this.evaluate(
(name, args) -> __poltergeist.externalCall(name, args),
name, args
)
if result != null
if result.error?
switch result.error.message
when 'PoltergeistAgent.ObsoleteNode'
throw new Poltergeist.ObsoleteNode
when 'PoltergeistAgent.InvalidSelector'
[method, selector] = args
throw new Poltergeist.InvalidSelector(method, selector)
else
throw new Poltergeist.BrowserError(result.error.message, result.error.stack)
else
result.value
canGoBack: ->
this.native().canGoBack
canGoForward: ->
this.native().canGoForward
normalizeURL: (url) ->
parser = document.createElement('a')
parser.href = url
return parser.href
clearMemoryCache: ->
clearMemoryCache = this.native().clearMemoryCache
if typeof clearMemoryCache == "function"
clearMemoryCache()
else
throw new Poltergeist.UnsupportedFeature("clearMemoryCache is supported since PhantomJS 2.0.0")
| true | class Poltergeist.WebPage
@CALLBACKS = ['onConsoleMessage','onError',
'onLoadFinished', 'onInitialized', 'onLoadStarted',
'onResourceRequested', 'onResourceReceived', 'onResourceError',
'onNavigationRequested', 'onUrlChanged', 'onPageCreated',
'onClosing']
@DELEGATES = ['open', 'sendEvent', 'uploadFile', 'release', 'render',
'renderBase64', 'goBack', 'goForward']
@COMMANDS = ['currentUrl', 'find', 'nodeCall', 'documentSize',
'beforeUpload', 'afterUpload', 'clearLocalStorage']
@EXTENSIONS = []
constructor: (@_native) ->
@_native or= require('webpage').create()
@id = 0
@source = null
@closed = false
@state = 'default'
@urlWhitelist = []
@urlBlacklist = []
@errors = []
@_networkTraffic = {}
@_tempHeaders = {}
@_blockedUrls = []
@_requestedResources = {}
for callback in WebPage.CALLBACKS
this.bindCallback(callback)
for command in @COMMANDS
do (command) =>
this.prototype[command] =
(args...) -> this.runCommand(command, args)
for delegate in @DELEGATES
do (delegate) =>
this.prototype[delegate] =
-> @_native[delegate].apply(@_native, arguments)
onInitializedNative: ->
@id += 1
@source = null
@injectAgent()
this.removeTempHeaders()
this.setScrollPosition(left: 0, top: 0)
onClosingNative: ->
@handle = null
@closed = true
onConsoleMessageNative: (message) ->
if message == '__DOMContentLoaded'
@source = @_native.content
false
else
console.log(message)
onLoadStartedNative: ->
@state = 'loading'
@requestId = @lastRequestId
@_requestedResources = {}
onLoadFinishedNative: (@status) ->
@state = 'default'
@source or= @_native.content
onErrorNative: (message, stack) ->
stackString = message
stack.forEach (frame) ->
stackString += "\n"
stackString += " at #{frame.file}:#{frame.line}"
stackString += " in #{frame.function}" if frame.function && frame.function != ''
@errors.push(message: message, stack: stackString)
return true
onResourceRequestedNative: (request, net) ->
useWhitelist = @urlWhitelist.length > 0
whitelisted = @urlWhitelist.some (whitelisted_regex) ->
whitelisted_regex.test request.url
blacklisted = @urlBlacklist.some (blacklisted_regex) ->
blacklisted_regex.test request.url
abort = false
if useWhitelist && !whitelisted
abort = true
if blacklisted
abort = true
if abort
@_blockedUrls.push request.url unless request.url in @_blockedUrls
net.abort()
else
@lastRequestId = request.id
if @normalizeURL(request.url) == @redirectURL
@redirectURL = null
@requestId = request.id
@_networkTraffic[request.id] = {
request: request,
responseParts: []
error: null
}
@_requestedResources[request.id] = request.url
return true
onResourceReceivedNative: (response) ->
@_networkTraffic[response.id]?.responseParts.push(response)
if response.stage == 'end'
delete @_requestedResources[response.id]
if @requestId == response.id
if response.redirectURL
@redirectURL = @normalizeURL(response.redirectURL)
else
@statusCode = response.status
@_responseHeaders = response.headers
return true
onResourceErrorNative: (errorResponse) ->
@_networkTraffic[errorResponse.id]?.error = errorResponse
delete @_requestedResources[errorResponse.id]
return true
injectAgent: ->
if this.native().evaluate(-> typeof __poltergeist) == "undefined"
this.native().injectJs "#{phantom.libraryPath}/agent.js"
for extension in WebPage.EXTENSIONS
this.native().injectJs extension
return true
return false
injectExtension: (file) ->
WebPage.EXTENSIONS.push file
this.native().injectJs file
native: ->
if @closed
throw new Poltergeist.NoSuchWindowError
else
@_native
windowName: ->
this.native().windowName
keyCode: (name) ->
this.native().event.key[name]
keyModifierCode: (names) ->
modifiers = this.native().event.modifier
names = names.split(',').map ((name) -> modifiers[name])
names[0] | names[1] # return codes for 1 or 2 modifiers
keyModifierKeys: (names) ->
names.split(',').map (name) =>
this.keyCode(name.charAt(0).toUpperCase() + name.substring(1))
_waitState_until: (state, callback, timeout, timeout_callback) ->
if (@state == state)
callback.call(this)
else
if new Date().getTime() > timeout
timeout_callback.call(this)
else
setTimeout (=> @_waitState_until(state, callback, timeout, timeout_callback)), 100
waitState: (state, callback, max_wait=0, timeout_callback) ->
# callback and timeout_callback will be called with this == the current page
if @state == state
callback.call(this)
else
if max_wait != 0
timeout = new Date().getTime() + (max_wait*1000)
setTimeout (=> @_waitState_until(state, callback, timeout, timeout_callback)), 100
else
setTimeout (=> @waitState(state, callback)), 100
setHttpAuth: (user, password) ->
this.native().settings.userName = user
this.native().settings.password = PI:PASSWORD:<PASSWORD>END_PI
return true
networkTraffic: ->
@_networkTraffic
clearNetworkTraffic: ->
@_networkTraffic = {}
return true
blockedUrls: ->
@_blockedUrls
clearBlockedUrls: ->
@_blockedUrls = []
return true
openResourceRequests: ->
url for own id, url of @_requestedResources
content: ->
this.native().frameContent
title: ->
this.native().frameTitle
frameUrl: (frameNameOrId) ->
query = (frameNameOrId) ->
document.querySelector("iframe[name='#{frameNameOrId}'], iframe[id='#{frameNameOrId}']")?.src
this.evaluate(query, frameNameOrId)
clearErrors: ->
@errors = []
return true
responseHeaders: ->
headers = {}
@_responseHeaders.forEach (item) ->
headers[item.name] = item.value
headers
cookies: ->
this.native().cookies
deleteCookie: (name) ->
this.native().deleteCookie(name)
viewportSize: ->
this.native().viewportSize
setViewportSize: (size) ->
this.native().viewportSize = size
setZoomFactor: (zoom_factor) ->
this.native().zoomFactor = zoom_factor
setPaperSize: (size) ->
this.native().paperSize = size
scrollPosition: ->
this.native().scrollPosition
setScrollPosition: (pos) ->
this.native().scrollPosition = pos
clipRect: ->
this.native().clipRect
setClipRect: (rect) ->
this.native().clipRect = rect
elementBounds: (selector) ->
this.native().evaluate(
(selector) ->
document.querySelector(selector).getBoundingClientRect()
, selector
)
setUserAgent: (userAgent) ->
this.native().settings.userAgent = userAgent
getCustomHeaders: ->
this.native().customHeaders
setCustomHeaders: (headers) ->
this.native().customHeaders = headers
addTempHeader: (header) ->
for name, value of header
@_tempHeaders[name] = value
@_tempHeaders
removeTempHeaders: ->
allHeaders = this.getCustomHeaders()
for name, value of @_tempHeaders
delete allHeaders[name]
this.setCustomHeaders(allHeaders)
pushFrame: (name) ->
return true if this.native().switchToFrame(name)
# if switch by name fails - find index and try again
frame_no = this.native().evaluate(
(frame_name) ->
frames = document.querySelectorAll("iframe, frame")
(idx for f, idx in frames when f?['name'] == frame_name or f?['id'] == frame_name)[0]
, name)
frame_no? and this.native().switchToFrame(frame_no)
popFrame: (pop_all = false)->
if pop_all
this.native().switchToMainFrame()
else
this.native().switchToParentFrame()
dimensions: ->
scroll = this.scrollPosition()
viewport = this.viewportSize()
top: scroll.top, bottom: scroll.top + viewport.height,
left: scroll.left, right: scroll.left + viewport.width,
viewport: viewport
document: this.documentSize()
# A work around for http://code.google.com/p/phantomjs/issues/detail?id=277
validatedDimensions: ->
dimensions = this.dimensions()
document = dimensions.document
if dimensions.right > document.width
dimensions.left = Math.max(0, dimensions.left - (dimensions.right - document.width))
dimensions.right = document.width
if dimensions.bottom > document.height
dimensions.top = Math.max(0, dimensions.top - (dimensions.bottom - document.height))
dimensions.bottom = document.height
this.setScrollPosition(left: dimensions.left, top: dimensions.top)
dimensions
get: (id) ->
new Poltergeist.Node(this, id)
# Before each mouse event we make sure that the mouse is moved to where the
# event will take place. This deals with e.g. :hover changes.
mouseEvent: (name, x, y, button = 'left') ->
this.sendEvent('mousemove', x, y)
this.sendEvent(name, x, y, button)
evaluate: (fn, args...) ->
this.injectAgent()
JSON.parse this.sanitize(this.native().evaluate("function() { return PoltergeistAgent.stringify(#{this.stringifyCall(fn, args)}) }"))
sanitize: (potential_string) ->
if typeof(potential_string) == "string"
# JSON doesn't like \r or \n in strings unless escaped
potential_string.replace("\n","\\n").replace("\r","\\r")
else
potential_string
execute: (fn, args...) ->
this.native().evaluate("function() { #{this.stringifyCall(fn, args)} }")
stringifyCall: (fn, args) ->
if args.length == 0
"(#{fn.toString()})()"
else
# The JSON.stringify happens twice because the second time we are essentially
# escaping the string.
"(#{fn.toString()}).apply(this, PoltergeistAgent.JSON.parse(#{JSON.stringify(JSON.stringify(args))}))"
bindCallback: (name) ->
@native()[name] = =>
result = @[name + 'Native'].apply(@, arguments) if @[name + 'Native']? # For internal callbacks
@[name].apply(@, arguments) if result != false && @[name]? # For externally set callbacks
return true
# Any error raised here or inside the evaluate will get reported to
# phantom.onError. If result is null, that means there was an error
# inside the agent.
runCommand: (name, args) ->
result = this.evaluate(
(name, args) -> __poltergeist.externalCall(name, args),
name, args
)
if result != null
if result.error?
switch result.error.message
when 'PoltergeistAgent.ObsoleteNode'
throw new Poltergeist.ObsoleteNode
when 'PoltergeistAgent.InvalidSelector'
[method, selector] = args
throw new Poltergeist.InvalidSelector(method, selector)
else
throw new Poltergeist.BrowserError(result.error.message, result.error.stack)
else
result.value
canGoBack: ->
this.native().canGoBack
canGoForward: ->
this.native().canGoForward
normalizeURL: (url) ->
parser = document.createElement('a')
parser.href = url
return parser.href
clearMemoryCache: ->
clearMemoryCache = this.native().clearMemoryCache
if typeof clearMemoryCache == "function"
clearMemoryCache()
else
throw new Poltergeist.UnsupportedFeature("clearMemoryCache is supported since PhantomJS 2.0.0")
|
[
{
"context": "n some tests\nclass Snake\n constructor: (@name = 'Pat') ->\nclass Python extends Snake\n constructor: (@",
"end": 433,
"score": 0.9520220160484314,
"start": 430,
"tag": "NAME",
"value": "Pat"
},
{
"context": "ed\"]\n python = new Python()\n singer = { name: \"John... | test/test-clone-map-each.coffee | spacegangster/f-empower | 1 | f_empower = require '../f-empower.umd'
fs = require 'fs'
assert = require 'assert'
tooling = require './tooling'
{ equal
equal_deep
log
newline
print_json
testing } = tooling
{ a_each
bind
clonedeep
clonedeep2
each
index_of
is_plain_object
is_function
inc
map
merge
partial
push
slice
sort
sumn } = f_empower
# Classes used in some tests
class Snake
constructor: (@name = 'Pat') ->
class Python extends Snake
constructor: (@length = 10) ->
super()
class Tree
constructor: (children) ->
@float_id = Math.random()
@parent = null
@children = []
if children
@set_children(children)
set_children: (children) ->
@children.length = 0
for child in children
@children.push(child)
child.parent = this
# child1 = new Tree()
# child2 = new Tree()
# child3 = new Tree()
# complex_src2 = new Tree([
# child1, child2, child3
# ])
# #
# #
# result = (fn.clonedeep2 complex_src2)
test_clonefn = (cloningfn) ->
# INIT
list = [ "no", "rest", "for", "the", "wicked"]
python = new Python()
singer = { name: "Johny"
, last: "Cash" }
complex_src =
{ string : "foo"
, answer : 42
, python : python
, list : list
, obj : singer }
#
child1 = new Tree()
child2 = new Tree()
child3 = new Tree()
complex_src2 = new Tree([
child1, child2, child3
])
#
#
result = (cloningfn complex_src)
for key, val of result
if typeof val != 'object'
(equal complex_src[key], val)
# class instance should be cloned as plain object
python.length = 20
(equal result.python.length, 10)
# object must be cloned
singer.name = "Mary"
(equal result.obj.name, "Johny")
# array must be cloned
list[0] = "there will be"
(equal result.list[0], "no")
#
#
result2 = (cloningfn complex_src2)
(assert.ok result2.children.length == 3)
(assert.ok result2.children[0].parent == result2)
test_clonedeep = ->
console.log "testing clonedeep..."
(test_clonefn clonedeep)
console.log "ok"
test_clonedeep2 = ->
console.log "testing clonedeep2..."
(test_clonefn clonedeep2)
console.log "ok"
test_each = ->
testing "each"
results = null
write_result = ->
(push results, (slice arguments))
#
results = []
(each write_result, [1, 2, 3])
(equal_deep results, [[1], [2], [3]])
log "each:arity 2 is ok"
#
results = []
(each write_result, [1, 2], [1, 2, 3])
(equal_deep results, [[1, 1], [2, 2]])
results = []
(each write_result, [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1], [2, 2], [3, 3]])
log "each:arity 3 is ok"
#
results = []
(each write_result, [1, 2], [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1, 1], [2, 2, 2]])
results = []
(each write_result, [1, 2, 3], [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1, 1], [2, 2, 2], [3, 3, 3]])
log "each:arity n is ok"
test_map = ->
testing "map"
#
(equal (sumn 1, 2), 3)
(equal (sumn 1, 2, 3, 4), 10)
log "helper function is ok"
#
(equal_deep (map inc, [0, 1, 2]), [1, 2, 3])
log "map:arity 2 is ok"
#
(equal_deep (map sumn, [1, 2], [1]), [2]) # result length should equals to the length of the shortest arr
(equal_deep (map sumn, [1, 2], [1, 2]), [2, 4])
log "map:arity 3 is ok"
#
(equal_deep (map sumn, [1, 2], [1, 2, 3], [1, 2, 3]), [3, 6])
(equal_deep (map sumn, [1, 2, 3], [1, 2, 3], [1, 2, 3]), [3, 6, 9])
log "map:arity n is ok"
test_merge = ->
testing "merge"
#1
b = {
foo: 'bar'
editor: 'vim'
city: 'Moscow'
}
b.loop = b
result = (merge {}, b)
(assert result.loop.loop.loop == result.loop)
#2
class Editor
constructor: (@name) ->
class Editor2
constructor: (@name) ->
a = {
editor: 'vim'
ctor_opts:
{ ctor: Editor }
plugins:
tabs: true
coffeescript: true
clojure: true
array: [ "should", "also", "be", "merged" ]
}
b = {
editor: 'emacs'
ctor_opts:
{ ctor: Editor2 }
plugins:
tabs: false
coffeescript: false
javascript: true
array: [ "don't" ]
}
result = (merge a, b)
(assert.deepEqual result,
{ editor: 'emacs'
, ctor_opts:
{ ctor: Editor2 }
, plugins:
{ tabs: false
, coffeescript: false
, clojure: true
, javascript: true }
, array: [ "don't", "also", "be", "merged" ] } )
log "ok"
test_is_plain_object = ->
testing "is_plain_object"
#
sammy = new Python(4)
(assert !(is_plain_object sammy))
(assert (is_plain_object {editor: 'vim'}))
#
log "ok"
test_sort = ->
testing "sort"
george = {name: 'George', age: 35}
chuck = {name: 'Chuck', age: 80}
ivan = {name: 'Ivan', age: 20}
unsorted = [ george, chuck, ivan ]
sorted = [ ivan, george, chuck ]
sorted_by_name = [ chuck, george, ivan ]
(equal_deep (sort 'age', unsorted)
, sorted)
(equal_deep (sort 'name', unsorted)
, sorted_by_name)
log "ok"
tests =
[ test_clonedeep
, test_clonedeep2
, test_map
, test_each
, test_merge
, test_is_plain_object
, test_sort ]
for test in tests
test()
newline()
| 76257 | f_empower = require '../f-empower.umd'
fs = require 'fs'
assert = require 'assert'
tooling = require './tooling'
{ equal
equal_deep
log
newline
print_json
testing } = tooling
{ a_each
bind
clonedeep
clonedeep2
each
index_of
is_plain_object
is_function
inc
map
merge
partial
push
slice
sort
sumn } = f_empower
# Classes used in some tests
class Snake
constructor: (@name = '<NAME>') ->
class Python extends Snake
constructor: (@length = 10) ->
super()
class Tree
constructor: (children) ->
@float_id = Math.random()
@parent = null
@children = []
if children
@set_children(children)
set_children: (children) ->
@children.length = 0
for child in children
@children.push(child)
child.parent = this
# child1 = new Tree()
# child2 = new Tree()
# child3 = new Tree()
# complex_src2 = new Tree([
# child1, child2, child3
# ])
# #
# #
# result = (fn.clonedeep2 complex_src2)
test_clonefn = (cloningfn) ->
# INIT
list = [ "no", "rest", "for", "the", "wicked"]
python = new Python()
singer = { name: "<NAME>"
, last: "Cash" }
complex_src =
{ string : "foo"
, answer : 42
, python : python
, list : list
, obj : singer }
#
child1 = new Tree()
child2 = new Tree()
child3 = new Tree()
complex_src2 = new Tree([
child1, child2, child3
])
#
#
result = (cloningfn complex_src)
for key, val of result
if typeof val != 'object'
(equal complex_src[key], val)
# class instance should be cloned as plain object
python.length = 20
(equal result.python.length, 10)
# object must be cloned
singer.name = "<NAME>"
(equal result.obj.name, "<NAME>")
# array must be cloned
list[0] = "there will be"
(equal result.list[0], "no")
#
#
result2 = (cloningfn complex_src2)
(assert.ok result2.children.length == 3)
(assert.ok result2.children[0].parent == result2)
test_clonedeep = ->
console.log "testing clonedeep..."
(test_clonefn clonedeep)
console.log "ok"
test_clonedeep2 = ->
console.log "testing clonedeep2..."
(test_clonefn clonedeep2)
console.log "ok"
test_each = ->
testing "each"
results = null
write_result = ->
(push results, (slice arguments))
#
results = []
(each write_result, [1, 2, 3])
(equal_deep results, [[1], [2], [3]])
log "each:arity 2 is ok"
#
results = []
(each write_result, [1, 2], [1, 2, 3])
(equal_deep results, [[1, 1], [2, 2]])
results = []
(each write_result, [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1], [2, 2], [3, 3]])
log "each:arity 3 is ok"
#
results = []
(each write_result, [1, 2], [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1, 1], [2, 2, 2]])
results = []
(each write_result, [1, 2, 3], [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1, 1], [2, 2, 2], [3, 3, 3]])
log "each:arity n is ok"
test_map = ->
testing "map"
#
(equal (sumn 1, 2), 3)
(equal (sumn 1, 2, 3, 4), 10)
log "helper function is ok"
#
(equal_deep (map inc, [0, 1, 2]), [1, 2, 3])
log "map:arity 2 is ok"
#
(equal_deep (map sumn, [1, 2], [1]), [2]) # result length should equals to the length of the shortest arr
(equal_deep (map sumn, [1, 2], [1, 2]), [2, 4])
log "map:arity 3 is ok"
#
(equal_deep (map sumn, [1, 2], [1, 2, 3], [1, 2, 3]), [3, 6])
(equal_deep (map sumn, [1, 2, 3], [1, 2, 3], [1, 2, 3]), [3, 6, 9])
log "map:arity n is ok"
test_merge = ->
testing "merge"
#1
b = {
foo: 'bar'
editor: 'vim'
city: 'Moscow'
}
b.loop = b
result = (merge {}, b)
(assert result.loop.loop.loop == result.loop)
#2
class Editor
constructor: (@name) ->
class Editor2
constructor: (@name) ->
a = {
editor: 'vim'
ctor_opts:
{ ctor: Editor }
plugins:
tabs: true
coffeescript: true
clojure: true
array: [ "should", "also", "be", "merged" ]
}
b = {
editor: 'emacs'
ctor_opts:
{ ctor: Editor2 }
plugins:
tabs: false
coffeescript: false
javascript: true
array: [ "don't" ]
}
result = (merge a, b)
(assert.deepEqual result,
{ editor: 'emacs'
, ctor_opts:
{ ctor: Editor2 }
, plugins:
{ tabs: false
, coffeescript: false
, clojure: true
, javascript: true }
, array: [ "don't", "also", "be", "merged" ] } )
log "ok"
test_is_plain_object = ->
testing "is_plain_object"
#
sammy = new Python(4)
(assert !(is_plain_object sammy))
(assert (is_plain_object {editor: 'vim'}))
#
log "ok"
test_sort = ->
testing "sort"
george = {name: '<NAME>', age: 35}
chuck = {name: '<NAME>', age: 80}
ivan = {name: '<NAME>', age: 20}
unsorted = [ george, chuck, ivan ]
sorted = [ ivan, <NAME>, <NAME> ]
sorted_by_name = [ chuck, <NAME>, <NAME> ]
(equal_deep (sort 'age', unsorted)
, sorted)
(equal_deep (sort 'name', unsorted)
, sorted_by_name)
log "ok"
tests =
[ test_clonedeep
, test_clonedeep2
, test_map
, test_each
, test_merge
, test_is_plain_object
, test_sort ]
for test in tests
test()
newline()
| true | f_empower = require '../f-empower.umd'
fs = require 'fs'
assert = require 'assert'
tooling = require './tooling'
{ equal
equal_deep
log
newline
print_json
testing } = tooling
{ a_each
bind
clonedeep
clonedeep2
each
index_of
is_plain_object
is_function
inc
map
merge
partial
push
slice
sort
sumn } = f_empower
# Classes used in some tests
class Snake
constructor: (@name = 'PI:NAME:<NAME>END_PI') ->
class Python extends Snake
constructor: (@length = 10) ->
super()
class Tree
constructor: (children) ->
@float_id = Math.random()
@parent = null
@children = []
if children
@set_children(children)
set_children: (children) ->
@children.length = 0
for child in children
@children.push(child)
child.parent = this
# child1 = new Tree()
# child2 = new Tree()
# child3 = new Tree()
# complex_src2 = new Tree([
# child1, child2, child3
# ])
# #
# #
# result = (fn.clonedeep2 complex_src2)
test_clonefn = (cloningfn) ->
# INIT
list = [ "no", "rest", "for", "the", "wicked"]
python = new Python()
singer = { name: "PI:NAME:<NAME>END_PI"
, last: "Cash" }
complex_src =
{ string : "foo"
, answer : 42
, python : python
, list : list
, obj : singer }
#
child1 = new Tree()
child2 = new Tree()
child3 = new Tree()
complex_src2 = new Tree([
child1, child2, child3
])
#
#
result = (cloningfn complex_src)
for key, val of result
if typeof val != 'object'
(equal complex_src[key], val)
# class instance should be cloned as plain object
python.length = 20
(equal result.python.length, 10)
# object must be cloned
singer.name = "PI:NAME:<NAME>END_PI"
(equal result.obj.name, "PI:NAME:<NAME>END_PI")
# array must be cloned
list[0] = "there will be"
(equal result.list[0], "no")
#
#
result2 = (cloningfn complex_src2)
(assert.ok result2.children.length == 3)
(assert.ok result2.children[0].parent == result2)
test_clonedeep = ->
console.log "testing clonedeep..."
(test_clonefn clonedeep)
console.log "ok"
test_clonedeep2 = ->
console.log "testing clonedeep2..."
(test_clonefn clonedeep2)
console.log "ok"
test_each = ->
testing "each"
results = null
write_result = ->
(push results, (slice arguments))
#
results = []
(each write_result, [1, 2, 3])
(equal_deep results, [[1], [2], [3]])
log "each:arity 2 is ok"
#
results = []
(each write_result, [1, 2], [1, 2, 3])
(equal_deep results, [[1, 1], [2, 2]])
results = []
(each write_result, [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1], [2, 2], [3, 3]])
log "each:arity 3 is ok"
#
results = []
(each write_result, [1, 2], [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1, 1], [2, 2, 2]])
results = []
(each write_result, [1, 2, 3], [1, 2, 3], [1, 2, 3])
(equal_deep results, [[1, 1, 1], [2, 2, 2], [3, 3, 3]])
log "each:arity n is ok"
test_map = ->
testing "map"
#
(equal (sumn 1, 2), 3)
(equal (sumn 1, 2, 3, 4), 10)
log "helper function is ok"
#
(equal_deep (map inc, [0, 1, 2]), [1, 2, 3])
log "map:arity 2 is ok"
#
(equal_deep (map sumn, [1, 2], [1]), [2]) # result length should equals to the length of the shortest arr
(equal_deep (map sumn, [1, 2], [1, 2]), [2, 4])
log "map:arity 3 is ok"
#
(equal_deep (map sumn, [1, 2], [1, 2, 3], [1, 2, 3]), [3, 6])
(equal_deep (map sumn, [1, 2, 3], [1, 2, 3], [1, 2, 3]), [3, 6, 9])
log "map:arity n is ok"
test_merge = ->
testing "merge"
#1
b = {
foo: 'bar'
editor: 'vim'
city: 'Moscow'
}
b.loop = b
result = (merge {}, b)
(assert result.loop.loop.loop == result.loop)
#2
class Editor
constructor: (@name) ->
class Editor2
constructor: (@name) ->
a = {
editor: 'vim'
ctor_opts:
{ ctor: Editor }
plugins:
tabs: true
coffeescript: true
clojure: true
array: [ "should", "also", "be", "merged" ]
}
b = {
editor: 'emacs'
ctor_opts:
{ ctor: Editor2 }
plugins:
tabs: false
coffeescript: false
javascript: true
array: [ "don't" ]
}
result = (merge a, b)
(assert.deepEqual result,
{ editor: 'emacs'
, ctor_opts:
{ ctor: Editor2 }
, plugins:
{ tabs: false
, coffeescript: false
, clojure: true
, javascript: true }
, array: [ "don't", "also", "be", "merged" ] } )
log "ok"
test_is_plain_object = ->
testing "is_plain_object"
#
sammy = new Python(4)
(assert !(is_plain_object sammy))
(assert (is_plain_object {editor: 'vim'}))
#
log "ok"
test_sort = ->
testing "sort"
george = {name: 'PI:NAME:<NAME>END_PI', age: 35}
chuck = {name: 'PI:NAME:<NAME>END_PI', age: 80}
ivan = {name: 'PI:NAME:<NAME>END_PI', age: 20}
unsorted = [ george, chuck, ivan ]
sorted = [ ivan, PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI ]
sorted_by_name = [ chuck, PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI ]
(equal_deep (sort 'age', unsorted)
, sorted)
(equal_deep (sort 'name', unsorted)
, sorted_by_name)
log "ok"
tests =
[ test_clonedeep
, test_clonedeep2
, test_map
, test_each
, test_merge
, test_is_plain_object
, test_sort ]
for test in tests
test()
newline()
|
[
{
"context": "er\r\nnav = app.views.nav\r\nregister =\r\n username: 'test'\r\n newUsername: 'test2'\r\n email: 'test@test.com",
"end": 164,
"score": 0.9994540810585022,
"start": 160,
"tag": "USERNAME",
"value": "test"
},
{
"context": "\r\nregister =\r\n username: 'test'\r\n newU... | features/step_definitions/registerUser.coffee | eribeiro9/CoLabs | 0 | require.call this, '../lib/util.coffee'
app = require '../lib/app.coffee'
modal = app.modals.loginOrRegister
nav = app.views.nav
register =
username: 'test'
newUsername: 'test2'
email: 'test@test.com'
password: '123'
mismatchPassword: '1234'
fillForm = (fields) ->
modal.inputs.username.setValue fields.username
if fields.email
modal.inputs.email.setValue fields.email
modal.inputs.password.setValue fields.password
if fields.mismatchPassword
modal.inputs.verifyPassword.setValue fields.mismatchPassword
else
modal.inputs.verifyPassword.setValue fields.password
modal.buttons.submit.click()
module.exports = ->
@Given /^I am at the register form$/, ->
browser.url app.baseUrl
if !nav.links.signIn.isDisplayed()
nav.buttons.collapse.click()
nav.links.signIn.click()
modal.inputs.signupOption.click()
@When /^I open the login modal$/, ->
if !nav.links.signIn.isDisplayed()
nav.buttons.collapse.click()
nav.links.signIn.click()
@When /^I click the register button$/, ->
modal.inputs.signupOption.click()
@When /^I click the close button$/, ->
modal.buttons.close.click()
@When /^I register (.*) email$/, (email) ->
fillForm
username: if email == 'without' then register.newUsername else register.username
email: if email == 'with' then register.email else null
password: register.password
@When /^I enter an existing (.*)/, (field) ->
fillForm
username: if field == 'username' then register.username else register.newUsername
email: if field == 'email' then register.email else null
password: register.password
@When /^I enter non-matching passwords$/, ->
fillForm
username: register.username
password: register.password
mismatchPassword: register.mismatchPassword
@Then /^The login modal appears$/, ->
client.pause 500
expect(modal.isDisplayed()).toBe true
@Then /^The register form appears$/, ->
value = modal.buttons.submit.attr 'value'
expect(value).toEqual 'Sign Up'
@Then /^The register modal disappears$/, ->
client.pause 500
expect(modal.isDisplayed()).toBe false
| 76990 | require.call this, '../lib/util.coffee'
app = require '../lib/app.coffee'
modal = app.modals.loginOrRegister
nav = app.views.nav
register =
username: 'test'
newUsername: 'test2'
email: '<EMAIL>'
password: '<PASSWORD>'
mismatchPassword: '<PASSWORD>'
fillForm = (fields) ->
modal.inputs.username.setValue fields.username
if fields.email
modal.inputs.email.setValue fields.email
modal.inputs.password.setValue fields.password
if fields.mismatchPassword
modal.inputs.verifyPassword.setValue fields.mismatchPassword
else
modal.inputs.verifyPassword.setValue fields.password
modal.buttons.submit.click()
module.exports = ->
@Given /^I am at the register form$/, ->
browser.url app.baseUrl
if !nav.links.signIn.isDisplayed()
nav.buttons.collapse.click()
nav.links.signIn.click()
modal.inputs.signupOption.click()
@When /^I open the login modal$/, ->
if !nav.links.signIn.isDisplayed()
nav.buttons.collapse.click()
nav.links.signIn.click()
@When /^I click the register button$/, ->
modal.inputs.signupOption.click()
@When /^I click the close button$/, ->
modal.buttons.close.click()
@When /^I register (.*) email$/, (email) ->
fillForm
username: if email == 'without' then register.newUsername else register.username
email: if email == 'with' then register.email else null
password: <PASSWORD>
@When /^I enter an existing (.*)/, (field) ->
fillForm
username: if field == 'username' then register.username else register.newUsername
email: if field == 'email' then register.email else null
password: <PASSWORD>
@When /^I enter non-matching passwords$/, ->
fillForm
username: register.username
password: <PASSWORD>
mismatchPassword: <PASSWORD>Password
@Then /^The login modal appears$/, ->
client.pause 500
expect(modal.isDisplayed()).toBe true
@Then /^The register form appears$/, ->
value = modal.buttons.submit.attr 'value'
expect(value).toEqual 'Sign Up'
@Then /^The register modal disappears$/, ->
client.pause 500
expect(modal.isDisplayed()).toBe false
| true | require.call this, '../lib/util.coffee'
app = require '../lib/app.coffee'
modal = app.modals.loginOrRegister
nav = app.views.nav
register =
username: 'test'
newUsername: 'test2'
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
mismatchPassword: 'PI:PASSWORD:<PASSWORD>END_PI'
fillForm = (fields) ->
modal.inputs.username.setValue fields.username
if fields.email
modal.inputs.email.setValue fields.email
modal.inputs.password.setValue fields.password
if fields.mismatchPassword
modal.inputs.verifyPassword.setValue fields.mismatchPassword
else
modal.inputs.verifyPassword.setValue fields.password
modal.buttons.submit.click()
module.exports = ->
@Given /^I am at the register form$/, ->
browser.url app.baseUrl
if !nav.links.signIn.isDisplayed()
nav.buttons.collapse.click()
nav.links.signIn.click()
modal.inputs.signupOption.click()
@When /^I open the login modal$/, ->
if !nav.links.signIn.isDisplayed()
nav.buttons.collapse.click()
nav.links.signIn.click()
@When /^I click the register button$/, ->
modal.inputs.signupOption.click()
@When /^I click the close button$/, ->
modal.buttons.close.click()
@When /^I register (.*) email$/, (email) ->
fillForm
username: if email == 'without' then register.newUsername else register.username
email: if email == 'with' then register.email else null
password: PI:PASSWORD:<PASSWORD>END_PI
@When /^I enter an existing (.*)/, (field) ->
fillForm
username: if field == 'username' then register.username else register.newUsername
email: if field == 'email' then register.email else null
password: PI:PASSWORD:<PASSWORD>END_PI
@When /^I enter non-matching passwords$/, ->
fillForm
username: register.username
password: PI:PASSWORD:<PASSWORD>END_PI
mismatchPassword: PI:PASSWORD:<PASSWORD>END_PIPassword
@Then /^The login modal appears$/, ->
client.pause 500
expect(modal.isDisplayed()).toBe true
@Then /^The register form appears$/, ->
value = modal.buttons.submit.attr 'value'
expect(value).toEqual 'Sign Up'
@Then /^The register modal disappears$/, ->
client.pause 500
expect(modal.isDisplayed()).toBe false
|
[
{
"context": "c10943ba1af0e004b90f3a095\"\n first_name: \"TBD\"\n last_name: \"\"\n @actionsView = new S",
"end": 942,
"score": 0.841780424118042,
"start": 939,
"tag": "NAME",
"value": "TBD"
}
] | app/assets/javascripts/views/assignments/list_item.js.coffee | rescuedcode/StaffPlan | 3 | class StaffPlan.Views.Assignments.ListItem extends Support.CompositeView
className: "user-list-item list-item"
updateWorkWeeksView: (begin) ->
@workWeeksView.collection = @model.work_weeks.between(begin, begin + @numberOfBars * 7 * 86400 * 1000)
@workWeeksView.render()
initialize: (options={}) ->
@parent = options.parent
@model.collection.on "change:user_id", (event) => @render()
@startDate = options.start.valueOf()
@on "date:changed", (message) =>
@workWeeksView.trigger "date:changed", message
render: ->
if _.isNumber @model.get("user_id")
@$el.html HandlebarsTemplates["assignments/user_item"]
user: StaffPlan.users.get(@model.get("user_id")).attributes
else
@$el.html HandlebarsTemplates["assignments/user_item"]
user:
id: 0
gravatar: "https://secure.gravatar.com/avatar/ee56924c10943ba1af0e004b90f3a095"
first_name: "TBD"
last_name: ""
@actionsView = new StaffPlan.Views.StaffPlans.AssignmentActions
model: @model
parent: @
@renderChildInto @actionsView, @$el.find "div.user-info div.assignment-actions"
@workWeeksView = new window.StaffPlan.Views.Projects.WorkWeeks
collection: @model.work_weeks
start: @startDate
count: @parent.numberOfBars
@renderChildInto @workWeeksView, @$el.find "div.user-hour-inputs"
@assignmentTotalsView = new StaffPlan.Views.StaffPlans.AssignmentTotals
model: @model
parent: @
@renderChildInto @assignmentTotalsView, @$el.find "div.totals.fixed-60"
@
| 18185 | class StaffPlan.Views.Assignments.ListItem extends Support.CompositeView
className: "user-list-item list-item"
updateWorkWeeksView: (begin) ->
@workWeeksView.collection = @model.work_weeks.between(begin, begin + @numberOfBars * 7 * 86400 * 1000)
@workWeeksView.render()
initialize: (options={}) ->
@parent = options.parent
@model.collection.on "change:user_id", (event) => @render()
@startDate = options.start.valueOf()
@on "date:changed", (message) =>
@workWeeksView.trigger "date:changed", message
render: ->
if _.isNumber @model.get("user_id")
@$el.html HandlebarsTemplates["assignments/user_item"]
user: StaffPlan.users.get(@model.get("user_id")).attributes
else
@$el.html HandlebarsTemplates["assignments/user_item"]
user:
id: 0
gravatar: "https://secure.gravatar.com/avatar/ee56924c10943ba1af0e004b90f3a095"
first_name: "<NAME>"
last_name: ""
@actionsView = new StaffPlan.Views.StaffPlans.AssignmentActions
model: @model
parent: @
@renderChildInto @actionsView, @$el.find "div.user-info div.assignment-actions"
@workWeeksView = new window.StaffPlan.Views.Projects.WorkWeeks
collection: @model.work_weeks
start: @startDate
count: @parent.numberOfBars
@renderChildInto @workWeeksView, @$el.find "div.user-hour-inputs"
@assignmentTotalsView = new StaffPlan.Views.StaffPlans.AssignmentTotals
model: @model
parent: @
@renderChildInto @assignmentTotalsView, @$el.find "div.totals.fixed-60"
@
| true | class StaffPlan.Views.Assignments.ListItem extends Support.CompositeView
className: "user-list-item list-item"
updateWorkWeeksView: (begin) ->
@workWeeksView.collection = @model.work_weeks.between(begin, begin + @numberOfBars * 7 * 86400 * 1000)
@workWeeksView.render()
initialize: (options={}) ->
@parent = options.parent
@model.collection.on "change:user_id", (event) => @render()
@startDate = options.start.valueOf()
@on "date:changed", (message) =>
@workWeeksView.trigger "date:changed", message
render: ->
if _.isNumber @model.get("user_id")
@$el.html HandlebarsTemplates["assignments/user_item"]
user: StaffPlan.users.get(@model.get("user_id")).attributes
else
@$el.html HandlebarsTemplates["assignments/user_item"]
user:
id: 0
gravatar: "https://secure.gravatar.com/avatar/ee56924c10943ba1af0e004b90f3a095"
first_name: "PI:NAME:<NAME>END_PI"
last_name: ""
@actionsView = new StaffPlan.Views.StaffPlans.AssignmentActions
model: @model
parent: @
@renderChildInto @actionsView, @$el.find "div.user-info div.assignment-actions"
@workWeeksView = new window.StaffPlan.Views.Projects.WorkWeeks
collection: @model.work_weeks
start: @startDate
count: @parent.numberOfBars
@renderChildInto @workWeeksView, @$el.find "div.user-hour-inputs"
@assignmentTotalsView = new StaffPlan.Views.StaffPlans.AssignmentTotals
model: @model
parent: @
@renderChildInto @assignmentTotalsView, @$el.find "div.totals.fixed-60"
@
|
[
{
"context": " foaas fascinating :from\n\n Copyright © 2014 Paulo Diovani <paulo@diovani.com>\n This work is free. You ",
"end": 709,
"score": 0.999880850315094,
"start": 696,
"tag": "NAME",
"value": "Paulo Diovani"
},
{
"context": "ting :from\n\n Copyright © 2014 Pa... | coffee/foaas.coffee | paulodiovani/foaas-client | 5 | http = require('http')
# Test the params
check_params = ->
if not process.argv[2]? or not process.argv[3]?
usage = """
Usage 1: foaas message :name [:from]
Usage 2: foaas :name [:from]
foaas off :name :from
foaas you :name :from
foaas this :from
foaas that :from
foaas everything :from
foaas everyone :from
foaas donut :name :from
foaas shakespeare :name :from
foaas linus :name :from
foaas king :name :from
foaas pink :from
foaas life :from
foaas chainsaw :name :from
foaas :thing :from
foaas thanks :from
foaas flying :from
foaas fascinating :from
Copyright © 2014 Paulo Diovani <paulo@diovani.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the COPYING file for more details.
"""
console.info(usage)
process.exit(0)
# Get the path url, based on the command line parameters
# @param {Array} params
get_url = (params) ->
url = ""
url += "/#{encodeURIComponent(p)}" for p in params
url
# Do a request do service_host and return the Fuck Off message
# @param {String} service_host where do request
# @return {String}
fuckoff_request = (service_host = "foaas.com") ->
check_params()
options =
host: service_host
port: 80
path: get_url(process.argv[2..])
method: 'GET'
http.request(options, (res) ->
res.setEncoding('utf8')
res.on('data', (data) ->
console.log data
)
)
.on('error', (e) ->
console.error e.message
)
.end()
# export
module.exports = fuckoff_request
| 80447 | http = require('http')
# Test the params
check_params = ->
if not process.argv[2]? or not process.argv[3]?
usage = """
Usage 1: foaas message :name [:from]
Usage 2: foaas :name [:from]
foaas off :name :from
foaas you :name :from
foaas this :from
foaas that :from
foaas everything :from
foaas everyone :from
foaas donut :name :from
foaas shakespeare :name :from
foaas linus :name :from
foaas king :name :from
foaas pink :from
foaas life :from
foaas chainsaw :name :from
foaas :thing :from
foaas thanks :from
foaas flying :from
foaas fascinating :from
Copyright © 2014 <NAME> <<EMAIL>>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the COPYING file for more details.
"""
console.info(usage)
process.exit(0)
# Get the path url, based on the command line parameters
# @param {Array} params
get_url = (params) ->
url = ""
url += "/#{encodeURIComponent(p)}" for p in params
url
# Do a request do service_host and return the Fuck Off message
# @param {String} service_host where do request
# @return {String}
fuckoff_request = (service_host = "foaas.com") ->
check_params()
options =
host: service_host
port: 80
path: get_url(process.argv[2..])
method: 'GET'
http.request(options, (res) ->
res.setEncoding('utf8')
res.on('data', (data) ->
console.log data
)
)
.on('error', (e) ->
console.error e.message
)
.end()
# export
module.exports = fuckoff_request
| true | http = require('http')
# Test the params
check_params = ->
if not process.argv[2]? or not process.argv[3]?
usage = """
Usage 1: foaas message :name [:from]
Usage 2: foaas :name [:from]
foaas off :name :from
foaas you :name :from
foaas this :from
foaas that :from
foaas everything :from
foaas everyone :from
foaas donut :name :from
foaas shakespeare :name :from
foaas linus :name :from
foaas king :name :from
foaas pink :from
foaas life :from
foaas chainsaw :name :from
foaas :thing :from
foaas thanks :from
foaas flying :from
foaas fascinating :from
Copyright © 2014 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the COPYING file for more details.
"""
console.info(usage)
process.exit(0)
# Get the path url, based on the command line parameters
# @param {Array} params
get_url = (params) ->
url = ""
url += "/#{encodeURIComponent(p)}" for p in params
url
# Do a request do service_host and return the Fuck Off message
# @param {String} service_host where do request
# @return {String}
fuckoff_request = (service_host = "foaas.com") ->
check_params()
options =
host: service_host
port: 80
path: get_url(process.argv[2..])
method: 'GET'
http.request(options, (res) ->
res.setEncoding('utf8')
res.on('data', (data) ->
console.log data
)
)
.on('error', (e) ->
console.error e.message
)
.end()
# export
module.exports = fuckoff_request
|
[
{
"context": "ue }} {% endfor %}\")\n tmpl.render(data: {name:\"fred\", job:\"developer\"}).should.equal \"name is fred jo",
"end": 952,
"score": 0.9980717301368713,
"start": 948,
"tag": "NAME",
"value": "fred"
},
{
"context": "me:\"fred\", job:\"developer\"}).should.equal \"name ... | node_modules/liquid.coffee/test/lib/liquid/tags/for_test.coffee | darkoverlordofdata/shmupwarz-ooc | 1 | describe 'Liquid for tag ', ->
it "{% for item in collection %}{% endfor %}", ->
render("{% for item in (1..3) %}{{ item }}{% endfor %}").should.equal "123"
render("{% for item in (1..3) limit: 2 %}{{ item }}{% endfor %}").should.equal "12"
render("{% for item in (1..3) %} {{ forloop.index }} {% endfor %}").should.equal " 1 2 3 "
# render("{% for item in (1..3) reversed %} {{ forloop.index }} {% endfor %}").should.equal " 3 2 1 "
render("{% for item in (1..3) %} {{ forloop.index0 }} {% endfor %}").should.equal " 0 1 2 "
render("{% for item in (1..3) %} {{ forloop.first }} {% endfor %}").should.equal " true false false "
render("{% for item in (1..3) %} {{ forloop.last }} {% endfor %}").should.equal " false false true "
it "should treat hash as an array", ->
tmpl = Liquid.Template.parse("{% for item in data %}{{ item.key }} is {{ item.value }} {% endfor %}")
tmpl.render(data: {name:"fred", job:"developer"}).should.equal "name is fred job is developer "
it "should nest for loops", ->
#
src = "{% for outer in (1..4) %}{% for inner in (1..2) %}({{ forloop.index }}/{{ forloop.length }}),{% endfor %}{% endfor %}"
render(src).should.eq "(1/2),(2/2),(1/2),(2/2),(1/2),(2/2),(1/2),(2/2),"
| 91280 | describe 'Liquid for tag ', ->
it "{% for item in collection %}{% endfor %}", ->
render("{% for item in (1..3) %}{{ item }}{% endfor %}").should.equal "123"
render("{% for item in (1..3) limit: 2 %}{{ item }}{% endfor %}").should.equal "12"
render("{% for item in (1..3) %} {{ forloop.index }} {% endfor %}").should.equal " 1 2 3 "
# render("{% for item in (1..3) reversed %} {{ forloop.index }} {% endfor %}").should.equal " 3 2 1 "
render("{% for item in (1..3) %} {{ forloop.index0 }} {% endfor %}").should.equal " 0 1 2 "
render("{% for item in (1..3) %} {{ forloop.first }} {% endfor %}").should.equal " true false false "
render("{% for item in (1..3) %} {{ forloop.last }} {% endfor %}").should.equal " false false true "
it "should treat hash as an array", ->
tmpl = Liquid.Template.parse("{% for item in data %}{{ item.key }} is {{ item.value }} {% endfor %}")
tmpl.render(data: {name:"<NAME>", job:"developer"}).should.equal "name is <NAME> job is developer "
it "should nest for loops", ->
#
src = "{% for outer in (1..4) %}{% for inner in (1..2) %}({{ forloop.index }}/{{ forloop.length }}),{% endfor %}{% endfor %}"
render(src).should.eq "(1/2),(2/2),(1/2),(2/2),(1/2),(2/2),(1/2),(2/2),"
| true | describe 'Liquid for tag ', ->
it "{% for item in collection %}{% endfor %}", ->
render("{% for item in (1..3) %}{{ item }}{% endfor %}").should.equal "123"
render("{% for item in (1..3) limit: 2 %}{{ item }}{% endfor %}").should.equal "12"
render("{% for item in (1..3) %} {{ forloop.index }} {% endfor %}").should.equal " 1 2 3 "
# render("{% for item in (1..3) reversed %} {{ forloop.index }} {% endfor %}").should.equal " 3 2 1 "
render("{% for item in (1..3) %} {{ forloop.index0 }} {% endfor %}").should.equal " 0 1 2 "
render("{% for item in (1..3) %} {{ forloop.first }} {% endfor %}").should.equal " true false false "
render("{% for item in (1..3) %} {{ forloop.last }} {% endfor %}").should.equal " false false true "
it "should treat hash as an array", ->
tmpl = Liquid.Template.parse("{% for item in data %}{{ item.key }} is {{ item.value }} {% endfor %}")
tmpl.render(data: {name:"PI:NAME:<NAME>END_PI", job:"developer"}).should.equal "name is PI:NAME:<NAME>END_PI job is developer "
it "should nest for loops", ->
#
src = "{% for outer in (1..4) %}{% for inner in (1..2) %}({{ forloop.index }}/{{ forloop.length }}),{% endfor %}{% endfor %}"
render(src).should.eq "(1/2),(2/2),(1/2),(2/2),(1/2),(2/2),(1/2),(2/2),"
|
[
{
"context": " dateformat.i18n =\n dayNames: [\n 'Zon', 'Maa', 'Din', 'Woe', 'Don', 'Vri', 'Zat',\n ",
"end": 1893,
"score": 0.8095139861106873,
"start": 1892,
"tag": "NAME",
"value": "Z"
},
{
"context": "rmat.i18n =\n dayNames: [\n 'Zon', 'Maa', 'Di... | alarm-clock.coffee | bertreb/alarm-clock | 0 | module.exports = () ->
Promise = require('bluebird')
i2c = require('i2c-bus')
SerialPort = require('serialport')
Schedule = require('node-schedule')
CronJob = require('cron').CronJob
mqtt = require('mqtt')
path = require('path')
winston = require('winston')
fs = require('fs')
Moment = require('moment-timezone')
colors = require "colors"
dateformat = require('dateformat')
SunCalc = require('suncalc')
rpi_gpio_buttons = require('rpi-gpio-buttons')
dateholidays = require 'date-holidays'
class AlarmClock
constructor: () ->
#
# set logging
#
logfile = path.join(__dirname, 'alarm-clock.log')
@logger = winston.createLogger({
level: 'debug'
format: winston.format.combine(
winston.format.timestamp(),
winston.format.colorize(),
winston.format.printf((info) =>
ts2 = Moment(info.timestamp).format("HH:mm:ss.SSS")
ts2 = ts2.grey
return "#{ts2} [#{info.level}] #{info.message}"
)
)
transports: [
new winston.transports.File({
filename: logfile,
format: winston.format.uncolorize({level:false})
})
]
})
if (process.env.NODE_ENV isnt 'production')
@logger.add(new winston.transports.Console({
format: winston.format.combine(winston.format.colorize({level:true}))
}))
@logger.info("Logger started")
#
# read configuration
#
@config = {}
@configFullFilename = path.join __dirname, 'alarm-clock.json'
@numbertable = [
0x3F, # 0
0x06, # 1
0x5B, # 2
0x4F, # 3
0x66, # 4
0x6D, # 5
0x7D, # 6
0x07, # 7
0x7F, # 8
0x6F # 9
]
dateformat.i18n =
dayNames: [
'Zon', 'Maa', 'Din', 'Woe', 'Don', 'Vri', 'Zat',
'Zondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag'
],
monthNames: [
'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec',
'Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'
],
timeNames: [
'a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM'
]
@HT16K33_BLINK_CMD = 0x80
@HT16K33_DISPLAY_ON = 0x01
@HT16K33_DISPLAY_OFF = 0x00
@HT16K33_DISPLAY_BLINK = 0x05
@TURN_OSCILLATOR_ON = 0x21
@HT16K33_CMD_BRIGHTNESS = 0xE0
@dot1 = false
@dot2 = false
@dot3 = false
@timedots = false
@dots = 0x00
@setDots(4,true)
@startDisplay(0x70)
#
# init alarm
#
@alarmActive = false
@alarmSnooze = 0
afterBootDisplay = () =>
@setDisplayState(1)
@setAlarmclock()
@setDisplayTime()
@minuteTick = new CronJob
cronTime: '0 */1 * * * *'
onTick: =>
@setDisplayTime()
@minuteTick.start()
@brightnessTick = new CronJob
cronTime: '0 0 3 * * *'
runOnInit: true
onTick: =>
@logger.info "Midnight sunrise and sunset update"
d = new Date()
times = SunCalc.getTimes(d, @config.alarmclock.latitude, @config.alarmclock.longitude)
if @timerSunrise? then clearTimeout(@timerSunrise)
if @timerSunset? then clearTimeout(@timerSunset)
onSunrise = () =>
@setBrightness(@config.alarmclock.brightnessDay)
@logger.info "Sunrise, brightness to #{@config.alarmclock.brightnessDay}"
onSunset = () =>
@setBrightness(@config.alarmclock.brightnessNight)
@logger.info "Sunset, brightness to #{@config.alarmclock.brightnessNight}"
_timeToSunrise = times.sunrise - Date.now()
_timeToSunset = times.sunset - Date.now()
@logger.info "Brightness sunrise set at " + times.sunrise.toString() + ", _timeToSunrise: " + _timeToSunrise
if _timeToSunrise > 0
@timerSunrise = setTimeout(onSunrise, _timeToSunrise)
@logger.info "Brightness sunrise set at " + times.sunrise.toString()
@logger.info "Brightness sunset set at " + times.sunset.toString() + ", _timeToSunset: " + _timeToSunset
if _timeToSunset > 0
@timerSunset = setTimeout(onSunset, _timeToSunset)
@logger.info "Brigtness sunset set at " + times.sunset.toString()
@brightnessTick.start()
@nextAlarmTick = new CronJob
cronTime: '0 0 12 * * *'
runOnInit: true
onTick: =>
@setAlarmclock()
@setDisplayTime()
@logger.info "Noon new day setAlarmClock"
@nextAlarmTick.start()
@afterBootTimer = setTimeout(afterBootDisplay,5000)
#
# init WavTrigger
#
@port = new SerialPort('/dev/ttyS0', { autoOpen: false, baudRate: 57600 })
@wtStart()
@wtDefaultVolume = -10
@wtVolume(@wtDefaultVolume)
@readConfig()
.then () =>
@dh = new dateholidays(@config.alarmclock.country, @config.alarmclock.state)
#
# init mqtt
#
options =
host: @config.mqtt.host
port: @config.mqtt.port
username: @config.mqtt.username
password: @config.mqtt.password
clientId: "alarmclock"
protocolVersion: 4
@mqttClient = mqtt.connect(options)
@mqttClient.on 'connect', =>
@logger.info "Connected to mqtt"
@mqttClient.subscribe('schanswal/alarmclock/#', (err,granted)=>
if err?
@logger.error("Subscribe error: " + err)
else
@logger.info("subscribed to " + JSON.stringify(granted))
@mqttClient.publish("schanswal/alarmclock/alarmclock/status", (if @config.alarmclock.state then "on" else "off"), (err) =>
if err?
@logger.info "error publishing state: " + err
)
)
@mqttClient.on 'error', (err) =>
@logger.info ("Mqtt connect error: " + err)
@mqttClient.on 'message', (topic, message, packet) =>
@logger.info(JSON.stringify("topic: " + topic + ", message: " + message))
items = topic.split('/')
if String items[0] is "schanswal" and String items[1] is "alarmclock"
@logger.info("mqtt: " + items[2] + ", message: " + message)
switch String items[2]
when "alarm"
if (String message) == "on"
@playAlarm()
else if (String message) == "off"
@stopAlarm()
when "brightness"
@setBrightness(Number message)
@logger.info "Brightness set to #{message}"
when "alarmclock"
if (String message) == "on"
@setAlarmclock(true)
@logger.info "Alarmclock switched on"
else if (String message) == "off"
@setAlarmclock(false)
@logger.info "Alarmclock switched off"
@setDisplayTime()
@updateConfig()
when "alarmtime"
try
data = JSON.parse(message)
@config["schedule"] = data
@setAlarmclock()
@setDisplayTime()
@updateConfig()
catch err
@logger.error("ERROR schedule not set, error in JSON.parse mqtt message, " + err)
else
@logger.info "other message received: " + message
#
# button definitions
#
@buttonPin = @config.alarmclock.buttonPin
@button = rpi_gpio_buttons([@buttonPin],{ mode: rpi_gpio_buttons.MODE_BCM })
@button.setTiming({debounce: 100, clicked: 300, pressed: 600 })
@button.on 'clicked', (p) =>
@logger.info("button clicked")
if @alarmActive
@stopAlarm()
@blinkDot(true)
snooze = () =>
@alarmActive = true
@playAlarm()
@alarmSnooze +=1
if @alarmSnooze is 8
@button.emit 'pressed', p
@logger.info("Snoozing stopped")
@alarmSnooze = 0
clearTimeout(@snozer)
else
@snozer = setTimeout(snooze,300000)
@logger.info("Snoozing...")
else if @alarmSnooze is 0
@mqttClient.publish("schanswal/alarmclock/button", "1", (err) =>
if err?
@logger.info "error publishing state: " + err
)
@button.on 'pressed', (p)=>
# stop alarm and sleep
if @alarmActive
@stopAlarm()
@logger.info("Snoozing stopped")
if @snozer?
@alarmSnooze = 0
clearTimeout(@snozer)
@logger.info("Snoozing stopped")
@blinkDot(false)
@setAlarmclock()
@logger.info("button pressed")
#stop alarm and don't sleep
@button.on 'clicked_pressed', (p)=>
@logger.info("button clicked_pressed")
#stop alarm and don't sleep
@button.on 'double_clicked', (p) =>
@logger.info("button double clicked")
#action
.catch (err) =>
@logger.error "error: " + err
return
setAlarmclock: (_s) =>
if _s?
_state = _s
@config.alarmclock.state = _s
else
_state = @config.alarmclock.state
if _state is false
@setDots(1,false)
@setDots(2,false)
if @alarm?
@alarm.cancel()
@logger.info "Alarm cancelled"
else
@setDots(1,true)
_alarm = @setSchedule(@config.schedule)
d = new Date()
tomorrow = Moment(d).add(1, 'days')
tomorrowIsHoliday = @dh.isHoliday(tomorrow) and @config.alarmclock.disableOnHolidays
tomorrowString = dateformat(tomorrow,"yyyy-mm-dd")
nextAlarmString = dateformat(@alarm.nextInvocation(), "yyyy-mm-dd")
if Moment(tomorrowString).isSame(nextAlarmString,'day') and not tomorrowIsHoliday
@setDots(2,true)
@logger.info "alarm set for tomorrow"
@mqttClient.publish("schanswal/alarmclock/nextalarm", dateformat(_alarm.nextInvocation(), "dddd H:MM"), (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
else
@setDots(2,false)
@mqttClient.publish("schanswal/alarmclock/nextalarm", "geen alarm", (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
setSchedule: (data) =>
@logger.info "data: " + JSON.stringify(data)
if (Number data.hour) >= 0 and (Number data.hour) <= 23 and (Number data.minute) >= 0 and (Number data.minute) <= 59
if @alarm? then @alarm.cancel()
rule = new Schedule.RecurrenceRule()
rule.dayOfWeek = [data.days]
rule.hour = Number data.hour
rule.minute = Number data.minute
if @alarm? then @alarm.cancel()
@logger.info "Schedule set for " + data.hour + ":" + data.minute + ", on days: " + data.days
@alarm = Schedule.scheduleJob(rule,() =>
d = new Date()
todayIsHoliday = @dh.isHoliday(d)
unless @config.alarmclock.disableOnHolidays and todayIsHoliday
@playAlarm()
if @config.alarmclock.disableOnHolidays and todayIsHoliday
@logger.info "Today is a holiday"
tomorrow = Moment(d).add(1, 'days')
tomorrowIsHoliday = @dh.isHoliday(tomorrow) and @config.alarmclock.disableOnHolidays
@logger.debug "tomorrowIsHoliday: " + tomorrowIsHoliday
tomorrowString = dateformat(tomorrow,"yyyy-mm-dd")
nextAlarmString = dateformat(@alarm.nextInvocation(), "yyyy-mm-dd")
if Moment(tomorrowString).isSame(nextAlarmString,'day') and not tomorrowIsHoliday
@setDots(2,true)
@logger.info "alarm set for tomorrow"
@mqttClient.publish("schanswal/alarmclock/nextalarm", dateformat(@alarm.nextInvocation(), "dddd H:MM"), (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
else
@setDots(2,false)
@mqttClient.publish("schanswal/alarmclock/nextalarm", "geen alarm", (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
)
return @alarm
readConfig: () =>
return new Promise ((resolve, reject) =>
if !fs.existsSync(@configFullFilename)
@logger.error "Config doesn't exists!"
reject("Config doesn't exists")
else
fs.readFile(@configFullFilename, 'utf8', (err, data) =>
if !(err)
try
@config = JSON.parse(data)
#@logger.error "Config read: " + JSON.stringify(@config)
resolve()
catch err
@logger.error "Config JSON not valid: " + err
reject("Config JSON not valid")
else
@logger.error "Config doesn't exists: " + err
reject("Config doesn't exists")
)
)
updateConfig: () =>
try
fs.writeFileSync @configFullFilename, JSON.stringify(@config,null,2)
catch err
if not err
@logger.info "Config updated"
else
@logger.error "Config not updated"
stopAlarm: () =>
@alarmActive = false
if @fadeTimer? then clearTimeout(@fadeTimer)
if @maxPlayTimer? then clearTimeout(@maxPlayTimer)
@wtStop()
@setDisplayState(1)
@setDisplayTime()
playAlarm: () =>
@alarmActive = true
@_volume = -40
@wtVolume(@_volume)
_track = Math.floor((Math.random() * 4) + 2)
@wtSolo(_track)
fade = () =>
@_volume += 1
@wtVolume(@_volume)
@fadeTimer = setTimeout(fade,1000) if @_volume < @wtDefaultVolume
fade()
@setDisplayState(2)
@setDisplayTime()
maxPlayTime = () =>
@button.emit 'clicked', @buttonPin
@maxPlayTimer = setTimeout(maxPlayTime, 60000)
startDisplay: (_addr) =>
@HT16K33_ADDR = _addr
@i2c1 = i2c.open(1, (err) =>
if err? then throw err
turnOnBuffer = Buffer.alloc(1)
turnOnBuffer[0] = @TURN_OSCILLATOR_ON
@i2c1.i2cWrite(@HT16K33_ADDR,turnOnBuffer.length, turnOnBuffer, (err, bytesWritten, buffer) =>
if err? then throw err
@setDisplayState(2)
d = new Date()
times = SunCalc.getTimes(d, @config.latitude, @config.longitude)
if Moment(d).isAfter(times.sunrise) and Moment(d).isBefore(times.sunsetStart)
@setBrightness(@config.alarmclock.brightnessDay)
else
@setBrightness(@config.alarmclock.brightnessNight)
@setDisplayTime(0,0)
)
)
setDisplayState: (_state) =>
switch _state
when 0
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_OFF;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
when 2
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_BLINK;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
else
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_ON;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
setBrightness: (_brightness) =>
brightnessbuffer = Buffer.alloc(1);
if _brightness < 0 or _brightness>15 then _brightness = 0
brightnessbuffer[0] = @HT16K33_CMD_BRIGHTNESS | _brightness;
@i2c1.i2cWrite(@HT16K33_ADDR, brightnessbuffer.length, brightnessbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
setDisplayTime: (_h,_m) =>
try
_time = new Date()
_hours = if _h? then _h else _time.getHours()
_minutes = if _m? then _m else _time.getMinutes()
if _hours < 0 or _hours > 23 then _hours = 23
if _minutes < 0 or _minutes > 59 then minutes = 59
if _hours < 10
_digit1 = 0
_digit2 = Number (String _hours)[0]
else
_digit1 = Number (String _hours)[0]
_digit2 = Number (String _hours)[1]
if _minutes < 10
_digit3 = 0
_digit4 = Number (String _minutes)[0]
else
_digit3 = Number (String _minutes)[0]
_digit4 = Number (String _minutes)[1]
displaybuffer = Buffer.alloc(11,0x00)
displaybuffer[1] = @numbertable[_digit1]
displaybuffer[3] = @numbertable[_digit2]
displaybuffer[5] = @dots
displaybuffer[7] = @numbertable[_digit3]
displaybuffer[9] = @numbertable[_digit4]
@i2c1.i2cWrite(@HT16K33_ADDR, displaybuffer.length, displaybuffer, (err, bytesWritten, buffer) =>
#@logger.info('Display written ' + bytesWritten)
)
catch err
@logger.info "eeror in setDisplay: " + err
blinkDot: (_enabled) =>
@blinkOn = false
@dotstate = false
if @blinkDotTimer? then clearTimeout(@blinkDotTimer)
if _enabled
@blinkOn = true
dotBlinking = () =>
@dotState = !@dotState
@setDots(2,@dotState)
@setDisplayTime()
@blinkDotTimer = setTimeout(dotBlinking,1000) unless @blinkOn is false
dotBlinking()
else
@setDots(2,false)
@setDisplayTime()
@blinkOn = false
setDots: (_nr, _state) =>
switch _nr
when 1
@dot1 = _state
when 2
@dot2 = _state
when 3
@dot3 = _state
when 4
@timedots = _state
@dots = 0x00 | (if @dot1 then 0x08) | (if @dot2 then 0x04) | (if @dot3 then 0x10) | (if @timedots then 0x03)
clearDisplay: () =>
displaybuffer = Buffer.alloc(11,0x00)
@i2c1.i2cWrite(@HT16K33_ADDR, displaybuffer.length, displaybuffer, (err, bytesWritten, buffer) =>
#@logger.info('Display written ' + bytesWritten)
)
wtStart: () =>
_WT_GET_VERSION = [0xF0,0xAA,0x05,0x01,0x55]
@port.open((err) =>
if err
@logger.info('Error opening port: ', err.message)
@wtPower(true)
# play startup tune
@wtSolo(99)
)
wtPower: (_state) =>
_WT_AMP_POWER = [0xF0,0xAA,0x06,0x09,0x00,0x55]
if _state
_WT_AMP_POWER[4] = 0x01
@port.write(Buffer.from(_WT_AMP_POWER))
else
@port.write(Buffer.from(_WT_AMP_POWER))
wtVolume: (_volume) =>
_WT_VOLUME = [0xF0,0xAA,0x07,0x05,0x00,0x00,0x55]
if _volume < -70 then _volume = -70
if _volume > 4 then _volume = 4
_WT_VOLUME[4] = _volume & 0xFF
_WT_VOLUME[5] = (_volume & 0xFF00) >> 8
@port.write(Buffer.from(_WT_VOLUME))
wtSolo: (_track) =>
_WT_TRACK_SOLO = [0xF0,0xAA,0x08,0x03,0x00,0x00,0x00,0x55]
_WT_TRACK_SOLO[5] = _track & 0xFF
_WT_TRACK_SOLO[6] = (_track & 0xFF00) >> 8
@port.write(Buffer.from(_WT_TRACK_SOLO))
wtFade: (_track) =>
_WT_FADE = [0xF0,0xAA,0x0C,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55]
_volume = 0
_time = 10000
_WT_FADE[4] = _track & 0xFF
_WT_FADE[5] = (_track & 0xFF00) >> 8
_WT_FADE[6] = _volume & 0xFF
_WT_FADE[7] = (_volume & 0xFF00) >> 8
_WT_FADE[8] = _time & 0xFF
_WT_FADE[9] = (_time & 0xFF00) >> 8
#_WT_FADE[10] = 0x00
@port.write(Buffer.from(_WT_FADE))
wtStop: () =>
_WT_STOP_ALL = [0xF0,0xAA,0x05,0x04,0x55]
#_WT_TRACK_STOP = [0xF0,0xAA,0x08,0x03,0x04,0x00,0x00,0x55]
#_WT_TRACK_STOP[5] = _track & 0xFF
#_WT_TRACK_STOP[6] = (_track & 0xFF00) >> 8
@port.write(Buffer.from(_WT_STOP_ALL))
destroy:() =>
return new Promise( (resolve, reject) =>
@port.close()
if @alarm? then @alarm.cancel()
@minuteTick.stop()
@nextAlarmTick.stop()
@brightnessTick.stop()
@button.removeAllListeners()
@mqttClient.removeAllListeners()
if @snozer? then clearTimeout(@snozer)
if @maxPlayTimer? then clearTimeout(@maxPlayTimer)
if @afterBootTimer? then clearTimeout(@afterBootTimer)
if @blinkDotTimer? then clearTimeout(@blinkDotTimer)
if @fadeTimer? then clearTimeout(@fadeTimer)
if @timerSunrise? then clearTimeout(@timerSunrise)
if @timerSunset? then clearTimeout(@timerSunset)
resolve()
)
return new AlarmClock
| 207846 | module.exports = () ->
Promise = require('bluebird')
i2c = require('i2c-bus')
SerialPort = require('serialport')
Schedule = require('node-schedule')
CronJob = require('cron').CronJob
mqtt = require('mqtt')
path = require('path')
winston = require('winston')
fs = require('fs')
Moment = require('moment-timezone')
colors = require "colors"
dateformat = require('dateformat')
SunCalc = require('suncalc')
rpi_gpio_buttons = require('rpi-gpio-buttons')
dateholidays = require 'date-holidays'
class AlarmClock
constructor: () ->
#
# set logging
#
logfile = path.join(__dirname, 'alarm-clock.log')
@logger = winston.createLogger({
level: 'debug'
format: winston.format.combine(
winston.format.timestamp(),
winston.format.colorize(),
winston.format.printf((info) =>
ts2 = Moment(info.timestamp).format("HH:mm:ss.SSS")
ts2 = ts2.grey
return "#{ts2} [#{info.level}] #{info.message}"
)
)
transports: [
new winston.transports.File({
filename: logfile,
format: winston.format.uncolorize({level:false})
})
]
})
if (process.env.NODE_ENV isnt 'production')
@logger.add(new winston.transports.Console({
format: winston.format.combine(winston.format.colorize({level:true}))
}))
@logger.info("Logger started")
#
# read configuration
#
@config = {}
@configFullFilename = path.join __dirname, 'alarm-clock.json'
@numbertable = [
0x3F, # 0
0x06, # 1
0x5B, # 2
0x4F, # 3
0x66, # 4
0x6D, # 5
0x7D, # 6
0x07, # 7
0x7F, # 8
0x6F # 9
]
dateformat.i18n =
dayNames: [
'<NAME>on', '<NAME>aa', '<NAME>', '<NAME>', '<NAME>', '<NAME>', '<NAME>at',
'<NAME>ondag', '<NAME>andag', '<NAME>dag', '<NAME>dag', '<NAME>derdag', '<NAME>rijdag', 'Zaterdag'
],
monthNames: [
'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec',
'Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'
],
timeNames: [
'a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM'
]
@HT16K33_BLINK_CMD = 0x80
@HT16K33_DISPLAY_ON = 0x01
@HT16K33_DISPLAY_OFF = 0x00
@HT16K33_DISPLAY_BLINK = 0x05
@TURN_OSCILLATOR_ON = 0x21
@HT16K33_CMD_BRIGHTNESS = 0xE0
@dot1 = false
@dot2 = false
@dot3 = false
@timedots = false
@dots = 0x00
@setDots(4,true)
@startDisplay(0x70)
#
# init alarm
#
@alarmActive = false
@alarmSnooze = 0
afterBootDisplay = () =>
@setDisplayState(1)
@setAlarmclock()
@setDisplayTime()
@minuteTick = new CronJob
cronTime: '0 */1 * * * *'
onTick: =>
@setDisplayTime()
@minuteTick.start()
@brightnessTick = new CronJob
cronTime: '0 0 3 * * *'
runOnInit: true
onTick: =>
@logger.info "Midnight sunrise and sunset update"
d = new Date()
times = SunCalc.getTimes(d, @config.alarmclock.latitude, @config.alarmclock.longitude)
if @timerSunrise? then clearTimeout(@timerSunrise)
if @timerSunset? then clearTimeout(@timerSunset)
onSunrise = () =>
@setBrightness(@config.alarmclock.brightnessDay)
@logger.info "Sunrise, brightness to #{@config.alarmclock.brightnessDay}"
onSunset = () =>
@setBrightness(@config.alarmclock.brightnessNight)
@logger.info "Sunset, brightness to #{@config.alarmclock.brightnessNight}"
_timeToSunrise = times.sunrise - Date.now()
_timeToSunset = times.sunset - Date.now()
@logger.info "Brightness sunrise set at " + times.sunrise.toString() + ", _timeToSunrise: " + _timeToSunrise
if _timeToSunrise > 0
@timerSunrise = setTimeout(onSunrise, _timeToSunrise)
@logger.info "Brightness sunrise set at " + times.sunrise.toString()
@logger.info "Brightness sunset set at " + times.sunset.toString() + ", _timeToSunset: " + _timeToSunset
if _timeToSunset > 0
@timerSunset = setTimeout(onSunset, _timeToSunset)
@logger.info "Brigtness sunset set at " + times.sunset.toString()
@brightnessTick.start()
@nextAlarmTick = new CronJob
cronTime: '0 0 12 * * *'
runOnInit: true
onTick: =>
@setAlarmclock()
@setDisplayTime()
@logger.info "Noon new day setAlarmClock"
@nextAlarmTick.start()
@afterBootTimer = setTimeout(afterBootDisplay,5000)
#
# init WavTrigger
#
@port = new SerialPort('/dev/ttyS0', { autoOpen: false, baudRate: 57600 })
@wtStart()
@wtDefaultVolume = -10
@wtVolume(@wtDefaultVolume)
@readConfig()
.then () =>
@dh = new dateholidays(@config.alarmclock.country, @config.alarmclock.state)
#
# init mqtt
#
options =
host: @config.mqtt.host
port: @config.mqtt.port
username: @config.mqtt.username
password: @config.mqtt.password
clientId: "alarmclock"
protocolVersion: 4
@mqttClient = mqtt.connect(options)
@mqttClient.on 'connect', =>
@logger.info "Connected to mqtt"
@mqttClient.subscribe('schanswal/alarmclock/#', (err,granted)=>
if err?
@logger.error("Subscribe error: " + err)
else
@logger.info("subscribed to " + JSON.stringify(granted))
@mqttClient.publish("schanswal/alarmclock/alarmclock/status", (if @config.alarmclock.state then "on" else "off"), (err) =>
if err?
@logger.info "error publishing state: " + err
)
)
@mqttClient.on 'error', (err) =>
@logger.info ("Mqtt connect error: " + err)
@mqttClient.on 'message', (topic, message, packet) =>
@logger.info(JSON.stringify("topic: " + topic + ", message: " + message))
items = topic.split('/')
if String items[0] is "schanswal" and String items[1] is "alarmclock"
@logger.info("mqtt: " + items[2] + ", message: " + message)
switch String items[2]
when "alarm"
if (String message) == "on"
@playAlarm()
else if (String message) == "off"
@stopAlarm()
when "brightness"
@setBrightness(Number message)
@logger.info "Brightness set to #{message}"
when "alarmclock"
if (String message) == "on"
@setAlarmclock(true)
@logger.info "Alarmclock switched on"
else if (String message) == "off"
@setAlarmclock(false)
@logger.info "Alarmclock switched off"
@setDisplayTime()
@updateConfig()
when "alarmtime"
try
data = JSON.parse(message)
@config["schedule"] = data
@setAlarmclock()
@setDisplayTime()
@updateConfig()
catch err
@logger.error("ERROR schedule not set, error in JSON.parse mqtt message, " + err)
else
@logger.info "other message received: " + message
#
# button definitions
#
@buttonPin = @config.alarmclock.buttonPin
@button = rpi_gpio_buttons([@buttonPin],{ mode: rpi_gpio_buttons.MODE_BCM })
@button.setTiming({debounce: 100, clicked: 300, pressed: 600 })
@button.on 'clicked', (p) =>
@logger.info("button clicked")
if @alarmActive
@stopAlarm()
@blinkDot(true)
snooze = () =>
@alarmActive = true
@playAlarm()
@alarmSnooze +=1
if @alarmSnooze is 8
@button.emit 'pressed', p
@logger.info("Snoozing stopped")
@alarmSnooze = 0
clearTimeout(@snozer)
else
@snozer = setTimeout(snooze,300000)
@logger.info("Snoozing...")
else if @alarmSnooze is 0
@mqttClient.publish("schanswal/alarmclock/button", "1", (err) =>
if err?
@logger.info "error publishing state: " + err
)
@button.on 'pressed', (p)=>
# stop alarm and sleep
if @alarmActive
@stopAlarm()
@logger.info("Snoozing stopped")
if @snozer?
@alarmSnooze = 0
clearTimeout(@snozer)
@logger.info("Snoozing stopped")
@blinkDot(false)
@setAlarmclock()
@logger.info("button pressed")
#stop alarm and don't sleep
@button.on 'clicked_pressed', (p)=>
@logger.info("button clicked_pressed")
#stop alarm and don't sleep
@button.on 'double_clicked', (p) =>
@logger.info("button double clicked")
#action
.catch (err) =>
@logger.error "error: " + err
return
setAlarmclock: (_s) =>
if _s?
_state = _s
@config.alarmclock.state = _s
else
_state = @config.alarmclock.state
if _state is false
@setDots(1,false)
@setDots(2,false)
if @alarm?
@alarm.cancel()
@logger.info "Alarm cancelled"
else
@setDots(1,true)
_alarm = @setSchedule(@config.schedule)
d = new Date()
tomorrow = Moment(d).add(1, 'days')
tomorrowIsHoliday = @dh.isHoliday(tomorrow) and @config.alarmclock.disableOnHolidays
tomorrowString = dateformat(tomorrow,"yyyy-mm-dd")
nextAlarmString = dateformat(@alarm.nextInvocation(), "yyyy-mm-dd")
if Moment(tomorrowString).isSame(nextAlarmString,'day') and not tomorrowIsHoliday
@setDots(2,true)
@logger.info "alarm set for tomorrow"
@mqttClient.publish("schanswal/alarmclock/nextalarm", dateformat(_alarm.nextInvocation(), "dddd H:MM"), (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
else
@setDots(2,false)
@mqttClient.publish("schanswal/alarmclock/nextalarm", "geen alarm", (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
setSchedule: (data) =>
@logger.info "data: " + JSON.stringify(data)
if (Number data.hour) >= 0 and (Number data.hour) <= 23 and (Number data.minute) >= 0 and (Number data.minute) <= 59
if @alarm? then @alarm.cancel()
rule = new Schedule.RecurrenceRule()
rule.dayOfWeek = [data.days]
rule.hour = Number data.hour
rule.minute = Number data.minute
if @alarm? then @alarm.cancel()
@logger.info "Schedule set for " + data.hour + ":" + data.minute + ", on days: " + data.days
@alarm = Schedule.scheduleJob(rule,() =>
d = new Date()
todayIsHoliday = @dh.isHoliday(d)
unless @config.alarmclock.disableOnHolidays and todayIsHoliday
@playAlarm()
if @config.alarmclock.disableOnHolidays and todayIsHoliday
@logger.info "Today is a holiday"
tomorrow = Moment(d).add(1, 'days')
tomorrowIsHoliday = @dh.isHoliday(tomorrow) and @config.alarmclock.disableOnHolidays
@logger.debug "tomorrowIsHoliday: " + tomorrowIsHoliday
tomorrowString = dateformat(tomorrow,"yyyy-mm-dd")
nextAlarmString = dateformat(@alarm.nextInvocation(), "yyyy-mm-dd")
if Moment(tomorrowString).isSame(nextAlarmString,'day') and not tomorrowIsHoliday
@setDots(2,true)
@logger.info "alarm set for tomorrow"
@mqttClient.publish("schanswal/alarmclock/nextalarm", dateformat(@alarm.nextInvocation(), "dddd H:MM"), (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
else
@setDots(2,false)
@mqttClient.publish("schanswal/alarmclock/nextalarm", "geen alarm", (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
)
return @alarm
readConfig: () =>
return new Promise ((resolve, reject) =>
if !fs.existsSync(@configFullFilename)
@logger.error "Config doesn't exists!"
reject("Config doesn't exists")
else
fs.readFile(@configFullFilename, 'utf8', (err, data) =>
if !(err)
try
@config = JSON.parse(data)
#@logger.error "Config read: " + JSON.stringify(@config)
resolve()
catch err
@logger.error "Config JSON not valid: " + err
reject("Config JSON not valid")
else
@logger.error "Config doesn't exists: " + err
reject("Config doesn't exists")
)
)
updateConfig: () =>
try
fs.writeFileSync @configFullFilename, JSON.stringify(@config,null,2)
catch err
if not err
@logger.info "Config updated"
else
@logger.error "Config not updated"
stopAlarm: () =>
@alarmActive = false
if @fadeTimer? then clearTimeout(@fadeTimer)
if @maxPlayTimer? then clearTimeout(@maxPlayTimer)
@wtStop()
@setDisplayState(1)
@setDisplayTime()
playAlarm: () =>
@alarmActive = true
@_volume = -40
@wtVolume(@_volume)
_track = Math.floor((Math.random() * 4) + 2)
@wtSolo(_track)
fade = () =>
@_volume += 1
@wtVolume(@_volume)
@fadeTimer = setTimeout(fade,1000) if @_volume < @wtDefaultVolume
fade()
@setDisplayState(2)
@setDisplayTime()
maxPlayTime = () =>
@button.emit 'clicked', @buttonPin
@maxPlayTimer = setTimeout(maxPlayTime, 60000)
startDisplay: (_addr) =>
@HT16K33_ADDR = _addr
@i2c1 = i2c.open(1, (err) =>
if err? then throw err
turnOnBuffer = Buffer.alloc(1)
turnOnBuffer[0] = @TURN_OSCILLATOR_ON
@i2c1.i2cWrite(@HT16K33_ADDR,turnOnBuffer.length, turnOnBuffer, (err, bytesWritten, buffer) =>
if err? then throw err
@setDisplayState(2)
d = new Date()
times = SunCalc.getTimes(d, @config.latitude, @config.longitude)
if Moment(d).isAfter(times.sunrise) and Moment(d).isBefore(times.sunsetStart)
@setBrightness(@config.alarmclock.brightnessDay)
else
@setBrightness(@config.alarmclock.brightnessNight)
@setDisplayTime(0,0)
)
)
setDisplayState: (_state) =>
switch _state
when 0
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_OFF;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
when 2
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_BLINK;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
else
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_ON;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
setBrightness: (_brightness) =>
brightnessbuffer = Buffer.alloc(1);
if _brightness < 0 or _brightness>15 then _brightness = 0
brightnessbuffer[0] = @HT16K33_CMD_BRIGHTNESS | _brightness;
@i2c1.i2cWrite(@HT16K33_ADDR, brightnessbuffer.length, brightnessbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
setDisplayTime: (_h,_m) =>
try
_time = new Date()
_hours = if _h? then _h else _time.getHours()
_minutes = if _m? then _m else _time.getMinutes()
if _hours < 0 or _hours > 23 then _hours = 23
if _minutes < 0 or _minutes > 59 then minutes = 59
if _hours < 10
_digit1 = 0
_digit2 = Number (String _hours)[0]
else
_digit1 = Number (String _hours)[0]
_digit2 = Number (String _hours)[1]
if _minutes < 10
_digit3 = 0
_digit4 = Number (String _minutes)[0]
else
_digit3 = Number (String _minutes)[0]
_digit4 = Number (String _minutes)[1]
displaybuffer = Buffer.alloc(11,0x00)
displaybuffer[1] = @numbertable[_digit1]
displaybuffer[3] = @numbertable[_digit2]
displaybuffer[5] = @dots
displaybuffer[7] = @numbertable[_digit3]
displaybuffer[9] = @numbertable[_digit4]
@i2c1.i2cWrite(@HT16K33_ADDR, displaybuffer.length, displaybuffer, (err, bytesWritten, buffer) =>
#@logger.info('Display written ' + bytesWritten)
)
catch err
@logger.info "eeror in setDisplay: " + err
blinkDot: (_enabled) =>
@blinkOn = false
@dotstate = false
if @blinkDotTimer? then clearTimeout(@blinkDotTimer)
if _enabled
@blinkOn = true
dotBlinking = () =>
@dotState = !@dotState
@setDots(2,@dotState)
@setDisplayTime()
@blinkDotTimer = setTimeout(dotBlinking,1000) unless @blinkOn is false
dotBlinking()
else
@setDots(2,false)
@setDisplayTime()
@blinkOn = false
setDots: (_nr, _state) =>
switch _nr
when 1
@dot1 = _state
when 2
@dot2 = _state
when 3
@dot3 = _state
when 4
@timedots = _state
@dots = 0x00 | (if @dot1 then 0x08) | (if @dot2 then 0x04) | (if @dot3 then 0x10) | (if @timedots then 0x03)
clearDisplay: () =>
displaybuffer = Buffer.alloc(11,0x00)
@i2c1.i2cWrite(@HT16K33_ADDR, displaybuffer.length, displaybuffer, (err, bytesWritten, buffer) =>
#@logger.info('Display written ' + bytesWritten)
)
wtStart: () =>
_WT_GET_VERSION = [0xF0,0xAA,0x05,0x01,0x55]
@port.open((err) =>
if err
@logger.info('Error opening port: ', err.message)
@wtPower(true)
# play startup tune
@wtSolo(99)
)
wtPower: (_state) =>
_WT_AMP_POWER = [0xF0,0xAA,0x06,0x09,0x00,0x55]
if _state
_WT_AMP_POWER[4] = 0x01
@port.write(Buffer.from(_WT_AMP_POWER))
else
@port.write(Buffer.from(_WT_AMP_POWER))
wtVolume: (_volume) =>
_WT_VOLUME = [0xF0,0xAA,0x07,0x05,0x00,0x00,0x55]
if _volume < -70 then _volume = -70
if _volume > 4 then _volume = 4
_WT_VOLUME[4] = _volume & 0xFF
_WT_VOLUME[5] = (_volume & 0xFF00) >> 8
@port.write(Buffer.from(_WT_VOLUME))
wtSolo: (_track) =>
_WT_TRACK_SOLO = [0xF0,0xAA,0x08,0x03,0x00,0x00,0x00,0x55]
_WT_TRACK_SOLO[5] = _track & 0xFF
_WT_TRACK_SOLO[6] = (_track & 0xFF00) >> 8
@port.write(Buffer.from(_WT_TRACK_SOLO))
wtFade: (_track) =>
_WT_FADE = [0xF0,0xAA,0x0C,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55]
_volume = 0
_time = 10000
_WT_FADE[4] = _track & 0xFF
_WT_FADE[5] = (_track & 0xFF00) >> 8
_WT_FADE[6] = _volume & 0xFF
_WT_FADE[7] = (_volume & 0xFF00) >> 8
_WT_FADE[8] = _time & 0xFF
_WT_FADE[9] = (_time & 0xFF00) >> 8
#_WT_FADE[10] = 0x00
@port.write(Buffer.from(_WT_FADE))
wtStop: () =>
_WT_STOP_ALL = [0xF0,0xAA,0x05,0x04,0x55]
#_WT_TRACK_STOP = [0xF0,0xAA,0x08,0x03,0x04,0x00,0x00,0x55]
#_WT_TRACK_STOP[5] = _track & 0xFF
#_WT_TRACK_STOP[6] = (_track & 0xFF00) >> 8
@port.write(Buffer.from(_WT_STOP_ALL))
destroy:() =>
return new Promise( (resolve, reject) =>
@port.close()
if @alarm? then @alarm.cancel()
@minuteTick.stop()
@nextAlarmTick.stop()
@brightnessTick.stop()
@button.removeAllListeners()
@mqttClient.removeAllListeners()
if @snozer? then clearTimeout(@snozer)
if @maxPlayTimer? then clearTimeout(@maxPlayTimer)
if @afterBootTimer? then clearTimeout(@afterBootTimer)
if @blinkDotTimer? then clearTimeout(@blinkDotTimer)
if @fadeTimer? then clearTimeout(@fadeTimer)
if @timerSunrise? then clearTimeout(@timerSunrise)
if @timerSunset? then clearTimeout(@timerSunset)
resolve()
)
return new AlarmClock
| true | module.exports = () ->
Promise = require('bluebird')
i2c = require('i2c-bus')
SerialPort = require('serialport')
Schedule = require('node-schedule')
CronJob = require('cron').CronJob
mqtt = require('mqtt')
path = require('path')
winston = require('winston')
fs = require('fs')
Moment = require('moment-timezone')
colors = require "colors"
dateformat = require('dateformat')
SunCalc = require('suncalc')
rpi_gpio_buttons = require('rpi-gpio-buttons')
dateholidays = require 'date-holidays'
class AlarmClock
constructor: () ->
#
# set logging
#
logfile = path.join(__dirname, 'alarm-clock.log')
@logger = winston.createLogger({
level: 'debug'
format: winston.format.combine(
winston.format.timestamp(),
winston.format.colorize(),
winston.format.printf((info) =>
ts2 = Moment(info.timestamp).format("HH:mm:ss.SSS")
ts2 = ts2.grey
return "#{ts2} [#{info.level}] #{info.message}"
)
)
transports: [
new winston.transports.File({
filename: logfile,
format: winston.format.uncolorize({level:false})
})
]
})
if (process.env.NODE_ENV isnt 'production')
@logger.add(new winston.transports.Console({
format: winston.format.combine(winston.format.colorize({level:true}))
}))
@logger.info("Logger started")
#
# read configuration
#
@config = {}
@configFullFilename = path.join __dirname, 'alarm-clock.json'
@numbertable = [
0x3F, # 0
0x06, # 1
0x5B, # 2
0x4F, # 3
0x66, # 4
0x6D, # 5
0x7D, # 6
0x07, # 7
0x7F, # 8
0x6F # 9
]
dateformat.i18n =
dayNames: [
'PI:NAME:<NAME>END_PIon', 'PI:NAME:<NAME>END_PIaa', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PIat',
'PI:NAME:<NAME>END_PIondag', 'PI:NAME:<NAME>END_PIandag', 'PI:NAME:<NAME>END_PIdag', 'PI:NAME:<NAME>END_PIdag', 'PI:NAME:<NAME>END_PIderdag', 'PI:NAME:<NAME>END_PIrijdag', 'Zaterdag'
],
monthNames: [
'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec',
'Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'
],
timeNames: [
'a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM'
]
@HT16K33_BLINK_CMD = 0x80
@HT16K33_DISPLAY_ON = 0x01
@HT16K33_DISPLAY_OFF = 0x00
@HT16K33_DISPLAY_BLINK = 0x05
@TURN_OSCILLATOR_ON = 0x21
@HT16K33_CMD_BRIGHTNESS = 0xE0
@dot1 = false
@dot2 = false
@dot3 = false
@timedots = false
@dots = 0x00
@setDots(4,true)
@startDisplay(0x70)
#
# init alarm
#
@alarmActive = false
@alarmSnooze = 0
afterBootDisplay = () =>
@setDisplayState(1)
@setAlarmclock()
@setDisplayTime()
@minuteTick = new CronJob
cronTime: '0 */1 * * * *'
onTick: =>
@setDisplayTime()
@minuteTick.start()
@brightnessTick = new CronJob
cronTime: '0 0 3 * * *'
runOnInit: true
onTick: =>
@logger.info "Midnight sunrise and sunset update"
d = new Date()
times = SunCalc.getTimes(d, @config.alarmclock.latitude, @config.alarmclock.longitude)
if @timerSunrise? then clearTimeout(@timerSunrise)
if @timerSunset? then clearTimeout(@timerSunset)
onSunrise = () =>
@setBrightness(@config.alarmclock.brightnessDay)
@logger.info "Sunrise, brightness to #{@config.alarmclock.brightnessDay}"
onSunset = () =>
@setBrightness(@config.alarmclock.brightnessNight)
@logger.info "Sunset, brightness to #{@config.alarmclock.brightnessNight}"
_timeToSunrise = times.sunrise - Date.now()
_timeToSunset = times.sunset - Date.now()
@logger.info "Brightness sunrise set at " + times.sunrise.toString() + ", _timeToSunrise: " + _timeToSunrise
if _timeToSunrise > 0
@timerSunrise = setTimeout(onSunrise, _timeToSunrise)
@logger.info "Brightness sunrise set at " + times.sunrise.toString()
@logger.info "Brightness sunset set at " + times.sunset.toString() + ", _timeToSunset: " + _timeToSunset
if _timeToSunset > 0
@timerSunset = setTimeout(onSunset, _timeToSunset)
@logger.info "Brigtness sunset set at " + times.sunset.toString()
@brightnessTick.start()
@nextAlarmTick = new CronJob
cronTime: '0 0 12 * * *'
runOnInit: true
onTick: =>
@setAlarmclock()
@setDisplayTime()
@logger.info "Noon new day setAlarmClock"
@nextAlarmTick.start()
@afterBootTimer = setTimeout(afterBootDisplay,5000)
#
# init WavTrigger
#
@port = new SerialPort('/dev/ttyS0', { autoOpen: false, baudRate: 57600 })
@wtStart()
@wtDefaultVolume = -10
@wtVolume(@wtDefaultVolume)
@readConfig()
.then () =>
@dh = new dateholidays(@config.alarmclock.country, @config.alarmclock.state)
#
# init mqtt
#
options =
host: @config.mqtt.host
port: @config.mqtt.port
username: @config.mqtt.username
password: @config.mqtt.password
clientId: "alarmclock"
protocolVersion: 4
@mqttClient = mqtt.connect(options)
@mqttClient.on 'connect', =>
@logger.info "Connected to mqtt"
@mqttClient.subscribe('schanswal/alarmclock/#', (err,granted)=>
if err?
@logger.error("Subscribe error: " + err)
else
@logger.info("subscribed to " + JSON.stringify(granted))
@mqttClient.publish("schanswal/alarmclock/alarmclock/status", (if @config.alarmclock.state then "on" else "off"), (err) =>
if err?
@logger.info "error publishing state: " + err
)
)
@mqttClient.on 'error', (err) =>
@logger.info ("Mqtt connect error: " + err)
@mqttClient.on 'message', (topic, message, packet) =>
@logger.info(JSON.stringify("topic: " + topic + ", message: " + message))
items = topic.split('/')
if String items[0] is "schanswal" and String items[1] is "alarmclock"
@logger.info("mqtt: " + items[2] + ", message: " + message)
switch String items[2]
when "alarm"
if (String message) == "on"
@playAlarm()
else if (String message) == "off"
@stopAlarm()
when "brightness"
@setBrightness(Number message)
@logger.info "Brightness set to #{message}"
when "alarmclock"
if (String message) == "on"
@setAlarmclock(true)
@logger.info "Alarmclock switched on"
else if (String message) == "off"
@setAlarmclock(false)
@logger.info "Alarmclock switched off"
@setDisplayTime()
@updateConfig()
when "alarmtime"
try
data = JSON.parse(message)
@config["schedule"] = data
@setAlarmclock()
@setDisplayTime()
@updateConfig()
catch err
@logger.error("ERROR schedule not set, error in JSON.parse mqtt message, " + err)
else
@logger.info "other message received: " + message
#
# button definitions
#
@buttonPin = @config.alarmclock.buttonPin
@button = rpi_gpio_buttons([@buttonPin],{ mode: rpi_gpio_buttons.MODE_BCM })
@button.setTiming({debounce: 100, clicked: 300, pressed: 600 })
@button.on 'clicked', (p) =>
@logger.info("button clicked")
if @alarmActive
@stopAlarm()
@blinkDot(true)
snooze = () =>
@alarmActive = true
@playAlarm()
@alarmSnooze +=1
if @alarmSnooze is 8
@button.emit 'pressed', p
@logger.info("Snoozing stopped")
@alarmSnooze = 0
clearTimeout(@snozer)
else
@snozer = setTimeout(snooze,300000)
@logger.info("Snoozing...")
else if @alarmSnooze is 0
@mqttClient.publish("schanswal/alarmclock/button", "1", (err) =>
if err?
@logger.info "error publishing state: " + err
)
@button.on 'pressed', (p)=>
# stop alarm and sleep
if @alarmActive
@stopAlarm()
@logger.info("Snoozing stopped")
if @snozer?
@alarmSnooze = 0
clearTimeout(@snozer)
@logger.info("Snoozing stopped")
@blinkDot(false)
@setAlarmclock()
@logger.info("button pressed")
#stop alarm and don't sleep
@button.on 'clicked_pressed', (p)=>
@logger.info("button clicked_pressed")
#stop alarm and don't sleep
@button.on 'double_clicked', (p) =>
@logger.info("button double clicked")
#action
.catch (err) =>
@logger.error "error: " + err
return
setAlarmclock: (_s) =>
if _s?
_state = _s
@config.alarmclock.state = _s
else
_state = @config.alarmclock.state
if _state is false
@setDots(1,false)
@setDots(2,false)
if @alarm?
@alarm.cancel()
@logger.info "Alarm cancelled"
else
@setDots(1,true)
_alarm = @setSchedule(@config.schedule)
d = new Date()
tomorrow = Moment(d).add(1, 'days')
tomorrowIsHoliday = @dh.isHoliday(tomorrow) and @config.alarmclock.disableOnHolidays
tomorrowString = dateformat(tomorrow,"yyyy-mm-dd")
nextAlarmString = dateformat(@alarm.nextInvocation(), "yyyy-mm-dd")
if Moment(tomorrowString).isSame(nextAlarmString,'day') and not tomorrowIsHoliday
@setDots(2,true)
@logger.info "alarm set for tomorrow"
@mqttClient.publish("schanswal/alarmclock/nextalarm", dateformat(_alarm.nextInvocation(), "dddd H:MM"), (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
else
@setDots(2,false)
@mqttClient.publish("schanswal/alarmclock/nextalarm", "geen alarm", (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
setSchedule: (data) =>
@logger.info "data: " + JSON.stringify(data)
if (Number data.hour) >= 0 and (Number data.hour) <= 23 and (Number data.minute) >= 0 and (Number data.minute) <= 59
if @alarm? then @alarm.cancel()
rule = new Schedule.RecurrenceRule()
rule.dayOfWeek = [data.days]
rule.hour = Number data.hour
rule.minute = Number data.minute
if @alarm? then @alarm.cancel()
@logger.info "Schedule set for " + data.hour + ":" + data.minute + ", on days: " + data.days
@alarm = Schedule.scheduleJob(rule,() =>
d = new Date()
todayIsHoliday = @dh.isHoliday(d)
unless @config.alarmclock.disableOnHolidays and todayIsHoliday
@playAlarm()
if @config.alarmclock.disableOnHolidays and todayIsHoliday
@logger.info "Today is a holiday"
tomorrow = Moment(d).add(1, 'days')
tomorrowIsHoliday = @dh.isHoliday(tomorrow) and @config.alarmclock.disableOnHolidays
@logger.debug "tomorrowIsHoliday: " + tomorrowIsHoliday
tomorrowString = dateformat(tomorrow,"yyyy-mm-dd")
nextAlarmString = dateformat(@alarm.nextInvocation(), "yyyy-mm-dd")
if Moment(tomorrowString).isSame(nextAlarmString,'day') and not tomorrowIsHoliday
@setDots(2,true)
@logger.info "alarm set for tomorrow"
@mqttClient.publish("schanswal/alarmclock/nextalarm", dateformat(@alarm.nextInvocation(), "dddd H:MM"), (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
else
@setDots(2,false)
@mqttClient.publish("schanswal/alarmclock/nextalarm", "geen alarm", (err) =>
if err?
@logger.info "error publishing next alarmtime: " + err
)
)
return @alarm
readConfig: () =>
return new Promise ((resolve, reject) =>
if !fs.existsSync(@configFullFilename)
@logger.error "Config doesn't exists!"
reject("Config doesn't exists")
else
fs.readFile(@configFullFilename, 'utf8', (err, data) =>
if !(err)
try
@config = JSON.parse(data)
#@logger.error "Config read: " + JSON.stringify(@config)
resolve()
catch err
@logger.error "Config JSON not valid: " + err
reject("Config JSON not valid")
else
@logger.error "Config doesn't exists: " + err
reject("Config doesn't exists")
)
)
updateConfig: () =>
try
fs.writeFileSync @configFullFilename, JSON.stringify(@config,null,2)
catch err
if not err
@logger.info "Config updated"
else
@logger.error "Config not updated"
stopAlarm: () =>
@alarmActive = false
if @fadeTimer? then clearTimeout(@fadeTimer)
if @maxPlayTimer? then clearTimeout(@maxPlayTimer)
@wtStop()
@setDisplayState(1)
@setDisplayTime()
playAlarm: () =>
@alarmActive = true
@_volume = -40
@wtVolume(@_volume)
_track = Math.floor((Math.random() * 4) + 2)
@wtSolo(_track)
fade = () =>
@_volume += 1
@wtVolume(@_volume)
@fadeTimer = setTimeout(fade,1000) if @_volume < @wtDefaultVolume
fade()
@setDisplayState(2)
@setDisplayTime()
maxPlayTime = () =>
@button.emit 'clicked', @buttonPin
@maxPlayTimer = setTimeout(maxPlayTime, 60000)
startDisplay: (_addr) =>
@HT16K33_ADDR = _addr
@i2c1 = i2c.open(1, (err) =>
if err? then throw err
turnOnBuffer = Buffer.alloc(1)
turnOnBuffer[0] = @TURN_OSCILLATOR_ON
@i2c1.i2cWrite(@HT16K33_ADDR,turnOnBuffer.length, turnOnBuffer, (err, bytesWritten, buffer) =>
if err? then throw err
@setDisplayState(2)
d = new Date()
times = SunCalc.getTimes(d, @config.latitude, @config.longitude)
if Moment(d).isAfter(times.sunrise) and Moment(d).isBefore(times.sunsetStart)
@setBrightness(@config.alarmclock.brightnessDay)
else
@setBrightness(@config.alarmclock.brightnessNight)
@setDisplayTime(0,0)
)
)
setDisplayState: (_state) =>
switch _state
when 0
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_OFF;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
when 2
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_BLINK;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
else
blinkbuffer = Buffer.alloc(1);
blinkbuffer[0] = @HT16K33_BLINK_CMD | @HT16K33_DISPLAY_ON;
@i2c1.i2cWrite(@HT16K33_ADDR, blinkbuffer.length, blinkbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
setBrightness: (_brightness) =>
brightnessbuffer = Buffer.alloc(1);
if _brightness < 0 or _brightness>15 then _brightness = 0
brightnessbuffer[0] = @HT16K33_CMD_BRIGHTNESS | _brightness;
@i2c1.i2cWrite(@HT16K33_ADDR, brightnessbuffer.length, brightnessbuffer, (err, bytesWritten, buffer) =>
if err?
@logger.error(err)
)
setDisplayTime: (_h,_m) =>
try
_time = new Date()
_hours = if _h? then _h else _time.getHours()
_minutes = if _m? then _m else _time.getMinutes()
if _hours < 0 or _hours > 23 then _hours = 23
if _minutes < 0 or _minutes > 59 then minutes = 59
if _hours < 10
_digit1 = 0
_digit2 = Number (String _hours)[0]
else
_digit1 = Number (String _hours)[0]
_digit2 = Number (String _hours)[1]
if _minutes < 10
_digit3 = 0
_digit4 = Number (String _minutes)[0]
else
_digit3 = Number (String _minutes)[0]
_digit4 = Number (String _minutes)[1]
displaybuffer = Buffer.alloc(11,0x00)
displaybuffer[1] = @numbertable[_digit1]
displaybuffer[3] = @numbertable[_digit2]
displaybuffer[5] = @dots
displaybuffer[7] = @numbertable[_digit3]
displaybuffer[9] = @numbertable[_digit4]
@i2c1.i2cWrite(@HT16K33_ADDR, displaybuffer.length, displaybuffer, (err, bytesWritten, buffer) =>
#@logger.info('Display written ' + bytesWritten)
)
catch err
@logger.info "eeror in setDisplay: " + err
blinkDot: (_enabled) =>
@blinkOn = false
@dotstate = false
if @blinkDotTimer? then clearTimeout(@blinkDotTimer)
if _enabled
@blinkOn = true
dotBlinking = () =>
@dotState = !@dotState
@setDots(2,@dotState)
@setDisplayTime()
@blinkDotTimer = setTimeout(dotBlinking,1000) unless @blinkOn is false
dotBlinking()
else
@setDots(2,false)
@setDisplayTime()
@blinkOn = false
setDots: (_nr, _state) =>
switch _nr
when 1
@dot1 = _state
when 2
@dot2 = _state
when 3
@dot3 = _state
when 4
@timedots = _state
@dots = 0x00 | (if @dot1 then 0x08) | (if @dot2 then 0x04) | (if @dot3 then 0x10) | (if @timedots then 0x03)
clearDisplay: () =>
displaybuffer = Buffer.alloc(11,0x00)
@i2c1.i2cWrite(@HT16K33_ADDR, displaybuffer.length, displaybuffer, (err, bytesWritten, buffer) =>
#@logger.info('Display written ' + bytesWritten)
)
wtStart: () =>
_WT_GET_VERSION = [0xF0,0xAA,0x05,0x01,0x55]
@port.open((err) =>
if err
@logger.info('Error opening port: ', err.message)
@wtPower(true)
# play startup tune
@wtSolo(99)
)
wtPower: (_state) =>
_WT_AMP_POWER = [0xF0,0xAA,0x06,0x09,0x00,0x55]
if _state
_WT_AMP_POWER[4] = 0x01
@port.write(Buffer.from(_WT_AMP_POWER))
else
@port.write(Buffer.from(_WT_AMP_POWER))
wtVolume: (_volume) =>
_WT_VOLUME = [0xF0,0xAA,0x07,0x05,0x00,0x00,0x55]
if _volume < -70 then _volume = -70
if _volume > 4 then _volume = 4
_WT_VOLUME[4] = _volume & 0xFF
_WT_VOLUME[5] = (_volume & 0xFF00) >> 8
@port.write(Buffer.from(_WT_VOLUME))
wtSolo: (_track) =>
_WT_TRACK_SOLO = [0xF0,0xAA,0x08,0x03,0x00,0x00,0x00,0x55]
_WT_TRACK_SOLO[5] = _track & 0xFF
_WT_TRACK_SOLO[6] = (_track & 0xFF00) >> 8
@port.write(Buffer.from(_WT_TRACK_SOLO))
wtFade: (_track) =>
_WT_FADE = [0xF0,0xAA,0x0C,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55]
_volume = 0
_time = 10000
_WT_FADE[4] = _track & 0xFF
_WT_FADE[5] = (_track & 0xFF00) >> 8
_WT_FADE[6] = _volume & 0xFF
_WT_FADE[7] = (_volume & 0xFF00) >> 8
_WT_FADE[8] = _time & 0xFF
_WT_FADE[9] = (_time & 0xFF00) >> 8
#_WT_FADE[10] = 0x00
@port.write(Buffer.from(_WT_FADE))
wtStop: () =>
_WT_STOP_ALL = [0xF0,0xAA,0x05,0x04,0x55]
#_WT_TRACK_STOP = [0xF0,0xAA,0x08,0x03,0x04,0x00,0x00,0x55]
#_WT_TRACK_STOP[5] = _track & 0xFF
#_WT_TRACK_STOP[6] = (_track & 0xFF00) >> 8
@port.write(Buffer.from(_WT_STOP_ALL))
destroy:() =>
return new Promise( (resolve, reject) =>
@port.close()
if @alarm? then @alarm.cancel()
@minuteTick.stop()
@nextAlarmTick.stop()
@brightnessTick.stop()
@button.removeAllListeners()
@mqttClient.removeAllListeners()
if @snozer? then clearTimeout(@snozer)
if @maxPlayTimer? then clearTimeout(@maxPlayTimer)
if @afterBootTimer? then clearTimeout(@afterBootTimer)
if @blinkDotTimer? then clearTimeout(@blinkDotTimer)
if @fadeTimer? then clearTimeout(@fadeTimer)
if @timerSunrise? then clearTimeout(@timerSunrise)
if @timerSunset? then clearTimeout(@timerSunset)
resolve()
)
return new AlarmClock
|
[
{
"context": "y {sentiment}.'\n templateValues =\n name: 'Alexa'\n age: 4\n sentiment: 'pleased'\n\n ren",
"end": 638,
"score": 0.9992759227752686,
"start": 633,
"tag": "NAME",
"value": "Alexa"
},
{
"context": "mplateValues)\n expectedResult = 'Hi, my name is ... | packages/litexa/test/specs/command-line/generators/searchReplace.spec.coffee | fboerncke/litexa | 34 | ###
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
###
{expect} = require 'chai'
render = require '@src/command-line/generators/searchReplace'
describe '#searchReplace', ->
it 'replaces the placeholders in the string data with the provided values', ->
stringTemplate = 'Hi, my name is {name}, I am {age} years old. I am {sentiment} to meet you, very {sentiment}.'
templateValues =
name: 'Alexa'
age: 4
sentiment: 'pleased'
renderedString = render(stringTemplate, templateValues)
expectedResult = 'Hi, my name is Alexa, I am 4 years old. I am pleased to meet you, very pleased.'
expect(renderedString).to.equal(expectedResult)
| 178394 | ###
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
###
{expect} = require 'chai'
render = require '@src/command-line/generators/searchReplace'
describe '#searchReplace', ->
it 'replaces the placeholders in the string data with the provided values', ->
stringTemplate = 'Hi, my name is {name}, I am {age} years old. I am {sentiment} to meet you, very {sentiment}.'
templateValues =
name: '<NAME>'
age: 4
sentiment: 'pleased'
renderedString = render(stringTemplate, templateValues)
expectedResult = 'Hi, my name is <NAME>, I am 4 years old. I am pleased to meet you, very pleased.'
expect(renderedString).to.equal(expectedResult)
| true | ###
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
###
{expect} = require 'chai'
render = require '@src/command-line/generators/searchReplace'
describe '#searchReplace', ->
it 'replaces the placeholders in the string data with the provided values', ->
stringTemplate = 'Hi, my name is {name}, I am {age} years old. I am {sentiment} to meet you, very {sentiment}.'
templateValues =
name: 'PI:NAME:<NAME>END_PI'
age: 4
sentiment: 'pleased'
renderedString = render(stringTemplate, templateValues)
expectedResult = 'Hi, my name is PI:NAME:<NAME>END_PI, I am 4 years old. I am pleased to meet you, very pleased.'
expect(renderedString).to.equal(expectedResult)
|
[
{
"context": "# name: gulpfile.js\n#\n# author: 沈维忠 ( Shen Weizhong / Tony Stark )\n#\n# Last Update: 沈",
"end": 35,
"score": 0.9998847842216492,
"start": 32,
"tag": "NAME",
"value": "沈维忠"
},
{
"context": "# name: gulpfile.js\n#\n# author: 沈维忠 ( Shen Weizhong / Tony Stark )\n#\n# Las... | dev/gulpfile.coffee | gitter-badger/is-object-brace | 0 | # name: gulpfile.js
#
# author: 沈维忠 ( Shen Weizhong / Tony Stark )
#
# Last Update: 沈维忠 ( Shen Weizhong / Tony Stark )
'use strict'
require('require-dir')('gulp')
| 105051 | # name: gulpfile.js
#
# author: <NAME> ( <NAME> / <NAME> )
#
# Last Update: <NAME> ( <NAME> / <NAME> )
'use strict'
require('require-dir')('gulp')
| true | # name: gulpfile.js
#
# author: PI:NAME:<NAME>END_PI ( PI:NAME:<NAME>END_PI / PI:NAME:<NAME>END_PI )
#
# Last Update: PI:NAME:<NAME>END_PI ( PI:NAME:<NAME>END_PI / PI:NAME:<NAME>END_PI )
'use strict'
require('require-dir')('gulp')
|
[
{
"context": "'#show_password').change ->\n $password = $('#user_password')\n\n if $('#show_password').is(':checked')\n ",
"end": 181,
"score": 0.7170517444610596,
"start": 168,
"tag": "PASSWORD",
"value": "user_password"
}
] | app/assets/javascripts/neighborly/devise/registrations/new.js.coffee | code4sac/project-genesis | 6 | Neighborly.Devise ?= {}
Neighborly.Devise.Registrations ?= {}
Neighborly.Devise.Registrations.New =
init: ->
$('#show_password').change ->
$password = $('#user_password')
if $('#show_password').is(':checked')
$password.prop 'type', 'text'
else
$password.prop 'type', 'password'
| 151924 | Neighborly.Devise ?= {}
Neighborly.Devise.Registrations ?= {}
Neighborly.Devise.Registrations.New =
init: ->
$('#show_password').change ->
$password = $('#<PASSWORD>')
if $('#show_password').is(':checked')
$password.prop 'type', 'text'
else
$password.prop 'type', 'password'
| true | Neighborly.Devise ?= {}
Neighborly.Devise.Registrations ?= {}
Neighborly.Devise.Registrations.New =
init: ->
$('#show_password').change ->
$password = $('#PI:PASSWORD:<PASSWORD>END_PI')
if $('#show_password').is(':checked')
$password.prop 'type', 'text'
else
$password.prop 'type', 'password'
|
[
{
"context": "es all in lower case', ->\n contactEmails = ['Firstname.Lastname@example.com', 'firstname.middle.lastname@example.com']\n ",
"end": 1454,
"score": 0.999684751033783,
"start": 1424,
"tag": "EMAIL",
"value": "Firstname.Lastname@example.com"
},
{
"context": "ntac... | spec/scripts/sales/followupCloseIoLeads.spec.coffee | l34kr/codecombat | 0 | # TODO: use nock for making sure network requests are sent, blackbox whole script
# TODO: improve coverage of various cases; current coverage is poor and incomplete
request = require 'request'
moment = require 'moment'
followupCloseIoLeads = require '../../../scripts/sales/followupCloseIoLeads'
factories = require './closeFactories'
describe '/scripts/sales/followupCloseIoLeads', ->
beforeEach ->
spyOn(request, 'getAsync')
spyOn(request, 'putAsync')
spyOn(request, 'postAsync')
spyOn(followupCloseIoLeads, 'log')
describe 'contactHasEmailAddress', ->
it 'returns true if the contact has any email addresses', ->
expect(followupCloseIoLeads.contactHasEmailAddress(factories.makeContact({withEmails: true}))).toBe(true)
it 'returns false if the contact has no email addresses', ->
expect(followupCloseIoLeads.contactHasEmailAddress(factories.makeContact())).toBe(false)
describe 'contactHasPhoneNumbers', ->
it 'returns true if the contact has any phone numbers', ->
expect(followupCloseIoLeads.contactHasPhoneNumbers(factories.makeContact({withPhones: true}))).toBe(true)
it 'returns false if the contact has no phone numbers', ->
expect(followupCloseIoLeads.contactHasPhoneNumbers(factories.makeContact())).toBe(false)
describe 'lowercaseEmailsForContact', ->
it 'returns a list of email addresses all in lower case', ->
contactEmails = ['Firstname.Lastname@example.com', 'firstname.middle.lastname@example.com']
lowercaseContactEmails = ['firstname.lastname@example.com', 'firstname.middle.lastname@example.com']
expect(followupCloseIoLeads.lowercaseEmailsForContact(factories.makeContact({withEmails: contactEmails}))).toEqual(lowercaseContactEmails)
describe 'general network requests', ->
describe 'getJsonUrl', ->
it 'calls request.getAsync with url and json: true', ->
url = 'http://example.com/model/id'
followupCloseIoLeads.getJsonUrl(url)
expect(request.getAsync.calls.argsFor(0)).toEqual([{
url: url,
json: true
}])
describe 'postJsonUrl', ->
describe 'putJsonUrl', ->
describe 'Close.io API requests', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getJsonUrl').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'postJsonUrl').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'putJsonUrl').and.returnValue(Promise.resolve())
describe 'getSomeLeads', ->
describe 'getEmailActivityForLead', ->
describe 'getActivityForLead', ->
describe 'postEmailActivity', ->
describe 'postTask', ->
describe 'sendMail', ->
describe 'updateLeadStatus', ->
describe 'theyHaveNotResponded', ->
beforeEach ->
@lead = {id: 'lead_1'}
@contact = factories.makeContact({ withEmails: 2 })
describe "we haven't even sent them a first email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult()))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(false)
done()
describe "they haven't sent us any email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: {to: [@contact.emails[0].email]}, they_replied: false })))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(true)
done()
describe "they have sent us an email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: {to: [@contact.emails[0].email]}, they_replied: {to: ['sales_1@codecombat.com'], sender: "Some User <#{@contact.emails[0].email}>"} })))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(false)
done()
describe 'createSendFollowupMailFn', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'sendMail').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'getTasksForLead').and.returnValue(factories.makeTasksResult(0))
spyOn(followupCloseIoLeads, 'updateLeadStatus').and.returnValue(Promise.resolve())
describe 'when we have sent an auto1 email', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'isTemplateAuto1').and.returnValue(true)
describe 'more than 3 days ago', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: true })))
spyOn(followupCloseIoLeads, 'getRandomEmailTemplateAuto2').and.returnValue('template_auto2')
describe "and they haven't responded to the first auto-email", ->
it "sends a followup auto-email", (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key_1'}
lead = factories.makeLead({ auto1: true })
contactEmails = ['teacher1@example.com', 'teacher1.fullname@example.com']
followupCloseIoLeads.createSendFollowupMailFn(userApiKeyMap, moment().subtract(3, 'days').toDate(), lead, contactEmails)( =>
expect(followupCloseIoLeads.sendMail).toHaveBeenCalled()
expect(followupCloseIoLeads.updateLeadStatus).toHaveBeenCalled()
done()
)
describe 'in the last 3 days', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: { date_created: new Date() } })))
spyOn(followupCloseIoLeads, 'getRandomEmailTemplateAuto2')
it "doesn't send a followup email or update the lead's status", (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key'}
lead = factories.makeLead({ auto1: true })
contactEmails = ['teacher1@example.com', 'teacher1.fullname@example.com']
followupCloseIoLeads.createSendFollowupMailFn(userApiKeyMap, moment().subtract(3, 'days'), lead, contactEmails)( =>
expect(followupCloseIoLeads.sendMail).not.toHaveBeenCalled()
expect(followupCloseIoLeads.updateLeadStatus).not.toHaveBeenCalled()
done()
)
describe 'sendSecondFollowupMails', ->
beforeEach ->
apiKeyMap = {
'close_io_mail_key_1': 'close_user_1'
'close_io_mail_key_2': 'close_user_2'
}
spyOn(followupCloseIoLeads, 'getUserIdByApiKey').and.callFake((key) -> Promise.resolve(apiKeyMap[key]))
spyOn(followupCloseIoLeads, 'getSomeLeads').and.returnValue(Promise.resolve(factories.makeLeadsResult()))
spyOn(followupCloseIoLeads, 'theyHaveNotResponded').and.returnValue(Promise.resolve(true))
spyOn(followupCloseIoLeads, 'createSendFollowupMailFn').and.returnValue((done)->done())
spyOn(followupCloseIoLeads, 'closeIoMailApiKeys').and.returnValue(['close_io_mail_key_1', 'close_io_mail_key_2'])
it 'sends emails', (done) ->
followupCloseIoLeads.sendSecondFollowupMails ->
expect(followupCloseIoLeads.createSendFollowupMailFn).toHaveBeenCalled()
done()
describe 'createAddCallTaskFn', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'sendMail')
spyOn(followupCloseIoLeads, 'getTasksForLead').and.returnValue(Promise.resolve(factories.makeTasksResult(0)))
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: true, auto2: true })))
spyOn(followupCloseIoLeads, 'isTemplateAuto2').and.callFake((template_id) -> template_id is 'template_auto2')
spyOn(followupCloseIoLeads, 'postTask').and.returnValue(Promise.resolve())
it 'creates a call task', (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key_1'}
lead = factories.makeLead({ auto2: true })
contactEmails = factories.makeContact({ withEmails: ['teacher1@example.com', 'teacher1.fullname@example.com'] })
followupCloseIoLeads.createAddCallTaskFn(userApiKeyMap, moment().subtract(3, 'days'), lead, contactEmails)( =>
expect(followupCloseIoLeads.postTask).toHaveBeenCalled()
done()
)
describe 'addCallTasks', ->
beforeEach ->
apiKeyMap = {
'close_io_mail_key_1': 'close_user_1'
'close_io_mail_key_2': 'close_user_2'
}
spyOn(followupCloseIoLeads, 'getUserIdByApiKey').and.callFake((key) -> Promise.resolve(apiKeyMap[key]))
spyOn(followupCloseIoLeads, 'getSomeLeads').and.returnValue(Promise.resolve(factories.makeLeadsResult()))
spyOn(followupCloseIoLeads, 'contactHasEmailAddress').and.returnValue(true)
spyOn(followupCloseIoLeads, 'contactHasPhoneNumbers').and.returnValue(true)
spyOn(followupCloseIoLeads, 'createAddCallTaskFn').and.returnValue((done)->done())
spyOn(followupCloseIoLeads, 'closeIoMailApiKeys').and.returnValue(['close_io_mail_key_1', 'close_io_mail_key_2'])
it 'adds call tasks', (done) ->
followupCloseIoLeads.addCallTasks ->
expect(followupCloseIoLeads.createAddCallTaskFn).toHaveBeenCalled()
done()
| 113087 | # TODO: use nock for making sure network requests are sent, blackbox whole script
# TODO: improve coverage of various cases; current coverage is poor and incomplete
request = require 'request'
moment = require 'moment'
followupCloseIoLeads = require '../../../scripts/sales/followupCloseIoLeads'
factories = require './closeFactories'
describe '/scripts/sales/followupCloseIoLeads', ->
beforeEach ->
spyOn(request, 'getAsync')
spyOn(request, 'putAsync')
spyOn(request, 'postAsync')
spyOn(followupCloseIoLeads, 'log')
describe 'contactHasEmailAddress', ->
it 'returns true if the contact has any email addresses', ->
expect(followupCloseIoLeads.contactHasEmailAddress(factories.makeContact({withEmails: true}))).toBe(true)
it 'returns false if the contact has no email addresses', ->
expect(followupCloseIoLeads.contactHasEmailAddress(factories.makeContact())).toBe(false)
describe 'contactHasPhoneNumbers', ->
it 'returns true if the contact has any phone numbers', ->
expect(followupCloseIoLeads.contactHasPhoneNumbers(factories.makeContact({withPhones: true}))).toBe(true)
it 'returns false if the contact has no phone numbers', ->
expect(followupCloseIoLeads.contactHasPhoneNumbers(factories.makeContact())).toBe(false)
describe 'lowercaseEmailsForContact', ->
it 'returns a list of email addresses all in lower case', ->
contactEmails = ['<EMAIL>', '<EMAIL>']
lowercaseContactEmails = ['<EMAIL>', '<EMAIL>']
expect(followupCloseIoLeads.lowercaseEmailsForContact(factories.makeContact({withEmails: contactEmails}))).toEqual(lowercaseContactEmails)
describe 'general network requests', ->
describe 'getJsonUrl', ->
it 'calls request.getAsync with url and json: true', ->
url = 'http://example.com/model/id'
followupCloseIoLeads.getJsonUrl(url)
expect(request.getAsync.calls.argsFor(0)).toEqual([{
url: url,
json: true
}])
describe 'postJsonUrl', ->
describe 'putJsonUrl', ->
describe 'Close.io API requests', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getJsonUrl').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'postJsonUrl').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'putJsonUrl').and.returnValue(Promise.resolve())
describe 'getSomeLeads', ->
describe 'getEmailActivityForLead', ->
describe 'getActivityForLead', ->
describe 'postEmailActivity', ->
describe 'postTask', ->
describe 'sendMail', ->
describe 'updateLeadStatus', ->
describe 'theyHaveNotResponded', ->
beforeEach ->
@lead = {id: 'lead_1'}
@contact = factories.makeContact({ withEmails: 2 })
describe "we haven't even sent them a first email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult()))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(false)
done()
describe "they haven't sent us any email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: {to: [@contact.emails[0].email]}, they_replied: false })))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(true)
done()
describe "they have sent us an email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: {to: [@contact.emails[0].email]}, they_replied: {to: ['<EMAIL>'], sender: "<NAME> User <#{@contact.emails[0].email}>"} })))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(false)
done()
describe 'createSendFollowupMailFn', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'sendMail').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'getTasksForLead').and.returnValue(factories.makeTasksResult(0))
spyOn(followupCloseIoLeads, 'updateLeadStatus').and.returnValue(Promise.resolve())
describe 'when we have sent an auto1 email', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'isTemplateAuto1').and.returnValue(true)
describe 'more than 3 days ago', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: true })))
spyOn(followupCloseIoLeads, 'getRandomEmailTemplateAuto2').and.returnValue('template_auto2')
describe "and they haven't responded to the first auto-email", ->
it "sends a followup auto-email", (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key_1'}
lead = factories.makeLead({ auto1: true })
contactEmails = ['<EMAIL>', '<EMAIL>']
followupCloseIoLeads.createSendFollowupMailFn(userApiKeyMap, moment().subtract(3, 'days').toDate(), lead, contactEmails)( =>
expect(followupCloseIoLeads.sendMail).toHaveBeenCalled()
expect(followupCloseIoLeads.updateLeadStatus).toHaveBeenCalled()
done()
)
describe 'in the last 3 days', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: { date_created: new Date() } })))
spyOn(followupCloseIoLeads, 'getRandomEmailTemplateAuto2')
it "doesn't send a followup email or update the lead's status", (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key'}
lead = factories.makeLead({ auto1: true })
contactEmails = ['<EMAIL>', '<EMAIL>']
followupCloseIoLeads.createSendFollowupMailFn(userApiKeyMap, moment().subtract(3, 'days'), lead, contactEmails)( =>
expect(followupCloseIoLeads.sendMail).not.toHaveBeenCalled()
expect(followupCloseIoLeads.updateLeadStatus).not.toHaveBeenCalled()
done()
)
describe 'sendSecondFollowupMails', ->
beforeEach ->
apiKeyMap = {
'close_io_mail_key_1': '<KEY>'
'close_io_mail_key_2': '<KEY>'
}
spyOn(followupCloseIoLeads, 'getUserIdByApiKey').and.callFake((key) -> Promise.resolve(apiKeyMap[key]))
spyOn(followupCloseIoLeads, 'getSomeLeads').and.returnValue(Promise.resolve(factories.makeLeadsResult()))
spyOn(followupCloseIoLeads, 'theyHaveNotResponded').and.returnValue(Promise.resolve(true))
spyOn(followupCloseIoLeads, 'createSendFollowupMailFn').and.returnValue((done)->done())
spyOn(followupCloseIoLeads, 'closeIoMailApiKeys').and.returnValue(['close_io_mail_key_1', 'close_io_mail_key_2'])
it 'sends emails', (done) ->
followupCloseIoLeads.sendSecondFollowupMails ->
expect(followupCloseIoLeads.createSendFollowupMailFn).toHaveBeenCalled()
done()
describe 'createAddCallTaskFn', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'sendMail')
spyOn(followupCloseIoLeads, 'getTasksForLead').and.returnValue(Promise.resolve(factories.makeTasksResult(0)))
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: true, auto2: true })))
spyOn(followupCloseIoLeads, 'isTemplateAuto2').and.callFake((template_id) -> template_id is 'template_auto2')
spyOn(followupCloseIoLeads, 'postTask').and.returnValue(Promise.resolve())
it 'creates a call task', (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key_1'}
lead = factories.makeLead({ auto2: true })
contactEmails = factories.makeContact({ withEmails: ['<EMAIL>', '<EMAIL>'] })
followupCloseIoLeads.createAddCallTaskFn(userApiKeyMap, moment().subtract(3, 'days'), lead, contactEmails)( =>
expect(followupCloseIoLeads.postTask).toHaveBeenCalled()
done()
)
describe 'addCallTasks', ->
beforeEach ->
apiKeyMap = {
'close_io_mail_key_1': 'close_<KEY>1'
'close_io_mail_key_2': '<KEY>'
}
spyOn(followupCloseIoLeads, 'getUserIdByApiKey').and.callFake((key) -> Promise.resolve(apiKeyMap[key]))
spyOn(followupCloseIoLeads, 'getSomeLeads').and.returnValue(Promise.resolve(factories.makeLeadsResult()))
spyOn(followupCloseIoLeads, 'contactHasEmailAddress').and.returnValue(true)
spyOn(followupCloseIoLeads, 'contactHasPhoneNumbers').and.returnValue(true)
spyOn(followupCloseIoLeads, 'createAddCallTaskFn').and.returnValue((done)->done())
spyOn(followupCloseIoLeads, 'closeIoMailApiKeys').and.returnValue(['close_io_mail_key_1', 'close_io_mail_key_2'])
it 'adds call tasks', (done) ->
followupCloseIoLeads.addCallTasks ->
expect(followupCloseIoLeads.createAddCallTaskFn).toHaveBeenCalled()
done()
| true | # TODO: use nock for making sure network requests are sent, blackbox whole script
# TODO: improve coverage of various cases; current coverage is poor and incomplete
request = require 'request'
moment = require 'moment'
followupCloseIoLeads = require '../../../scripts/sales/followupCloseIoLeads'
factories = require './closeFactories'
describe '/scripts/sales/followupCloseIoLeads', ->
beforeEach ->
spyOn(request, 'getAsync')
spyOn(request, 'putAsync')
spyOn(request, 'postAsync')
spyOn(followupCloseIoLeads, 'log')
describe 'contactHasEmailAddress', ->
it 'returns true if the contact has any email addresses', ->
expect(followupCloseIoLeads.contactHasEmailAddress(factories.makeContact({withEmails: true}))).toBe(true)
it 'returns false if the contact has no email addresses', ->
expect(followupCloseIoLeads.contactHasEmailAddress(factories.makeContact())).toBe(false)
describe 'contactHasPhoneNumbers', ->
it 'returns true if the contact has any phone numbers', ->
expect(followupCloseIoLeads.contactHasPhoneNumbers(factories.makeContact({withPhones: true}))).toBe(true)
it 'returns false if the contact has no phone numbers', ->
expect(followupCloseIoLeads.contactHasPhoneNumbers(factories.makeContact())).toBe(false)
describe 'lowercaseEmailsForContact', ->
it 'returns a list of email addresses all in lower case', ->
contactEmails = ['PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI']
lowercaseContactEmails = ['PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI']
expect(followupCloseIoLeads.lowercaseEmailsForContact(factories.makeContact({withEmails: contactEmails}))).toEqual(lowercaseContactEmails)
describe 'general network requests', ->
describe 'getJsonUrl', ->
it 'calls request.getAsync with url and json: true', ->
url = 'http://example.com/model/id'
followupCloseIoLeads.getJsonUrl(url)
expect(request.getAsync.calls.argsFor(0)).toEqual([{
url: url,
json: true
}])
describe 'postJsonUrl', ->
describe 'putJsonUrl', ->
describe 'Close.io API requests', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getJsonUrl').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'postJsonUrl').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'putJsonUrl').and.returnValue(Promise.resolve())
describe 'getSomeLeads', ->
describe 'getEmailActivityForLead', ->
describe 'getActivityForLead', ->
describe 'postEmailActivity', ->
describe 'postTask', ->
describe 'sendMail', ->
describe 'updateLeadStatus', ->
describe 'theyHaveNotResponded', ->
beforeEach ->
@lead = {id: 'lead_1'}
@contact = factories.makeContact({ withEmails: 2 })
describe "we haven't even sent them a first email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult()))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(false)
done()
describe "they haven't sent us any email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: {to: [@contact.emails[0].email]}, they_replied: false })))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(true)
done()
describe "they have sent us an email", ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: {to: [@contact.emails[0].email]}, they_replied: {to: ['PI:EMAIL:<EMAIL>END_PI'], sender: "PI:NAME:<NAME>END_PI User <#{@contact.emails[0].email}>"} })))
it 'TODO', (done) ->
followupCloseIoLeads.theyHaveNotResponded(@lead, @contact).then (result) =>
expect(result).toBe(false)
done()
describe 'createSendFollowupMailFn', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'sendMail').and.returnValue(Promise.resolve())
spyOn(followupCloseIoLeads, 'getTasksForLead').and.returnValue(factories.makeTasksResult(0))
spyOn(followupCloseIoLeads, 'updateLeadStatus').and.returnValue(Promise.resolve())
describe 'when we have sent an auto1 email', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'isTemplateAuto1').and.returnValue(true)
describe 'more than 3 days ago', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: true })))
spyOn(followupCloseIoLeads, 'getRandomEmailTemplateAuto2').and.returnValue('template_auto2')
describe "and they haven't responded to the first auto-email", ->
it "sends a followup auto-email", (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key_1'}
lead = factories.makeLead({ auto1: true })
contactEmails = ['PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI']
followupCloseIoLeads.createSendFollowupMailFn(userApiKeyMap, moment().subtract(3, 'days').toDate(), lead, contactEmails)( =>
expect(followupCloseIoLeads.sendMail).toHaveBeenCalled()
expect(followupCloseIoLeads.updateLeadStatus).toHaveBeenCalled()
done()
)
describe 'in the last 3 days', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: { date_created: new Date() } })))
spyOn(followupCloseIoLeads, 'getRandomEmailTemplateAuto2')
it "doesn't send a followup email or update the lead's status", (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key'}
lead = factories.makeLead({ auto1: true })
contactEmails = ['PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI']
followupCloseIoLeads.createSendFollowupMailFn(userApiKeyMap, moment().subtract(3, 'days'), lead, contactEmails)( =>
expect(followupCloseIoLeads.sendMail).not.toHaveBeenCalled()
expect(followupCloseIoLeads.updateLeadStatus).not.toHaveBeenCalled()
done()
)
describe 'sendSecondFollowupMails', ->
beforeEach ->
apiKeyMap = {
'close_io_mail_key_1': 'PI:KEY:<KEY>END_PI'
'close_io_mail_key_2': 'PI:KEY:<KEY>END_PI'
}
spyOn(followupCloseIoLeads, 'getUserIdByApiKey').and.callFake((key) -> Promise.resolve(apiKeyMap[key]))
spyOn(followupCloseIoLeads, 'getSomeLeads').and.returnValue(Promise.resolve(factories.makeLeadsResult()))
spyOn(followupCloseIoLeads, 'theyHaveNotResponded').and.returnValue(Promise.resolve(true))
spyOn(followupCloseIoLeads, 'createSendFollowupMailFn').and.returnValue((done)->done())
spyOn(followupCloseIoLeads, 'closeIoMailApiKeys').and.returnValue(['close_io_mail_key_1', 'close_io_mail_key_2'])
it 'sends emails', (done) ->
followupCloseIoLeads.sendSecondFollowupMails ->
expect(followupCloseIoLeads.createSendFollowupMailFn).toHaveBeenCalled()
done()
describe 'createAddCallTaskFn', ->
beforeEach ->
spyOn(followupCloseIoLeads, 'sendMail')
spyOn(followupCloseIoLeads, 'getTasksForLead').and.returnValue(Promise.resolve(factories.makeTasksResult(0)))
spyOn(followupCloseIoLeads, 'getActivityForLead').and.returnValue(Promise.resolve(factories.makeActivityResult({ auto1: true, auto2: true })))
spyOn(followupCloseIoLeads, 'isTemplateAuto2').and.callFake((template_id) -> template_id is 'template_auto2')
spyOn(followupCloseIoLeads, 'postTask').and.returnValue(Promise.resolve())
it 'creates a call task', (done) ->
userApiKeyMap = {close_user_1: 'close_io_mail_key_1'}
lead = factories.makeLead({ auto2: true })
contactEmails = factories.makeContact({ withEmails: ['PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI'] })
followupCloseIoLeads.createAddCallTaskFn(userApiKeyMap, moment().subtract(3, 'days'), lead, contactEmails)( =>
expect(followupCloseIoLeads.postTask).toHaveBeenCalled()
done()
)
describe 'addCallTasks', ->
beforeEach ->
apiKeyMap = {
'close_io_mail_key_1': 'close_PI:KEY:<KEY>END_PI1'
'close_io_mail_key_2': 'PI:KEY:<KEY>END_PI'
}
spyOn(followupCloseIoLeads, 'getUserIdByApiKey').and.callFake((key) -> Promise.resolve(apiKeyMap[key]))
spyOn(followupCloseIoLeads, 'getSomeLeads').and.returnValue(Promise.resolve(factories.makeLeadsResult()))
spyOn(followupCloseIoLeads, 'contactHasEmailAddress').and.returnValue(true)
spyOn(followupCloseIoLeads, 'contactHasPhoneNumbers').and.returnValue(true)
spyOn(followupCloseIoLeads, 'createAddCallTaskFn').and.returnValue((done)->done())
spyOn(followupCloseIoLeads, 'closeIoMailApiKeys').and.returnValue(['close_io_mail_key_1', 'close_io_mail_key_2'])
it 'adds call tasks', (done) ->
followupCloseIoLeads.addCallTasks ->
expect(followupCloseIoLeads.createAddCallTaskFn).toHaveBeenCalled()
done()
|
[
{
"context": " [iOrder](http://neocotic.com/iOrder) \n# (c) 2013 Alasdair Mercer \n# Freely distributable under the MIT license. ",
"end": 67,
"score": 0.9998739957809448,
"start": 52,
"tag": "NAME",
"value": "Alasdair Mercer"
}
] | chrome/src/lib/log.coffee | neocotic/iOrder | 0 | # [iOrder](http://neocotic.com/iOrder)
# (c) 2013 Alasdair Mercer
# Freely distributable under the MIT license.
# For all details and documentation:
# <http://neocotic.com/iOrder>
# Private constants
# -----------------
# Define the different logging levels privately first.
LEVELS =
trace: 10
information: 20
debug: 30
warning: 40
error: 50
# Private variables
# -----------------
# Ensure that all logs are sent to the background pages console.
{console} = chrome.extension.getBackgroundPage()
# Private functions
# -----------------
# Determine whether or not logging is enabled for the specified `level`.
loggable = (level) -> log.config.enabled and level >= log.config.level
# Logging setup
# -------------
log = window.log = new class Log extends utils.Class
# Public constants
# ----------------
# Expose the available logging levels.
TRACE: LEVELS.trace
INFORMATION: LEVELS.information
DEBUG: LEVELS.debug
WARNING: LEVELS.warning
ERROR: LEVELS.error
# A collection of all of the levels to allow iteration.
LEVELS: (
levels = []
levels.push name: key, value: value for own key, value of LEVELS
levels.sort (a, b) -> a.value - b.value
)
# Public variables
# ----------------
# Hold the current conguration for the logger.
config:
enabled: no
level: LEVELS.debug
# Public functions
# ----------------
# Create/increment a counter and output its current count for all `names`.
count: (names...) ->
console.count name for name in names if loggable @DEBUG
# Output all debug `entries`.
debug: (entries...) ->
console.debug entry for entry in entries if loggable @DEBUG
# Display an interactive listing of the properties of all `entries`.
dir: (entries...) ->
console.dir entry for entry in entries if loggable @DEBUG
# Output all error `entries`.
error: (entries...) ->
console.error entry for entry in entries if loggable @ERROR
# Output all informative `entries`.
info: (entries...) ->
console.info entry for entry in entries if loggable @INFORMATION
# Output all general `entries`.
out: (entries...) ->
console.log entry for entry in entries if @config.enabled
# Start a timer for all `names`.
time: (names...) ->
console.time name for name in names if loggable @DEBUG
# Stop a timer and output its elapsed time in milliseconds for all `names`.
timeEnd: (names...) ->
console.timeEnd name for name in names if loggable @DEBUG
# Output a stack trace.
trace: (caller = @trace) ->
console.log new @StackTrace(caller).stack if loggable @TRACE
# Output all warning `entries`.
warn: (entries...) ->
console.warn entry for entry in entries if loggable @WARNING
# Public classes
# --------------
# `StackTrace` allows the current stack trace to be retrieved in the easiest way possible.
class log.StackTrace extends utils.Class
# Create a new instance of `StackTrace` for the `caller`.
constructor: (caller = log.StackTrace) ->
# Create the stack trace and assign it to a new `stack` property.
Error.captureStackTrace this, caller
# Configuration
# -------------
# Initialize logging.
if store?
store.init 'logger', {}
store.modify 'logger', (logger) ->
logger.enabled ?= no
logger.level ?= LEVELS.debug
log.config = logger | 167802 | # [iOrder](http://neocotic.com/iOrder)
# (c) 2013 <NAME>
# Freely distributable under the MIT license.
# For all details and documentation:
# <http://neocotic.com/iOrder>
# Private constants
# -----------------
# Define the different logging levels privately first.
LEVELS =
trace: 10
information: 20
debug: 30
warning: 40
error: 50
# Private variables
# -----------------
# Ensure that all logs are sent to the background pages console.
{console} = chrome.extension.getBackgroundPage()
# Private functions
# -----------------
# Determine whether or not logging is enabled for the specified `level`.
loggable = (level) -> log.config.enabled and level >= log.config.level
# Logging setup
# -------------
log = window.log = new class Log extends utils.Class
# Public constants
# ----------------
# Expose the available logging levels.
TRACE: LEVELS.trace
INFORMATION: LEVELS.information
DEBUG: LEVELS.debug
WARNING: LEVELS.warning
ERROR: LEVELS.error
# A collection of all of the levels to allow iteration.
LEVELS: (
levels = []
levels.push name: key, value: value for own key, value of LEVELS
levels.sort (a, b) -> a.value - b.value
)
# Public variables
# ----------------
# Hold the current conguration for the logger.
config:
enabled: no
level: LEVELS.debug
# Public functions
# ----------------
# Create/increment a counter and output its current count for all `names`.
count: (names...) ->
console.count name for name in names if loggable @DEBUG
# Output all debug `entries`.
debug: (entries...) ->
console.debug entry for entry in entries if loggable @DEBUG
# Display an interactive listing of the properties of all `entries`.
dir: (entries...) ->
console.dir entry for entry in entries if loggable @DEBUG
# Output all error `entries`.
error: (entries...) ->
console.error entry for entry in entries if loggable @ERROR
# Output all informative `entries`.
info: (entries...) ->
console.info entry for entry in entries if loggable @INFORMATION
# Output all general `entries`.
out: (entries...) ->
console.log entry for entry in entries if @config.enabled
# Start a timer for all `names`.
time: (names...) ->
console.time name for name in names if loggable @DEBUG
# Stop a timer and output its elapsed time in milliseconds for all `names`.
timeEnd: (names...) ->
console.timeEnd name for name in names if loggable @DEBUG
# Output a stack trace.
trace: (caller = @trace) ->
console.log new @StackTrace(caller).stack if loggable @TRACE
# Output all warning `entries`.
warn: (entries...) ->
console.warn entry for entry in entries if loggable @WARNING
# Public classes
# --------------
# `StackTrace` allows the current stack trace to be retrieved in the easiest way possible.
class log.StackTrace extends utils.Class
# Create a new instance of `StackTrace` for the `caller`.
constructor: (caller = log.StackTrace) ->
# Create the stack trace and assign it to a new `stack` property.
Error.captureStackTrace this, caller
# Configuration
# -------------
# Initialize logging.
if store?
store.init 'logger', {}
store.modify 'logger', (logger) ->
logger.enabled ?= no
logger.level ?= LEVELS.debug
log.config = logger | true | # [iOrder](http://neocotic.com/iOrder)
# (c) 2013 PI:NAME:<NAME>END_PI
# Freely distributable under the MIT license.
# For all details and documentation:
# <http://neocotic.com/iOrder>
# Private constants
# -----------------
# Define the different logging levels privately first.
LEVELS =
trace: 10
information: 20
debug: 30
warning: 40
error: 50
# Private variables
# -----------------
# Ensure that all logs are sent to the background pages console.
{console} = chrome.extension.getBackgroundPage()
# Private functions
# -----------------
# Determine whether or not logging is enabled for the specified `level`.
loggable = (level) -> log.config.enabled and level >= log.config.level
# Logging setup
# -------------
log = window.log = new class Log extends utils.Class
# Public constants
# ----------------
# Expose the available logging levels.
TRACE: LEVELS.trace
INFORMATION: LEVELS.information
DEBUG: LEVELS.debug
WARNING: LEVELS.warning
ERROR: LEVELS.error
# A collection of all of the levels to allow iteration.
LEVELS: (
levels = []
levels.push name: key, value: value for own key, value of LEVELS
levels.sort (a, b) -> a.value - b.value
)
# Public variables
# ----------------
# Hold the current conguration for the logger.
config:
enabled: no
level: LEVELS.debug
# Public functions
# ----------------
# Create/increment a counter and output its current count for all `names`.
count: (names...) ->
console.count name for name in names if loggable @DEBUG
# Output all debug `entries`.
debug: (entries...) ->
console.debug entry for entry in entries if loggable @DEBUG
# Display an interactive listing of the properties of all `entries`.
dir: (entries...) ->
console.dir entry for entry in entries if loggable @DEBUG
# Output all error `entries`.
error: (entries...) ->
console.error entry for entry in entries if loggable @ERROR
# Output all informative `entries`.
info: (entries...) ->
console.info entry for entry in entries if loggable @INFORMATION
# Output all general `entries`.
out: (entries...) ->
console.log entry for entry in entries if @config.enabled
# Start a timer for all `names`.
time: (names...) ->
console.time name for name in names if loggable @DEBUG
# Stop a timer and output its elapsed time in milliseconds for all `names`.
timeEnd: (names...) ->
console.timeEnd name for name in names if loggable @DEBUG
# Output a stack trace.
trace: (caller = @trace) ->
console.log new @StackTrace(caller).stack if loggable @TRACE
# Output all warning `entries`.
warn: (entries...) ->
console.warn entry for entry in entries if loggable @WARNING
# Public classes
# --------------
# `StackTrace` allows the current stack trace to be retrieved in the easiest way possible.
class log.StackTrace extends utils.Class
# Create a new instance of `StackTrace` for the `caller`.
constructor: (caller = log.StackTrace) ->
# Create the stack trace and assign it to a new `stack` property.
Error.captureStackTrace this, caller
# Configuration
# -------------
# Initialize logging.
if store?
store.init 'logger', {}
store.modify 'logger', (logger) ->
logger.enabled ?= no
logger.level ?= LEVELS.debug
log.config = logger |
[
{
"context": "###\n Copyright (c) 2015 Abi Hafshin\n see README.md\n###\n\ndebug = require('debug')('ap",
"end": 36,
"score": 0.9998772740364075,
"start": 25,
"tag": "NAME",
"value": "Abi Hafshin"
}
] | app/controller.coffee | abihf/express-rad | 0 | ###
Copyright (c) 2015 Abi Hafshin
see README.md
###
debug = require('debug')('app:controller')
fs = require 'fs'
path = require 'path'
default_config =
defaultModule: 'main'
defaultController: 'default'
defaultAction: 'index'
###
This class must be extended by any controllers
###
class Controller
constructor: (@req, @res, @next) ->
createUrl: (name, param) ->
return @res.createUrl(name, param)
redirect: (name, param, status) ->
@res.redirect(@createUrl(name, param), status)
render: (name, data) ->
if name[0] is '/'
name = name.substr(1)
else
name = @req.routeName.replace(/\.\w+$/, '').replace('.', '/') + '/' + name
debug('rendering %s', name)
@res.render(name, data)
runAction: (name) ->
funcName = 'action' + name.replace /(^|-)\w/g, (c) ->
if c[0] is '-' then c=c[1]
return c.toUpperCase()
debug('calling action function: %s', funcName)
action = this[funcName]
if action
if typeof action._paramNames isnt 'object'
paramStr = action.toString().match(/function\s+\w*\(\s*([^)]*)\s*\)/)[1].trim()
action._paramNames = if paramStr.length > 0 then paramStr.split(/,\s*/) else []
requestParams = @req.params
requestQuery = @req.query
callParams = action._paramNames.map (param_name) -> requestParams[param_name] || requestQuery[param_name]
action.apply(this, callParams)
else
@next new HttpError @req.i18n.__('Action %s not found', name), 404
Object.defineProperty(Controller.prototype, 'db', {
get: -> @req.db
})
## Controller loader
loaded_controllers = {}
found_controllers = {}
basedir = path.join __dirname, 'controllers'
searchController = (subdir) ->
getController = (module_name, controller_name) ->
import_name = module_name + '/' + controller_name
if not loaded_controllers[import_name]
debug('importing controller: %s', import_name)
if fs.existsSync(path.join(basedir, import_name+'.js')) or fs.existsSync(path.join(basedir, import_name+'.coffee'))
controller_loader = require('./controllers/' + import_name)
loaded_controllers[import_name] = controller_loader(Controller)
return loaded_controllers[import_name]
# middleware
module.exports = () ->
return (req, res, next) ->
parts = if req.routeName.length > 0 then req.routeName.split('.', 3) else []
n = Math.min parts.length, 3
module_name = req.params._module || if n > 2 then parts[0] else default_config.defaultModule
controller_name = req.params._controller || if n > 1 then parts[n-2] else default_config.defaultController
action_name = req.params._action || if n > 0 then parts[n-1] else default_config.defaultAction
req.routeName = "#{module_name}.#{controller_name}.#{action_name}"
debug("handling %s", req.routeName)
controllerClass = getController(module_name, controller_name)
if controllerClass
controller = new controllerClass(req, res, next)
controller.runAction(action_name)
else
next new HttpError req.i18n.__('Controller %s.%s not found', module_name, controller_name), 404
| 94389 | ###
Copyright (c) 2015 <NAME>
see README.md
###
debug = require('debug')('app:controller')
fs = require 'fs'
path = require 'path'
default_config =
defaultModule: 'main'
defaultController: 'default'
defaultAction: 'index'
###
This class must be extended by any controllers
###
class Controller
constructor: (@req, @res, @next) ->
createUrl: (name, param) ->
return @res.createUrl(name, param)
redirect: (name, param, status) ->
@res.redirect(@createUrl(name, param), status)
render: (name, data) ->
if name[0] is '/'
name = name.substr(1)
else
name = @req.routeName.replace(/\.\w+$/, '').replace('.', '/') + '/' + name
debug('rendering %s', name)
@res.render(name, data)
runAction: (name) ->
funcName = 'action' + name.replace /(^|-)\w/g, (c) ->
if c[0] is '-' then c=c[1]
return c.toUpperCase()
debug('calling action function: %s', funcName)
action = this[funcName]
if action
if typeof action._paramNames isnt 'object'
paramStr = action.toString().match(/function\s+\w*\(\s*([^)]*)\s*\)/)[1].trim()
action._paramNames = if paramStr.length > 0 then paramStr.split(/,\s*/) else []
requestParams = @req.params
requestQuery = @req.query
callParams = action._paramNames.map (param_name) -> requestParams[param_name] || requestQuery[param_name]
action.apply(this, callParams)
else
@next new HttpError @req.i18n.__('Action %s not found', name), 404
Object.defineProperty(Controller.prototype, 'db', {
get: -> @req.db
})
## Controller loader
loaded_controllers = {}
found_controllers = {}
basedir = path.join __dirname, 'controllers'
searchController = (subdir) ->
getController = (module_name, controller_name) ->
import_name = module_name + '/' + controller_name
if not loaded_controllers[import_name]
debug('importing controller: %s', import_name)
if fs.existsSync(path.join(basedir, import_name+'.js')) or fs.existsSync(path.join(basedir, import_name+'.coffee'))
controller_loader = require('./controllers/' + import_name)
loaded_controllers[import_name] = controller_loader(Controller)
return loaded_controllers[import_name]
# middleware
module.exports = () ->
return (req, res, next) ->
parts = if req.routeName.length > 0 then req.routeName.split('.', 3) else []
n = Math.min parts.length, 3
module_name = req.params._module || if n > 2 then parts[0] else default_config.defaultModule
controller_name = req.params._controller || if n > 1 then parts[n-2] else default_config.defaultController
action_name = req.params._action || if n > 0 then parts[n-1] else default_config.defaultAction
req.routeName = "#{module_name}.#{controller_name}.#{action_name}"
debug("handling %s", req.routeName)
controllerClass = getController(module_name, controller_name)
if controllerClass
controller = new controllerClass(req, res, next)
controller.runAction(action_name)
else
next new HttpError req.i18n.__('Controller %s.%s not found', module_name, controller_name), 404
| true | ###
Copyright (c) 2015 PI:NAME:<NAME>END_PI
see README.md
###
debug = require('debug')('app:controller')
fs = require 'fs'
path = require 'path'
default_config =
defaultModule: 'main'
defaultController: 'default'
defaultAction: 'index'
###
This class must be extended by any controllers
###
class Controller
constructor: (@req, @res, @next) ->
createUrl: (name, param) ->
return @res.createUrl(name, param)
redirect: (name, param, status) ->
@res.redirect(@createUrl(name, param), status)
render: (name, data) ->
if name[0] is '/'
name = name.substr(1)
else
name = @req.routeName.replace(/\.\w+$/, '').replace('.', '/') + '/' + name
debug('rendering %s', name)
@res.render(name, data)
runAction: (name) ->
funcName = 'action' + name.replace /(^|-)\w/g, (c) ->
if c[0] is '-' then c=c[1]
return c.toUpperCase()
debug('calling action function: %s', funcName)
action = this[funcName]
if action
if typeof action._paramNames isnt 'object'
paramStr = action.toString().match(/function\s+\w*\(\s*([^)]*)\s*\)/)[1].trim()
action._paramNames = if paramStr.length > 0 then paramStr.split(/,\s*/) else []
requestParams = @req.params
requestQuery = @req.query
callParams = action._paramNames.map (param_name) -> requestParams[param_name] || requestQuery[param_name]
action.apply(this, callParams)
else
@next new HttpError @req.i18n.__('Action %s not found', name), 404
Object.defineProperty(Controller.prototype, 'db', {
get: -> @req.db
})
## Controller loader
loaded_controllers = {}
found_controllers = {}
basedir = path.join __dirname, 'controllers'
searchController = (subdir) ->
getController = (module_name, controller_name) ->
import_name = module_name + '/' + controller_name
if not loaded_controllers[import_name]
debug('importing controller: %s', import_name)
if fs.existsSync(path.join(basedir, import_name+'.js')) or fs.existsSync(path.join(basedir, import_name+'.coffee'))
controller_loader = require('./controllers/' + import_name)
loaded_controllers[import_name] = controller_loader(Controller)
return loaded_controllers[import_name]
# middleware
module.exports = () ->
return (req, res, next) ->
parts = if req.routeName.length > 0 then req.routeName.split('.', 3) else []
n = Math.min parts.length, 3
module_name = req.params._module || if n > 2 then parts[0] else default_config.defaultModule
controller_name = req.params._controller || if n > 1 then parts[n-2] else default_config.defaultController
action_name = req.params._action || if n > 0 then parts[n-1] else default_config.defaultAction
req.routeName = "#{module_name}.#{controller_name}.#{action_name}"
debug("handling %s", req.routeName)
controllerClass = getController(module_name, controller_name)
if controllerClass
controller = new controllerClass(req, res, next)
controller.runAction(action_name)
else
next new HttpError req.i18n.__('Controller %s.%s not found', module_name, controller_name), 404
|
[
{
"context": "# Copyright Joyent, Inc. and other Node contributors.\n#\n# Permission",
"end": 18,
"score": 0.9972090721130371,
"start": 12,
"tag": "NAME",
"value": "Joyent"
},
{
"context": " gid: otherGid\n)\nwhoName = spawn(\"id\", [],\n uid: otherName\n gid: otherGid\n)\nwhoNumb... | test/disabled/test-child-process-uid-gid.coffee | lxe/io.coffee | 0 | # Copyright Joyent, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
# get a different user.
# don't care who it is, as long as it's not root
onData = (c) ->
@buf += c
return
onExit = (code) ->
buf = @stdout.buf
console.log buf
expr = new RegExp("^(byName|byNumber):uid=" + otherUid + "\\(" + otherName + "\\) gid=" + otherGid + "\\(")
assert.ok buf.match(expr), "uid and gid should match " + otherName
return
common = require("../common")
assert = require("assert")
spawn = require("child_process").spawn
fs = require("fs")
myUid = process.getuid()
myGid = process.getgid()
unless myUid is 0
console.error "must be run as root, otherwise the gid/uid setting will" + " fail."
process.exit 1
passwd = fs.readFileSync("/etc/passwd", "utf8")
passwd = passwd.trim().split(/\n/)
i = 0
l = passwd.length
while i < l
continue if passwd[i].charAt(0) is "#"
passwd[i] = passwd[i].split(":")
otherName = passwd[i][0]
otherUid = +passwd[i][2]
otherGid = +passwd[i][3]
break if otherUid and otherUid isnt myUid and otherGid and otherGid isnt myGid and otherUid > 0
i++
throw new Error("failed getting passwd info.") if not otherUid and not otherGid
console.error "name, id, gid = %j", [
otherName
otherUid
otherGid
]
whoNumber = spawn("id", [],
uid: otherUid
gid: otherGid
)
whoName = spawn("id", [],
uid: otherName
gid: otherGid
)
whoNumber.stdout.buf = "byNumber:"
whoName.stdout.buf = "byName:"
whoNumber.stdout.on "data", onData
whoName.stdout.on "data", onData
whoNumber.on "exit", onExit
whoName.on "exit", onExit
| 190353 | # Copyright <NAME>, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
# get a different user.
# don't care who it is, as long as it's not root
onData = (c) ->
@buf += c
return
onExit = (code) ->
buf = @stdout.buf
console.log buf
expr = new RegExp("^(byName|byNumber):uid=" + otherUid + "\\(" + otherName + "\\) gid=" + otherGid + "\\(")
assert.ok buf.match(expr), "uid and gid should match " + otherName
return
common = require("../common")
assert = require("assert")
spawn = require("child_process").spawn
fs = require("fs")
myUid = process.getuid()
myGid = process.getgid()
unless myUid is 0
console.error "must be run as root, otherwise the gid/uid setting will" + " fail."
process.exit 1
passwd = fs.readFileSync("/etc/passwd", "utf8")
passwd = passwd.trim().split(/\n/)
i = 0
l = passwd.length
while i < l
continue if passwd[i].charAt(0) is "#"
passwd[i] = passwd[i].split(":")
otherName = passwd[i][0]
otherUid = +passwd[i][2]
otherGid = +passwd[i][3]
break if otherUid and otherUid isnt myUid and otherGid and otherGid isnt myGid and otherUid > 0
i++
throw new Error("failed getting passwd info.") if not otherUid and not otherGid
console.error "name, id, gid = %j", [
otherName
otherUid
otherGid
]
whoNumber = spawn("id", [],
uid: otherUid
gid: otherGid
)
whoName = spawn("id", [],
uid: otherName
gid: otherGid
)
whoNumber.stdout.buf = "byNumber:"
whoName.stdout.buf = "byName:"
whoNumber.stdout.on "data", onData
whoName.stdout.on "data", onData
whoNumber.on "exit", onExit
whoName.on "exit", onExit
| true | # Copyright PI:NAME:<NAME>END_PI, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
# get a different user.
# don't care who it is, as long as it's not root
onData = (c) ->
@buf += c
return
onExit = (code) ->
buf = @stdout.buf
console.log buf
expr = new RegExp("^(byName|byNumber):uid=" + otherUid + "\\(" + otherName + "\\) gid=" + otherGid + "\\(")
assert.ok buf.match(expr), "uid and gid should match " + otherName
return
common = require("../common")
assert = require("assert")
spawn = require("child_process").spawn
fs = require("fs")
myUid = process.getuid()
myGid = process.getgid()
unless myUid is 0
console.error "must be run as root, otherwise the gid/uid setting will" + " fail."
process.exit 1
passwd = fs.readFileSync("/etc/passwd", "utf8")
passwd = passwd.trim().split(/\n/)
i = 0
l = passwd.length
while i < l
continue if passwd[i].charAt(0) is "#"
passwd[i] = passwd[i].split(":")
otherName = passwd[i][0]
otherUid = +passwd[i][2]
otherGid = +passwd[i][3]
break if otherUid and otherUid isnt myUid and otherGid and otherGid isnt myGid and otherUid > 0
i++
throw new Error("failed getting passwd info.") if not otherUid and not otherGid
console.error "name, id, gid = %j", [
otherName
otherUid
otherGid
]
whoNumber = spawn("id", [],
uid: otherUid
gid: otherGid
)
whoName = spawn("id", [],
uid: otherName
gid: otherGid
)
whoNumber.stdout.buf = "byNumber:"
whoName.stdout.buf = "byName:"
whoNumber.stdout.on "data", onData
whoName.stdout.on "data", onData
whoNumber.on "exit", onExit
whoName.on "exit", onExit
|
[
{
"context": " meta:\n name: \"test\"\n author: \"Contra\"\n version: \"0.0.1\"\n\n res = status.load ",
"end": 203,
"score": 0.8408698439598083,
"start": 197,
"tag": "USERNAME",
"value": "Contra"
},
{
"context": "eta:\n name: \"test lol !!\"\n ... | node_modules/status/test/plugins.coffee | DORCAS12345/lamisplus-angular | 0 | status = require '../'
should = require 'should'
require 'mocha'
describe 'loading', ->
it 'should load a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "Contra"
version: "0.0.1"
res = status.load plugin
res.should.equal true
status.remove plugin.meta.name
done()
it 'should not load with an invalid name', (done) ->
plugin =
meta:
name: "test lol !!"
author: "Contra"
version: "0.0.1"
res = status.load plugin
res.should.not.equal true
status.remove plugin.meta.name
done()
it 'should not load with an invalid version', (done) ->
plugin =
meta:
name: "test"
author: "Contra"
version: "-1"
res = status.load plugin
res.should.not.equal true
status.remove plugin.meta.name
done()
describe 'listing', ->
it 'should load and list a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "Contra"
version: "0.0.1"
res = status.load plugin
res.should.equal true
status.plugin(plugin.meta.name).details().version.should.equal plugin.meta.version
status.remove plugin.meta.name
done()
describe 'executing', ->
it 'should load and execute a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "Contra"
version: "0.0.1"
doStuff: (a, b) -> @done a+b
res = status.load plugin
res.should.equal true
plug = status.plugin plugin.meta.name
op = plug.operation "doStuff"
op.on 'error', done
op.on 'done', (ret) ->
should.exist ret
ret.should.equal 3
status.remove plugin.meta.name
done()
op.run 1, 2 | 50360 | status = require '../'
should = require 'should'
require 'mocha'
describe 'loading', ->
it 'should load a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "Contra"
version: "0.0.1"
res = status.load plugin
res.should.equal true
status.remove plugin.meta.name
done()
it 'should not load with an invalid name', (done) ->
plugin =
meta:
name: "test lol !!"
author: "Con<NAME>"
version: "0.0.1"
res = status.load plugin
res.should.not.equal true
status.remove plugin.meta.name
done()
it 'should not load with an invalid version', (done) ->
plugin =
meta:
name: "test"
author: "<NAME>"
version: "-1"
res = status.load plugin
res.should.not.equal true
status.remove plugin.meta.name
done()
describe 'listing', ->
it 'should load and list a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "<NAME>"
version: "0.0.1"
res = status.load plugin
res.should.equal true
status.plugin(plugin.meta.name).details().version.should.equal plugin.meta.version
status.remove plugin.meta.name
done()
describe 'executing', ->
it 'should load and execute a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "<NAME>"
version: "0.0.1"
doStuff: (a, b) -> @done a+b
res = status.load plugin
res.should.equal true
plug = status.plugin plugin.meta.name
op = plug.operation "doStuff"
op.on 'error', done
op.on 'done', (ret) ->
should.exist ret
ret.should.equal 3
status.remove plugin.meta.name
done()
op.run 1, 2 | true | status = require '../'
should = require 'should'
require 'mocha'
describe 'loading', ->
it 'should load a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "Contra"
version: "0.0.1"
res = status.load plugin
res.should.equal true
status.remove plugin.meta.name
done()
it 'should not load with an invalid name', (done) ->
plugin =
meta:
name: "test lol !!"
author: "ConPI:NAME:<NAME>END_PI"
version: "0.0.1"
res = status.load plugin
res.should.not.equal true
status.remove plugin.meta.name
done()
it 'should not load with an invalid version', (done) ->
plugin =
meta:
name: "test"
author: "PI:NAME:<NAME>END_PI"
version: "-1"
res = status.load plugin
res.should.not.equal true
status.remove plugin.meta.name
done()
describe 'listing', ->
it 'should load and list a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "PI:NAME:<NAME>END_PI"
version: "0.0.1"
res = status.load plugin
res.should.equal true
status.plugin(plugin.meta.name).details().version.should.equal plugin.meta.version
status.remove plugin.meta.name
done()
describe 'executing', ->
it 'should load and execute a valid plugin', (done) ->
plugin =
meta:
name: "test"
author: "PI:NAME:<NAME>END_PI"
version: "0.0.1"
doStuff: (a, b) -> @done a+b
res = status.load plugin
res.should.equal true
plug = status.plugin plugin.meta.name
op = plug.operation "doStuff"
op.on 'error', done
op.on 'done', (ret) ->
should.exist ret
ret.should.equal 3
status.remove plugin.meta.name
done()
op.run 1, 2 |
[
{
"context": "ageCode] =\n githubURL: \"https://github.com/codecombat/codecombat/blob/master/app/locale/#{languageCode}",
"end": 744,
"score": 0.9977399706840515,
"start": 734,
"tag": "USERNAME",
"value": "codecombat"
},
{
"context": " [] # English (AU), English (AU)\n ... | app/views/contribute/DiplomatView.coffee | rodeofly/rodeofly.github.io | 0 | ContributeClassView = require './ContributeClassView'
template = require 'templates/contribute/diplomat'
{me} = require 'lib/auth'
module.exports = class DiplomatView extends ContributeClassView
id: 'diplomat-view'
template: template
contributorClassName: 'diplomat'
getRenderData: ->
context = super()
context.viewName = @viewName
context.user = @user unless @user?.isAnonymous()
context.languageStats = @calculateSpokenLanguageStats()
context
calculateSpokenLanguageStats: ->
@locale ?= require 'locale/locale'
totalStrings = @countStrings @locale.en
languageStats = {}
for languageCode, language of @locale
languageStats[languageCode] =
githubURL: "https://github.com/codecombat/codecombat/blob/master/app/locale/#{languageCode}.coffee"
completion: @countStrings(language) / totalStrings
nativeDescription: language.nativeDescription
englishDescription: language.englishDescription
diplomats: @diplomats[languageCode]
languageCode: languageCode
languageStats
countStrings: (language) ->
translated = 0
for section, strings of language.translation
translated += _.size strings
translated
diplomats:
en: [] # English - English
'en-US': [] # English (US), English (US)
'en-GB': [] # English (UK), English (UK)
'en-AU': [] # English (AU), English (AU)
ru: ['fess89', 'ser-storchak', 'Mr A', 'a1ip', 'iulianR', 'EagleTA', 'kisik21', 'Shpionus', 'kerradus', 'ImmortalJoker'] # русский язык, Russian
'de-DE': ['Dirk', 'faabsen', 'HiroP0', 'Anon', 'bkimminich', 'bahuma20', 'domenukk', 'dkundel', 'djsmith85'] # Deutsch (Deutschland), German (Germany)
'de-AT': ['djsmith85'] # Deutsch (Österreich), German (Austria)
'de-CH': ['greyhusky'] # Deutsch (Schweiz), German (Switzerland)
'es-419': ['Jesús Ruppel', 'Matthew Burt', 'Mariano Luzza', '2xG', ] # español (América Latina), Spanish (Latin America)
'es-ES': ['Matthew Burt', 'DanielRodriguezRivero', 'Anon', 'Pouyio', '3rr3s3v3n', 'OviiiOne', 'Vindurrin'] # español (ES), Spanish (Spain)
'zh-HANS': ['Adam23', 'spacepope', 'yangxuan8282', 'Cheng Zheng', 'yfdyh000', 'julycoolwind', 'Vic020', 'onion7878', 'BonnieBBS', '1c7', 'ZephyrSails'] # 简体中文, Chinese (Simplified)
'zh-HANT': ['gintau', 'Adam23'] # 繁体中文, Chinese (Traditional)
'zh-WUU-HANS': [] # 吴语, Wuu (Simplified)
'zh-WUU-HANT': ['benojan'] # 吳語, Wuu (Traditional)
fr: ['Xeonarno', 'Elfisen', 'Armaldio', 'MartinDelille', 'pstweb', 'veritable', 'jaybi', 'xavismeh', 'Anon', 'Feugy', 'dc55028', 'ChrisLightman', 'Oaugereau'] # français, French
ja: ['g1itch', 'kengos', 'treby'] # 日本語, Japanese
ar: ['ahmed80dz', '5y'] # العربية, Arabic
'pt-BR': ['Gutenberg Barros', 'Kieizroe', 'Matthew Burt', 'brunoporto', 'cassiocardoso', 'Bia41'] # português do Brasil, Portuguese (Brazil)
'pt-PT': ['Matthew Burt', 'ReiDuKuduro', 'Imperadeiro98', 'batista', 'ProgramadorLucas', 'gutierri'] # Português (Portugal), Portuguese (Portugal)
pl: ['Anon', 'Kacper Ciepielewski', 'TigroTigro', 'kvasnyk'] # język polski, Polish
it: ['flauta', 'AlessioPaternoster'] # italiano, Italian
tr: ['Nazım Gediz Aydındoğmuş', 'cobaimelan', 'wakeup', 'gediz', 'ilisyus'] # Türkçe, Turkish
'nl-BE': ['Glen De Cauwsemaecker', 'Ruben Vereecken'] # Nederlands (België), Dutch (Belgium)
'nl-NL': ['Jasper D\'haene', 'Guido Zuidhof'] # Nederlands (Nederland), Dutch (Netherlands)
fa: ['Reza Habibi (Rehb)'] # فارسی, Persian
cs: ['vanous'] # čeština, Czech
sv: ['iamhj'] # Svenska, Swedish
id: ['mlewisno-oberlin'] # Bahasa Indonesia, Indonesian
el: ['Stergios'] # ελληνικά, Greek
ro: [] # limba română, Romanian
vi: ['An Nguyen Hoang Thien'] # Tiếng Việt, Vietnamese
hu: ['ferpeter', 'csuvsaregal', 'atlantisguru', 'Anon', 'kinez', 'bbeasmile'] # magyar, Hungarian
th: ['Kamolchanok Jittrepit'] # ไทย, Thai
da: ['Einar Rasmussen', 'sorsjen', 'Randi Hillerøe', 'Anon', 'Silwing', 'Rahazan', 'marc-portier'] # dansk, Danish
ko: ['Melondonut'] # 한국어, Korean
sk: ['Anon'] # slovenčina, Slovak
sl: [] # slovenščina, Slovene
fi: [] # suomi, Finnish
bg: [] # български език, Bulgarian
no: ['bardeh', 'torehaug'] # Norsk, Norwegian
nn: [] # Norwegian (Nynorsk), Norwegian Nynorsk
nb: [] # Norsk Bokmål, Norwegian (Bokmål)
he: ['OverProgram', 'monetita'] # עברית, Hebrew
lt: [] # lietuvių kalba, Lithuanian
sr: [] # српски, Serbian
uk: ['fess89', 'ImmortalJoker', 'gorodsb', 'endrilian', 'OlenaGapak'] # українська мова, Ukrainian
hi: [] # मानक हिन्दी, Hindi
ur: [] # اُردُو, Urdu
ms: [] # Bahasa Melayu, Bahasa Malaysia
ca: ['ArniMcFrag'] # Català, Catalan
| 208041 | ContributeClassView = require './ContributeClassView'
template = require 'templates/contribute/diplomat'
{me} = require 'lib/auth'
module.exports = class DiplomatView extends ContributeClassView
id: 'diplomat-view'
template: template
contributorClassName: 'diplomat'
getRenderData: ->
context = super()
context.viewName = @viewName
context.user = @user unless @user?.isAnonymous()
context.languageStats = @calculateSpokenLanguageStats()
context
calculateSpokenLanguageStats: ->
@locale ?= require 'locale/locale'
totalStrings = @countStrings @locale.en
languageStats = {}
for languageCode, language of @locale
languageStats[languageCode] =
githubURL: "https://github.com/codecombat/codecombat/blob/master/app/locale/#{languageCode}.coffee"
completion: @countStrings(language) / totalStrings
nativeDescription: language.nativeDescription
englishDescription: language.englishDescription
diplomats: @diplomats[languageCode]
languageCode: languageCode
languageStats
countStrings: (language) ->
translated = 0
for section, strings of language.translation
translated += _.size strings
translated
diplomats:
en: [] # English - English
'en-US': [] # English (US), English (US)
'en-GB': [] # English (UK), English (UK)
'en-AU': [] # English (AU), English (AU)
ru: ['fess89', 'ser-storchak', '<NAME>', 'a1ip', 'iulianR', 'EagleTA', 'kisik21', 'Shpionus', 'kerradus', 'ImmortalJoker'] # русский язык, Russian
'de-DE': ['Dir<NAME>', 'faabs<NAME>', 'HiroP0', '<NAME>', 'bkimminich', 'bahuma20', 'domenukk', 'dkundel', 'djsmith85'] # Deutsch (Deutschland), German (Germany)
'de-AT': ['djsmith85'] # Deutsch (Österreich), German (Austria)
'de-CH': ['greyhusky'] # Deutsch (Schweiz), German (Switzerland)
'es-419': ['<NAME>', '<NAME>', '<NAME>', '2xG', ] # español (América Latina), Spanish (Latin America)
'es-ES': ['<NAME>', '<NAME>', '<NAME>', '<NAME>', '3rr3s3v3n', 'OviiiOne', '<NAME>'] # español (ES), Spanish (Spain)
'zh-HANS': ['<NAME>', 'spacepope', 'yangxuan8282', '<NAME>', 'yfdyh000', 'julycoolwind', 'Vic020', 'onion7878', 'BonnieBBS', '1c7', 'ZephyrSails'] # 简体中文, Chinese (Simplified)
'zh-HANT': ['g<NAME>', '<NAME>'] # 繁体中文, Chinese (Traditional)
'zh-WUU-HANS': [] # 吴语, Wuu (Simplified)
'zh-WUU-HANT': ['benojan'] # 吳語, Wuu (Traditional)
fr: ['<NAME>', '<NAME>', '<NAME>', '<NAME>', 'pstweb', 'veritable', 'jaybi', 'xavismeh', '<NAME>', '<NAME>', 'dc55028', '<NAME>', 'O<NAME>'] # français, French
ja: ['g1itch', 'kengos', 'treby'] # 日本語, Japanese
ar: ['ahmed80dz', '5y'] # العربية, Arabic
'pt-BR': ['<NAME>', '<NAME>', '<NAME>', 'brunoporto', 'c<NAME>', 'Bia41'] # português do Brasil, Portuguese (Brazil)
'pt-PT': ['<NAME>', '<NAME>', 'Imperadeiro98', 'batista', 'ProgramadorLuc<NAME>', 'g<NAME>'] # Português (Portugal), Portuguese (Portugal)
pl: ['<NAME>', '<NAME>', '<NAME>', '<NAME>'] # język polski, Polish
it: ['<NAME>a', '<NAME>'] # italiano, Italian
tr: ['<NAME>', 'cobaimelan', 'wakeup', 'gediz', 'ilisyus'] # Türkçe, Turkish
'nl-BE': ['<NAME>', '<NAME>'] # Nederlands (België), Dutch (Belgium)
'nl-NL': ['<NAME>', '<NAME>'] # Nederlands (Nederland), Dutch (Netherlands)
fa: ['<NAME> (Rehb)'] # فارسی, Persian
cs: ['vanous'] # čeština, Czech
sv: ['iamhj'] # Svenska, Swedish
id: ['mlewisno-oberlin'] # Bahasa Indonesia, Indonesian
el: ['<NAME>'] # ελληνικά, Greek
ro: [] # limba română, Romanian
vi: ['<NAME>'] # Tiếng Việt, Vietnamese
hu: ['<NAME>', 'csuvsaregal', 'atlantisguru', '<NAME>', '<NAME>', '<NAME>'] # magyar, Hungarian
th: ['<NAME>'] # ไทย, Thai
da: ['<NAME>', '<NAME>', '<NAME>', '<NAME>', '<NAME>', '<NAME>', 'marc-portier'] # dansk, Danish
ko: ['<NAME>'] # 한국어, Korean
sk: ['<NAME>'] # slovenčina, Slovak
sl: [] # slovenščina, Slovene
fi: [] # suomi, Finnish
bg: [] # български език, Bulgarian
no: ['bar<NAME>', 'torehaug'] # Norsk, Norwegian
nn: [] # Norwegian (Nynorsk), Norwegian Nynorsk
nb: [] # Norsk Bokmål, Norwegian (Bokmål)
he: ['OverProgram', 'monetita'] # עברית, Hebrew
lt: [] # lietuvių kalba, Lithuanian
sr: [] # српски, Serbian
uk: ['fess89', 'ImmortalJoker', 'gorodsb', 'endrilian', 'OlenaGapak'] # українська мова, Ukrainian
hi: [] # मानक हिन्दी, Hindi
ur: [] # اُردُو, Urdu
ms: [] # Bahasa Melayu, Bahasa Malaysia
ca: ['ArniMcFrag'] # Català, Catalan
| true | ContributeClassView = require './ContributeClassView'
template = require 'templates/contribute/diplomat'
{me} = require 'lib/auth'
module.exports = class DiplomatView extends ContributeClassView
id: 'diplomat-view'
template: template
contributorClassName: 'diplomat'
getRenderData: ->
context = super()
context.viewName = @viewName
context.user = @user unless @user?.isAnonymous()
context.languageStats = @calculateSpokenLanguageStats()
context
calculateSpokenLanguageStats: ->
@locale ?= require 'locale/locale'
totalStrings = @countStrings @locale.en
languageStats = {}
for languageCode, language of @locale
languageStats[languageCode] =
githubURL: "https://github.com/codecombat/codecombat/blob/master/app/locale/#{languageCode}.coffee"
completion: @countStrings(language) / totalStrings
nativeDescription: language.nativeDescription
englishDescription: language.englishDescription
diplomats: @diplomats[languageCode]
languageCode: languageCode
languageStats
countStrings: (language) ->
translated = 0
for section, strings of language.translation
translated += _.size strings
translated
diplomats:
en: [] # English - English
'en-US': [] # English (US), English (US)
'en-GB': [] # English (UK), English (UK)
'en-AU': [] # English (AU), English (AU)
ru: ['fess89', 'ser-storchak', 'PI:NAME:<NAME>END_PI', 'a1ip', 'iulianR', 'EagleTA', 'kisik21', 'Shpionus', 'kerradus', 'ImmortalJoker'] # русский язык, Russian
'de-DE': ['DirPI:NAME:<NAME>END_PI', 'faabsPI:NAME:<NAME>END_PI', 'HiroP0', 'PI:NAME:<NAME>END_PI', 'bkimminich', 'bahuma20', 'domenukk', 'dkundel', 'djsmith85'] # Deutsch (Deutschland), German (Germany)
'de-AT': ['djsmith85'] # Deutsch (Österreich), German (Austria)
'de-CH': ['greyhusky'] # Deutsch (Schweiz), German (Switzerland)
'es-419': ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', '2xG', ] # español (América Latina), Spanish (Latin America)
'es-ES': ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', '3rr3s3v3n', 'OviiiOne', 'PI:NAME:<NAME>END_PI'] # español (ES), Spanish (Spain)
'zh-HANS': ['PI:NAME:<NAME>END_PI', 'spacepope', 'yangxuan8282', 'PI:NAME:<NAME>END_PI', 'yfdyh000', 'julycoolwind', 'Vic020', 'onion7878', 'BonnieBBS', '1c7', 'ZephyrSails'] # 简体中文, Chinese (Simplified)
'zh-HANT': ['gPI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI'] # 繁体中文, Chinese (Traditional)
'zh-WUU-HANS': [] # 吴语, Wuu (Simplified)
'zh-WUU-HANT': ['benojan'] # 吳語, Wuu (Traditional)
fr: ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'pstweb', 'veritable', 'jaybi', 'xavismeh', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'dc55028', 'PI:NAME:<NAME>END_PI', 'OPI:NAME:<NAME>END_PI'] # français, French
ja: ['g1itch', 'kengos', 'treby'] # 日本語, Japanese
ar: ['ahmed80dz', '5y'] # العربية, Arabic
'pt-BR': ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'brunoporto', 'cPI:NAME:<NAME>END_PI', 'Bia41'] # português do Brasil, Portuguese (Brazil)
'pt-PT': ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'Imperadeiro98', 'batista', 'ProgramadorLucPI:NAME:<NAME>END_PI', 'gPI:NAME:<NAME>END_PI'] # Português (Portugal), Portuguese (Portugal)
pl: ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI'] # język polski, Polish
it: ['PI:NAME:<NAME>END_PIa', 'PI:NAME:<NAME>END_PI'] # italiano, Italian
tr: ['PI:NAME:<NAME>END_PI', 'cobaimelan', 'wakeup', 'gediz', 'ilisyus'] # Türkçe, Turkish
'nl-BE': ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI'] # Nederlands (België), Dutch (Belgium)
'nl-NL': ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI'] # Nederlands (Nederland), Dutch (Netherlands)
fa: ['PI:NAME:<NAME>END_PI (Rehb)'] # فارسی, Persian
cs: ['vanous'] # čeština, Czech
sv: ['iamhj'] # Svenska, Swedish
id: ['mlewisno-oberlin'] # Bahasa Indonesia, Indonesian
el: ['PI:NAME:<NAME>END_PI'] # ελληνικά, Greek
ro: [] # limba română, Romanian
vi: ['PI:NAME:<NAME>END_PI'] # Tiếng Việt, Vietnamese
hu: ['PI:NAME:<NAME>END_PI', 'csuvsaregal', 'atlantisguru', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI'] # magyar, Hungarian
th: ['PI:NAME:<NAME>END_PI'] # ไทย, Thai
da: ['PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'PI:NAME:<NAME>END_PI', 'marc-portier'] # dansk, Danish
ko: ['PI:NAME:<NAME>END_PI'] # 한국어, Korean
sk: ['PI:NAME:<NAME>END_PI'] # slovenčina, Slovak
sl: [] # slovenščina, Slovene
fi: [] # suomi, Finnish
bg: [] # български език, Bulgarian
no: ['barPI:NAME:<NAME>END_PI', 'torehaug'] # Norsk, Norwegian
nn: [] # Norwegian (Nynorsk), Norwegian Nynorsk
nb: [] # Norsk Bokmål, Norwegian (Bokmål)
he: ['OverProgram', 'monetita'] # עברית, Hebrew
lt: [] # lietuvių kalba, Lithuanian
sr: [] # српски, Serbian
uk: ['fess89', 'ImmortalJoker', 'gorodsb', 'endrilian', 'OlenaGapak'] # українська мова, Ukrainian
hi: [] # मानक हिन्दी, Hindi
ur: [] # اُردُو, Urdu
ms: [] # Bahasa Melayu, Bahasa Malaysia
ca: ['ArniMcFrag'] # Català, Catalan
|
[
{
"context": "[w / xs, d / zs]\n\n hash = (x, z) =>\n key = \"#{x};#{z}\"\n if hashes[key] isnt undefined then return h",
"end": 1618,
"score": 0.9737202525138855,
"start": 1607,
"tag": "KEY",
"value": "\"#{x};#{z}\""
}
] | jax-engine/lib/assets/javascripts/jax/builtin/meshes/plane.js.coffee | sinisterchipmunk/jax | 24 | ###
Constructs a multi-polygonal flat plane treating the center of
the plane as the origin.
Options:
* width: the width of the plane in units. Defaults to `size`.
* depth: the depth of the plane in units. Defaults to `size`.
* size: a value to use for any of the other dimensional options
if they are unspecified. Defaults to 500.
* xSegments: the number of vertices along the plane's X axis.
Defaults to `segments`.
* zSegments: the numebr of segments along the plane's Z axis.
Defaults to `segments`.
* segments: a value to use for any of the other segment count
* options if they are unspecified. Defaults to 20.
* fn: a function accepting x and z coordinates, which is expected
to return a Y coordinate. By default, Y is always 0, producing
a flat plane.
Examples:
new Jax.Mesh.Plane()
new Jax.Mesh.Plane size: 2
new Jax.Mesh.Plane size: 2, segments: 10
new Jax.Mesh.Plane width: 2, xSegments: 2
###
class Jax.Mesh.Plane extends Jax.Mesh.TriangleStrip
constructor: (options) ->
@fn = (x, z) -> 0
@size = options?.size || 500
@segments = options?.segments || 20
@width = @depth = @size
@xSegments = @zSegments = @segments
super options
init: (verts, colors, texes, norms, indices) ->
# we don't calculate normals here so that Jax can auto calculate
# them later, ensuring that they are correct for custom Y values
hashes = {}
[w, d, xs, zs] = [@width, @depth, @xSegments, @zSegments]
[xUnit, zUnit] = [w / xs, d / zs]
hash = (x, z) =>
key = "#{x};#{z}"
if hashes[key] isnt undefined then return hashes[key]
else
vx = xUnit * x - w / 2
vz = zUnit * z - d / 2
vy = @fn x, z
index = verts.length / 3
verts.push vx, vz, vy
texes.push x / (xs-1), z / (zs-1)
hashes[key] = index
for x in [1...xs] by 2
for z in [0...zs]
indices.push hash x , z
indices.push hash x - 1, z
x++
for z in [(zs-1)..0]
indices.push hash x - 1, z
indices.push hash x , z
true # don't return an array, it's faster this way
| 155939 | ###
Constructs a multi-polygonal flat plane treating the center of
the plane as the origin.
Options:
* width: the width of the plane in units. Defaults to `size`.
* depth: the depth of the plane in units. Defaults to `size`.
* size: a value to use for any of the other dimensional options
if they are unspecified. Defaults to 500.
* xSegments: the number of vertices along the plane's X axis.
Defaults to `segments`.
* zSegments: the numebr of segments along the plane's Z axis.
Defaults to `segments`.
* segments: a value to use for any of the other segment count
* options if they are unspecified. Defaults to 20.
* fn: a function accepting x and z coordinates, which is expected
to return a Y coordinate. By default, Y is always 0, producing
a flat plane.
Examples:
new Jax.Mesh.Plane()
new Jax.Mesh.Plane size: 2
new Jax.Mesh.Plane size: 2, segments: 10
new Jax.Mesh.Plane width: 2, xSegments: 2
###
class Jax.Mesh.Plane extends Jax.Mesh.TriangleStrip
constructor: (options) ->
@fn = (x, z) -> 0
@size = options?.size || 500
@segments = options?.segments || 20
@width = @depth = @size
@xSegments = @zSegments = @segments
super options
init: (verts, colors, texes, norms, indices) ->
# we don't calculate normals here so that Jax can auto calculate
# them later, ensuring that they are correct for custom Y values
hashes = {}
[w, d, xs, zs] = [@width, @depth, @xSegments, @zSegments]
[xUnit, zUnit] = [w / xs, d / zs]
hash = (x, z) =>
key = <KEY>
if hashes[key] isnt undefined then return hashes[key]
else
vx = xUnit * x - w / 2
vz = zUnit * z - d / 2
vy = @fn x, z
index = verts.length / 3
verts.push vx, vz, vy
texes.push x / (xs-1), z / (zs-1)
hashes[key] = index
for x in [1...xs] by 2
for z in [0...zs]
indices.push hash x , z
indices.push hash x - 1, z
x++
for z in [(zs-1)..0]
indices.push hash x - 1, z
indices.push hash x , z
true # don't return an array, it's faster this way
| true | ###
Constructs a multi-polygonal flat plane treating the center of
the plane as the origin.
Options:
* width: the width of the plane in units. Defaults to `size`.
* depth: the depth of the plane in units. Defaults to `size`.
* size: a value to use for any of the other dimensional options
if they are unspecified. Defaults to 500.
* xSegments: the number of vertices along the plane's X axis.
Defaults to `segments`.
* zSegments: the numebr of segments along the plane's Z axis.
Defaults to `segments`.
* segments: a value to use for any of the other segment count
* options if they are unspecified. Defaults to 20.
* fn: a function accepting x and z coordinates, which is expected
to return a Y coordinate. By default, Y is always 0, producing
a flat plane.
Examples:
new Jax.Mesh.Plane()
new Jax.Mesh.Plane size: 2
new Jax.Mesh.Plane size: 2, segments: 10
new Jax.Mesh.Plane width: 2, xSegments: 2
###
class Jax.Mesh.Plane extends Jax.Mesh.TriangleStrip
constructor: (options) ->
@fn = (x, z) -> 0
@size = options?.size || 500
@segments = options?.segments || 20
@width = @depth = @size
@xSegments = @zSegments = @segments
super options
init: (verts, colors, texes, norms, indices) ->
# we don't calculate normals here so that Jax can auto calculate
# them later, ensuring that they are correct for custom Y values
hashes = {}
[w, d, xs, zs] = [@width, @depth, @xSegments, @zSegments]
[xUnit, zUnit] = [w / xs, d / zs]
hash = (x, z) =>
key = PI:KEY:<KEY>END_PI
if hashes[key] isnt undefined then return hashes[key]
else
vx = xUnit * x - w / 2
vz = zUnit * z - d / 2
vy = @fn x, z
index = verts.length / 3
verts.push vx, vz, vy
texes.push x / (xs-1), z / (zs-1)
hashes[key] = index
for x in [1...xs] by 2
for z in [0...zs]
indices.push hash x , z
indices.push hash x - 1, z
x++
for z in [(zs-1)..0]
indices.push hash x - 1, z
indices.push hash x , z
true # don't return an array, it's faster this way
|
[
{
"context": "f built-in anode configuration assert\n#\n# (C) 2011 Tristan Slominski\n#\nanode = require '../lib/anode'\n\ncnf = new anode",
"end": 108,
"score": 0.9996916055679321,
"start": 91,
"tag": "NAME",
"value": "Tristan Slominski"
}
] | examples/assert.example.coffee | tristanls/anodejs | 3 | #
# assert.example.coffee : an example of built-in anode configuration assert
#
# (C) 2011 Tristan Slominski
#
anode = require '../lib/anode'
cnf = new anode.Configuration debug : true
thrower = ->
throw new Error( 'error' )
ack = cnf.actor 'ack actor', anode.beh(
'assert, #throws' : ->
@send( '#throws assertion passed' ).to cnf.console.log
# now assert something that will break
@send( @, @_, '#ok', false ).to cnf.assert
)()
cnf.send( ack, null, '#throws', thrower ).to cnf.assert | 90452 | #
# assert.example.coffee : an example of built-in anode configuration assert
#
# (C) 2011 <NAME>
#
anode = require '../lib/anode'
cnf = new anode.Configuration debug : true
thrower = ->
throw new Error( 'error' )
ack = cnf.actor 'ack actor', anode.beh(
'assert, #throws' : ->
@send( '#throws assertion passed' ).to cnf.console.log
# now assert something that will break
@send( @, @_, '#ok', false ).to cnf.assert
)()
cnf.send( ack, null, '#throws', thrower ).to cnf.assert | true | #
# assert.example.coffee : an example of built-in anode configuration assert
#
# (C) 2011 PI:NAME:<NAME>END_PI
#
anode = require '../lib/anode'
cnf = new anode.Configuration debug : true
thrower = ->
throw new Error( 'error' )
ack = cnf.actor 'ack actor', anode.beh(
'assert, #throws' : ->
@send( '#throws assertion passed' ).to cnf.console.log
# now assert something that will break
@send( @, @_, '#ok', false ).to cnf.assert
)()
cnf.send( ack, null, '#throws', thrower ).to cnf.assert |
[
{
"context": "ttrs.macTagAutocompleteValue\n valueKey ?= \"id\"\n valueGetter = $parse valueKey\n\n label",
"end": 3317,
"score": 0.5903864502906799,
"start": 3315,
"tag": "KEY",
"value": "id"
}
] | src/directives/tag_autocomplete.coffee | Benzinga/MacGyver | 0 | ###
@chalk overview
@name Tag Autocomplete
@description
A directive for generating tag input with autocomplete support on text input.
Tag autocomplete has priority 800
@dependencies
- mac-autocomplete
- mac-menu
@param {String} mac-tag-autocomplete-url Url to fetch autocomplete dropdown list data.
mac-tag-autocomplete-url and mac-tag-autocomplete-source cannot be used together. Url
will always take priority over mac-tag-autocomplete-source.
@param {String} mac-tag-autocomplete-source Data to use.
Source support multiple types:
- Array: An array can be used for local data and there are two supported formats:
- An array of strings: ["Item1", "Item2"]
- An array of objects with mac-autocomplete-label key: [{name:"Item1"}, {name:"Item2"}]
- String: Using a string as the source is the same as passing the variable into mac-autocomplete-url
- Function: A callback when querying for data. The callback receive two arguments:
- {String} Value currently in the text input
- {Function} A response callback which expects a single argument, data to user. The data will be
populated on the menu and the menu will adjust accordingly
@param {String} mac-tag-autocomplete-value The value to be sent back upon selection (default "id")
@param {String} mac-tag-autocomplete-label The label to display to the users (default "name")
@param {Expr} mac-tag-autocomplete-model Model for autocomplete
@param {Array} mac-tag-autocomplete-selected The list of elements selected by the user (required)
@param {String} mac-tag-autocomplete-query The query parameter on GET command (defualt "q")
@param {Integer} mac-tag-autocomplete-delay Time delayed on fetching autocomplete data after keyup (default 800)
@param {String} mac-tag-autocomplete-placeholder Placeholder text of the text input (default "")
@param {Boolean} mac-tag-autocomplete-disabled If autocomplete is enabled or disabled (default false)
@param {Expr} mac-tag-autocomplete-on-enter When autocomplete is disabled, this function is called on enter, Should return either string, object or boolean. If false, item is not added
- `item` - {String} User input
@param {String} mac-tag-autocomplete-events A CSV list of events to attach functions to
@param {Expr} mac-tag-autocomplete-on- Function to be called when specified event is fired
- `event` - {Object} jQuery event
- `value` - {String} Value in the input text
@param {Event} mac-tag-autocomplete-clear-input $broadcast message; clears text input when received
###
angular.module("Mac").directive "macTagAutocomplete", [
"$parse"
"$timeout"
"keys"
"util"
($parse, $timeout, keys, util) ->
restrict: "E"
templateUrl: "template/tag_autocomplete.html"
replace: true
priority: 800
scope:
url: "=macTagAutocompleteUrl"
placeholder: "=macTagAutocompletePlaceholder"
selected: "=macTagAutocompleteSelected"
source: "=macTagAutocompleteSource"
disabled: "=macTagAutocompleteDisabled"
model: "=macTagAutocompleteModel"
onEnter: "&macTagAutocompleteOnEnter"
onKeydown: "&macTagAutocompleteOnKeydown"
compile: (element, attrs) ->
valueKey = attrs.macTagAutocompleteValue
valueKey ?= "id"
valueGetter = $parse valueKey
labelKey = attrs.macTagAutocompleteLabel
labelKey ?= "name"
labelGetter = $parse labelKey
queryKey = attrs.macTagAutocompleteQuery or "q"
delay = +attrs.macTagAutocompleteDelay or 800
useSource = false
textInput =
angular.element(element[0].getElementsByClassName "mac-autocomplete")
attrsObject =
"mac-autocomplete-label": labelKey
"mac-autocomplete-query": queryKey
"mac-autocomplete-delay": delay
if attrs.macTagAutocompleteUrl?
attrsObject["mac-autocomplete-url"] = "url"
else if useSource = attrs.macTagAutocompleteSource?
attrsObject["mac-autocomplete-source"] = "autocompleteSource"
textInput.attr attrsObject
($scope, element, attrs) ->
# Variable for input element
$scope.textInput = ""
$scope.autocompleteSource =
if angular.isArray($scope.source) then [] else $scope.source
# NOTE: Proxy is created to prevent tag autocomplete from breaking
# when user did not specify model
if attrs.macTagAutocompleteModel?
$scope.$watch "textInput", (value) -> $scope.model = value
$scope.$watch "model", (value) -> $scope.textInput = value
# Clicking on the element will focus on input
$scope.focusTextInput = ->
textInputDOM = element[0].getElementsByClassName "mac-autocomplete"
textInputDOM[0].focus()
$scope.getTagLabel = (tag) -> if labelKey then labelGetter(tag) else tag
# Loop through the list of events user specified
# NOTE: Timeout is added to make sure the autocomplete directive
# has been run and converted the custom tag to input tag
$timeout ->
if (events = attrs.macTagAutocompleteEvents)
textInput =
angular.element(element[0].getElementsByClassName "text-input")
for name in events.split(",")
name = util.trim name
capitalized = util.capitalize name
eventFn = attrs["macTagAutocompleteOn#{capitalized}"]
continue unless eventFn and name isnt "keydown"
do (name, eventFn) ->
textInput.bind name, ($event) ->
expression = $parse eventFn
$scope.$apply ->
expression $scope.$parent, {$event, item: $scope.textInput}
, 0, false
updateAutocompleteSource = ->
$scope.autocompletePlaceholder =
if $scope.selected?.length then "" else $scope.placeholder
unless useSource and angular.isArray($scope.source)
$scope.autocompleteSource = $scope.source
return
sourceValues = (valueGetter(item) for item in ($scope.source or []))
selectedValues = (valueGetter(item) for item in ($scope.selected or []))
difference = (item for item in sourceValues when item not in selectedValues)
$scope.autocompleteSource =
(item for item in ($scope.source or []) when valueGetter(item) in difference)
if useSource
# NOTE: Watcher on source is added for string and function type to make sure
# scope value is copied correctly into this scope
watchFn = if angular.isArray($scope.source) then "$watchCollection" else "$watch"
$scope[watchFn] "source", updateAutocompleteSource
$scope.$watchCollection "selected", updateAutocompleteSource
$scope.onKeyDown = ($event) ->
stroke = $event.which or $event.keyCode
switch stroke
when keys.BACKSPACE
$scope.selected.pop?() unless $scope.textInput
when keys.ENTER
# Used when autocomplete is not needed
if $scope.textInput.length > 0 and $scope.disabled
$scope.onSelect $scope.textInput
if attrs.macTagAutocompleteOnKeydown?
$scope.onKeydown? {$event, value: $scope.textInput}
return true
$scope.onSuccess = (data) ->
# get all selected values
existingValues = (valueGetter(item) for item in ($scope.selected or []))
# remove selected tags on autocomplete dropdown
return (item for item in data.data when (valueGetter(item) or item) not in existingValues)
$scope.onSelect = (item) ->
if attrs.macTagAutocompleteOnEnter?
item = $scope.onEnter {item}
$scope.selected.push item if item
# NOTE: $timeout is added to allow user to access the model before
# clearing value in autocomplete
$timeout ->
$scope.textInput = ""
, 0
$scope.$on "mac-tag-autocomplete-clear-input", ->
$scope.textInput = ""
]
| 939 | ###
@chalk overview
@name Tag Autocomplete
@description
A directive for generating tag input with autocomplete support on text input.
Tag autocomplete has priority 800
@dependencies
- mac-autocomplete
- mac-menu
@param {String} mac-tag-autocomplete-url Url to fetch autocomplete dropdown list data.
mac-tag-autocomplete-url and mac-tag-autocomplete-source cannot be used together. Url
will always take priority over mac-tag-autocomplete-source.
@param {String} mac-tag-autocomplete-source Data to use.
Source support multiple types:
- Array: An array can be used for local data and there are two supported formats:
- An array of strings: ["Item1", "Item2"]
- An array of objects with mac-autocomplete-label key: [{name:"Item1"}, {name:"Item2"}]
- String: Using a string as the source is the same as passing the variable into mac-autocomplete-url
- Function: A callback when querying for data. The callback receive two arguments:
- {String} Value currently in the text input
- {Function} A response callback which expects a single argument, data to user. The data will be
populated on the menu and the menu will adjust accordingly
@param {String} mac-tag-autocomplete-value The value to be sent back upon selection (default "id")
@param {String} mac-tag-autocomplete-label The label to display to the users (default "name")
@param {Expr} mac-tag-autocomplete-model Model for autocomplete
@param {Array} mac-tag-autocomplete-selected The list of elements selected by the user (required)
@param {String} mac-tag-autocomplete-query The query parameter on GET command (defualt "q")
@param {Integer} mac-tag-autocomplete-delay Time delayed on fetching autocomplete data after keyup (default 800)
@param {String} mac-tag-autocomplete-placeholder Placeholder text of the text input (default "")
@param {Boolean} mac-tag-autocomplete-disabled If autocomplete is enabled or disabled (default false)
@param {Expr} mac-tag-autocomplete-on-enter When autocomplete is disabled, this function is called on enter, Should return either string, object or boolean. If false, item is not added
- `item` - {String} User input
@param {String} mac-tag-autocomplete-events A CSV list of events to attach functions to
@param {Expr} mac-tag-autocomplete-on- Function to be called when specified event is fired
- `event` - {Object} jQuery event
- `value` - {String} Value in the input text
@param {Event} mac-tag-autocomplete-clear-input $broadcast message; clears text input when received
###
angular.module("Mac").directive "macTagAutocomplete", [
"$parse"
"$timeout"
"keys"
"util"
($parse, $timeout, keys, util) ->
restrict: "E"
templateUrl: "template/tag_autocomplete.html"
replace: true
priority: 800
scope:
url: "=macTagAutocompleteUrl"
placeholder: "=macTagAutocompletePlaceholder"
selected: "=macTagAutocompleteSelected"
source: "=macTagAutocompleteSource"
disabled: "=macTagAutocompleteDisabled"
model: "=macTagAutocompleteModel"
onEnter: "&macTagAutocompleteOnEnter"
onKeydown: "&macTagAutocompleteOnKeydown"
compile: (element, attrs) ->
valueKey = attrs.macTagAutocompleteValue
valueKey ?= "<KEY>"
valueGetter = $parse valueKey
labelKey = attrs.macTagAutocompleteLabel
labelKey ?= "name"
labelGetter = $parse labelKey
queryKey = attrs.macTagAutocompleteQuery or "q"
delay = +attrs.macTagAutocompleteDelay or 800
useSource = false
textInput =
angular.element(element[0].getElementsByClassName "mac-autocomplete")
attrsObject =
"mac-autocomplete-label": labelKey
"mac-autocomplete-query": queryKey
"mac-autocomplete-delay": delay
if attrs.macTagAutocompleteUrl?
attrsObject["mac-autocomplete-url"] = "url"
else if useSource = attrs.macTagAutocompleteSource?
attrsObject["mac-autocomplete-source"] = "autocompleteSource"
textInput.attr attrsObject
($scope, element, attrs) ->
# Variable for input element
$scope.textInput = ""
$scope.autocompleteSource =
if angular.isArray($scope.source) then [] else $scope.source
# NOTE: Proxy is created to prevent tag autocomplete from breaking
# when user did not specify model
if attrs.macTagAutocompleteModel?
$scope.$watch "textInput", (value) -> $scope.model = value
$scope.$watch "model", (value) -> $scope.textInput = value
# Clicking on the element will focus on input
$scope.focusTextInput = ->
textInputDOM = element[0].getElementsByClassName "mac-autocomplete"
textInputDOM[0].focus()
$scope.getTagLabel = (tag) -> if labelKey then labelGetter(tag) else tag
# Loop through the list of events user specified
# NOTE: Timeout is added to make sure the autocomplete directive
# has been run and converted the custom tag to input tag
$timeout ->
if (events = attrs.macTagAutocompleteEvents)
textInput =
angular.element(element[0].getElementsByClassName "text-input")
for name in events.split(",")
name = util.trim name
capitalized = util.capitalize name
eventFn = attrs["macTagAutocompleteOn#{capitalized}"]
continue unless eventFn and name isnt "keydown"
do (name, eventFn) ->
textInput.bind name, ($event) ->
expression = $parse eventFn
$scope.$apply ->
expression $scope.$parent, {$event, item: $scope.textInput}
, 0, false
updateAutocompleteSource = ->
$scope.autocompletePlaceholder =
if $scope.selected?.length then "" else $scope.placeholder
unless useSource and angular.isArray($scope.source)
$scope.autocompleteSource = $scope.source
return
sourceValues = (valueGetter(item) for item in ($scope.source or []))
selectedValues = (valueGetter(item) for item in ($scope.selected or []))
difference = (item for item in sourceValues when item not in selectedValues)
$scope.autocompleteSource =
(item for item in ($scope.source or []) when valueGetter(item) in difference)
if useSource
# NOTE: Watcher on source is added for string and function type to make sure
# scope value is copied correctly into this scope
watchFn = if angular.isArray($scope.source) then "$watchCollection" else "$watch"
$scope[watchFn] "source", updateAutocompleteSource
$scope.$watchCollection "selected", updateAutocompleteSource
$scope.onKeyDown = ($event) ->
stroke = $event.which or $event.keyCode
switch stroke
when keys.BACKSPACE
$scope.selected.pop?() unless $scope.textInput
when keys.ENTER
# Used when autocomplete is not needed
if $scope.textInput.length > 0 and $scope.disabled
$scope.onSelect $scope.textInput
if attrs.macTagAutocompleteOnKeydown?
$scope.onKeydown? {$event, value: $scope.textInput}
return true
$scope.onSuccess = (data) ->
# get all selected values
existingValues = (valueGetter(item) for item in ($scope.selected or []))
# remove selected tags on autocomplete dropdown
return (item for item in data.data when (valueGetter(item) or item) not in existingValues)
$scope.onSelect = (item) ->
if attrs.macTagAutocompleteOnEnter?
item = $scope.onEnter {item}
$scope.selected.push item if item
# NOTE: $timeout is added to allow user to access the model before
# clearing value in autocomplete
$timeout ->
$scope.textInput = ""
, 0
$scope.$on "mac-tag-autocomplete-clear-input", ->
$scope.textInput = ""
]
| true | ###
@chalk overview
@name Tag Autocomplete
@description
A directive for generating tag input with autocomplete support on text input.
Tag autocomplete has priority 800
@dependencies
- mac-autocomplete
- mac-menu
@param {String} mac-tag-autocomplete-url Url to fetch autocomplete dropdown list data.
mac-tag-autocomplete-url and mac-tag-autocomplete-source cannot be used together. Url
will always take priority over mac-tag-autocomplete-source.
@param {String} mac-tag-autocomplete-source Data to use.
Source support multiple types:
- Array: An array can be used for local data and there are two supported formats:
- An array of strings: ["Item1", "Item2"]
- An array of objects with mac-autocomplete-label key: [{name:"Item1"}, {name:"Item2"}]
- String: Using a string as the source is the same as passing the variable into mac-autocomplete-url
- Function: A callback when querying for data. The callback receive two arguments:
- {String} Value currently in the text input
- {Function} A response callback which expects a single argument, data to user. The data will be
populated on the menu and the menu will adjust accordingly
@param {String} mac-tag-autocomplete-value The value to be sent back upon selection (default "id")
@param {String} mac-tag-autocomplete-label The label to display to the users (default "name")
@param {Expr} mac-tag-autocomplete-model Model for autocomplete
@param {Array} mac-tag-autocomplete-selected The list of elements selected by the user (required)
@param {String} mac-tag-autocomplete-query The query parameter on GET command (defualt "q")
@param {Integer} mac-tag-autocomplete-delay Time delayed on fetching autocomplete data after keyup (default 800)
@param {String} mac-tag-autocomplete-placeholder Placeholder text of the text input (default "")
@param {Boolean} mac-tag-autocomplete-disabled If autocomplete is enabled or disabled (default false)
@param {Expr} mac-tag-autocomplete-on-enter When autocomplete is disabled, this function is called on enter, Should return either string, object or boolean. If false, item is not added
- `item` - {String} User input
@param {String} mac-tag-autocomplete-events A CSV list of events to attach functions to
@param {Expr} mac-tag-autocomplete-on- Function to be called when specified event is fired
- `event` - {Object} jQuery event
- `value` - {String} Value in the input text
@param {Event} mac-tag-autocomplete-clear-input $broadcast message; clears text input when received
###
angular.module("Mac").directive "macTagAutocomplete", [
"$parse"
"$timeout"
"keys"
"util"
($parse, $timeout, keys, util) ->
restrict: "E"
templateUrl: "template/tag_autocomplete.html"
replace: true
priority: 800
scope:
url: "=macTagAutocompleteUrl"
placeholder: "=macTagAutocompletePlaceholder"
selected: "=macTagAutocompleteSelected"
source: "=macTagAutocompleteSource"
disabled: "=macTagAutocompleteDisabled"
model: "=macTagAutocompleteModel"
onEnter: "&macTagAutocompleteOnEnter"
onKeydown: "&macTagAutocompleteOnKeydown"
compile: (element, attrs) ->
valueKey = attrs.macTagAutocompleteValue
valueKey ?= "PI:KEY:<KEY>END_PI"
valueGetter = $parse valueKey
labelKey = attrs.macTagAutocompleteLabel
labelKey ?= "name"
labelGetter = $parse labelKey
queryKey = attrs.macTagAutocompleteQuery or "q"
delay = +attrs.macTagAutocompleteDelay or 800
useSource = false
textInput =
angular.element(element[0].getElementsByClassName "mac-autocomplete")
attrsObject =
"mac-autocomplete-label": labelKey
"mac-autocomplete-query": queryKey
"mac-autocomplete-delay": delay
if attrs.macTagAutocompleteUrl?
attrsObject["mac-autocomplete-url"] = "url"
else if useSource = attrs.macTagAutocompleteSource?
attrsObject["mac-autocomplete-source"] = "autocompleteSource"
textInput.attr attrsObject
($scope, element, attrs) ->
# Variable for input element
$scope.textInput = ""
$scope.autocompleteSource =
if angular.isArray($scope.source) then [] else $scope.source
# NOTE: Proxy is created to prevent tag autocomplete from breaking
# when user did not specify model
if attrs.macTagAutocompleteModel?
$scope.$watch "textInput", (value) -> $scope.model = value
$scope.$watch "model", (value) -> $scope.textInput = value
# Clicking on the element will focus on input
$scope.focusTextInput = ->
textInputDOM = element[0].getElementsByClassName "mac-autocomplete"
textInputDOM[0].focus()
$scope.getTagLabel = (tag) -> if labelKey then labelGetter(tag) else tag
# Loop through the list of events user specified
# NOTE: Timeout is added to make sure the autocomplete directive
# has been run and converted the custom tag to input tag
$timeout ->
if (events = attrs.macTagAutocompleteEvents)
textInput =
angular.element(element[0].getElementsByClassName "text-input")
for name in events.split(",")
name = util.trim name
capitalized = util.capitalize name
eventFn = attrs["macTagAutocompleteOn#{capitalized}"]
continue unless eventFn and name isnt "keydown"
do (name, eventFn) ->
textInput.bind name, ($event) ->
expression = $parse eventFn
$scope.$apply ->
expression $scope.$parent, {$event, item: $scope.textInput}
, 0, false
updateAutocompleteSource = ->
$scope.autocompletePlaceholder =
if $scope.selected?.length then "" else $scope.placeholder
unless useSource and angular.isArray($scope.source)
$scope.autocompleteSource = $scope.source
return
sourceValues = (valueGetter(item) for item in ($scope.source or []))
selectedValues = (valueGetter(item) for item in ($scope.selected or []))
difference = (item for item in sourceValues when item not in selectedValues)
$scope.autocompleteSource =
(item for item in ($scope.source or []) when valueGetter(item) in difference)
if useSource
# NOTE: Watcher on source is added for string and function type to make sure
# scope value is copied correctly into this scope
watchFn = if angular.isArray($scope.source) then "$watchCollection" else "$watch"
$scope[watchFn] "source", updateAutocompleteSource
$scope.$watchCollection "selected", updateAutocompleteSource
$scope.onKeyDown = ($event) ->
stroke = $event.which or $event.keyCode
switch stroke
when keys.BACKSPACE
$scope.selected.pop?() unless $scope.textInput
when keys.ENTER
# Used when autocomplete is not needed
if $scope.textInput.length > 0 and $scope.disabled
$scope.onSelect $scope.textInput
if attrs.macTagAutocompleteOnKeydown?
$scope.onKeydown? {$event, value: $scope.textInput}
return true
$scope.onSuccess = (data) ->
# get all selected values
existingValues = (valueGetter(item) for item in ($scope.selected or []))
# remove selected tags on autocomplete dropdown
return (item for item in data.data when (valueGetter(item) or item) not in existingValues)
$scope.onSelect = (item) ->
if attrs.macTagAutocompleteOnEnter?
item = $scope.onEnter {item}
$scope.selected.push item if item
# NOTE: $timeout is added to allow user to access the model before
# clearing value in autocomplete
$timeout ->
$scope.textInput = ""
, 0
$scope.$on "mac-tag-autocomplete-clear-input", ->
$scope.textInput = ""
]
|
[
{
"context": "arding: true\n @state.stepKey().should.equal 'existing_2'\n @state.set current_level: 1, reonboarding:",
"end": 409,
"score": 0.7558276653289795,
"start": 399,
"tag": "KEY",
"value": "existing_2"
},
{
"context": "rding: false\n @state.stepKey().should.equ... | src/desktop/apps/artsy_primer/personalize/test/client/state.coffee | kanaabe/force | 0 | _ = require 'underscore'
CurrentUser = require '../../../../../models/current_user'
PersonalizeState = require '../../client/state'
describe 'state', ->
beforeEach ->
@user = new CurrentUser
@state = new PersonalizeState user: @user
describe '#stepKey', ->
it 'returns the correct key', ->
@state.set current_level: 2, reonboarding: true
@state.stepKey().should.equal 'existing_2'
@state.set current_level: 1, reonboarding: false
@state.stepKey().should.equal 'new_1'
@state.set current_level: 3
@state.unset 'reonboarding'
@state.stepKey().should.equal 'new_3'
describe '#completedSteps', ->
describe 'returns an array of steps that have already been completed', ->
beforeEach ->
# Kill memoization
@state.__completedSteps__ = null
it 'is empty by default', ->
@state.completedSteps().should.be.empty
it 'doesnt skip when the price range is the default returned by the server', ->
@user.set price_range: '-1:1000000000000'
@state.completedSteps().should.be.empty
it 'memoizes the value so that it is unaffected by user state modifications', ->
@state.completedSteps().should.be.empty
@user.set collector_level: 2
@state.completedSteps().should.be.empty
describe '#steps', ->
it 'reflects the actual state of the steps the collector user who has a semi-complete profile needs to complete on initialization', ->
@state.__completedSteps__ = null
@state.set current_level: 2
@user.set collector_level: 2
@state.steps().should.eql _.without(@state.get('__steps__')['new_2'], 'collect')
describe '#currentStepIndex', ->
it 'returns the appropriate index', ->
@state.currentStepIndex().should.equal 0
@state.next()
@state.currentStepIndex().should.equal 1
describe '#currentStepLabel', ->
it 'humanizes and capitalizes the step name', ->
@state.set current_step: 'price_range'
@state.currentStepLabel().should.equal 'Price Range'
@state.set current_step: 'artists'
@state.currentStepLabel().should.equal 'Artists'
describe '#stepDisplay', ->
it 'displays a human readable step count', ->
@state.stepDisplay().should.equal "Step 1 of #{@state.steps().length}"
@state.next()
@state.stepDisplay().should.equal "Step 2 of #{@state.steps().length}"
describe '#almostDone', ->
it 'lets you know if you are on the last step', ->
@state.almostDone().should.not.be.ok()
last_step = _.last @state.steps()
@state.set current_step: last_step
@state.almostDone().should.be.ok()
describe '#next', ->
beforeEach ->
@last_step = _.last @state.steps()
@state.set current_step: @last_step
it 'should not be able to step past the last step', ->
@state.next()
@state.get('current_step').should.equal @last_step
it 'triggers done', (done) ->
@state.on 'done', done
@state.next()
@state.off 'done'
| 70319 | _ = require 'underscore'
CurrentUser = require '../../../../../models/current_user'
PersonalizeState = require '../../client/state'
describe 'state', ->
beforeEach ->
@user = new CurrentUser
@state = new PersonalizeState user: @user
describe '#stepKey', ->
it 'returns the correct key', ->
@state.set current_level: 2, reonboarding: true
@state.stepKey().should.equal '<KEY>'
@state.set current_level: 1, reonboarding: false
@state.stepKey().should.equal '<KEY>'
@state.set current_level: 3
@state.unset 'reonboarding'
@state.stepKey().should.equal '<KEY>'
describe '#completedSteps', ->
describe 'returns an array of steps that have already been completed', ->
beforeEach ->
# Kill memoization
@state.__completedSteps__ = null
it 'is empty by default', ->
@state.completedSteps().should.be.empty
it 'doesnt skip when the price range is the default returned by the server', ->
@user.set price_range: '-1:1000000000000'
@state.completedSteps().should.be.empty
it 'memoizes the value so that it is unaffected by user state modifications', ->
@state.completedSteps().should.be.empty
@user.set collector_level: 2
@state.completedSteps().should.be.empty
describe '#steps', ->
it 'reflects the actual state of the steps the collector user who has a semi-complete profile needs to complete on initialization', ->
@state.__completedSteps__ = null
@state.set current_level: 2
@user.set collector_level: 2
@state.steps().should.eql _.without(@state.get('__steps__')['new_2'], 'collect')
describe '#currentStepIndex', ->
it 'returns the appropriate index', ->
@state.currentStepIndex().should.equal 0
@state.next()
@state.currentStepIndex().should.equal 1
describe '#currentStepLabel', ->
it 'humanizes and capitalizes the step name', ->
@state.set current_step: 'price_range'
@state.currentStepLabel().should.equal 'Price Range'
@state.set current_step: 'artists'
@state.currentStepLabel().should.equal 'Artists'
describe '#stepDisplay', ->
it 'displays a human readable step count', ->
@state.stepDisplay().should.equal "Step 1 of #{@state.steps().length}"
@state.next()
@state.stepDisplay().should.equal "Step 2 of #{@state.steps().length}"
describe '#almostDone', ->
it 'lets you know if you are on the last step', ->
@state.almostDone().should.not.be.ok()
last_step = _.last @state.steps()
@state.set current_step: last_step
@state.almostDone().should.be.ok()
describe '#next', ->
beforeEach ->
@last_step = _.last @state.steps()
@state.set current_step: @last_step
it 'should not be able to step past the last step', ->
@state.next()
@state.get('current_step').should.equal @last_step
it 'triggers done', (done) ->
@state.on 'done', done
@state.next()
@state.off 'done'
| true | _ = require 'underscore'
CurrentUser = require '../../../../../models/current_user'
PersonalizeState = require '../../client/state'
describe 'state', ->
beforeEach ->
@user = new CurrentUser
@state = new PersonalizeState user: @user
describe '#stepKey', ->
it 'returns the correct key', ->
@state.set current_level: 2, reonboarding: true
@state.stepKey().should.equal 'PI:KEY:<KEY>END_PI'
@state.set current_level: 1, reonboarding: false
@state.stepKey().should.equal 'PI:KEY:<KEY>END_PI'
@state.set current_level: 3
@state.unset 'reonboarding'
@state.stepKey().should.equal 'PI:KEY:<KEY>END_PI'
describe '#completedSteps', ->
describe 'returns an array of steps that have already been completed', ->
beforeEach ->
# Kill memoization
@state.__completedSteps__ = null
it 'is empty by default', ->
@state.completedSteps().should.be.empty
it 'doesnt skip when the price range is the default returned by the server', ->
@user.set price_range: '-1:1000000000000'
@state.completedSteps().should.be.empty
it 'memoizes the value so that it is unaffected by user state modifications', ->
@state.completedSteps().should.be.empty
@user.set collector_level: 2
@state.completedSteps().should.be.empty
describe '#steps', ->
it 'reflects the actual state of the steps the collector user who has a semi-complete profile needs to complete on initialization', ->
@state.__completedSteps__ = null
@state.set current_level: 2
@user.set collector_level: 2
@state.steps().should.eql _.without(@state.get('__steps__')['new_2'], 'collect')
describe '#currentStepIndex', ->
it 'returns the appropriate index', ->
@state.currentStepIndex().should.equal 0
@state.next()
@state.currentStepIndex().should.equal 1
describe '#currentStepLabel', ->
it 'humanizes and capitalizes the step name', ->
@state.set current_step: 'price_range'
@state.currentStepLabel().should.equal 'Price Range'
@state.set current_step: 'artists'
@state.currentStepLabel().should.equal 'Artists'
describe '#stepDisplay', ->
it 'displays a human readable step count', ->
@state.stepDisplay().should.equal "Step 1 of #{@state.steps().length}"
@state.next()
@state.stepDisplay().should.equal "Step 2 of #{@state.steps().length}"
describe '#almostDone', ->
it 'lets you know if you are on the last step', ->
@state.almostDone().should.not.be.ok()
last_step = _.last @state.steps()
@state.set current_step: last_step
@state.almostDone().should.be.ok()
describe '#next', ->
beforeEach ->
@last_step = _.last @state.steps()
@state.set current_step: @last_step
it 'should not be able to step past the last step', ->
@state.next()
@state.get('current_step').should.equal @last_step
it 'triggers done', (done) ->
@state.on 'done', done
@state.next()
@state.off 'done'
|
[
{
"context": "Mocha-cakes Reference ========\nhttps://github.com/quangv/mocha-cakes\nhttps://github.com/visionmedia/should",
"end": 232,
"score": 0.9996196627616882,
"start": 226,
"tag": "USERNAME",
"value": "quangv"
},
{
"context": "/github.com/quangv/mocha-cakes\nhttps://github.com... | src/test/nest_spec.coffee | NicMcPhee/whooping-crane-model | 0 | 'use strict'
require 'mocha-cakes'
ModelParameters = require '../lib/model_parameters'
Bird = require '../lib/bird'
Nest = require '../lib/nest'
###
======== A Handy Little Mocha-cakes Reference ========
https://github.com/quangv/mocha-cakes
https://github.com/visionmedia/should.js
https://github.com/visionmedia/mocha
Mocha-cakes:
Feature, Scenario: maps to describe
Given, When, Then: maps to it,
but if first message argument is ommited, it'll be a describe
And, But, I: maps to it,
but if first message argument is ommited, it'll be a describe
Mocha hooks:
before ()-> # before describe
after ()-> # after describe
beforeEach ()-> # before each it
afterEach ()-> # after each it
Should assertions:
should.exist('hello')
should.fail('expected an error!')
true.should.be.ok
true.should.be.true
false.should.be.false
(()-> arguments)(1,2,3).should.be.arguments
[1,2,3].should.eql([1,2,3])
should.strictEqual(undefined, value)
user.age.should.be.within(5, 50)
username.should.match(/^\w+$/)
user.should.be.a('object')
[].should.be.an.instanceOf(Array)
user.should.have.property('age', 15)
user.age.should.be.above(5)
user.age.should.be.below(100)
user.pets.should.have.length(5)
res.should.have.status(200) #res.statusCode should be 200
res.should.be.json
res.should.be.html
res.should.have.header('Content-Length', '123')
[].should.be.empty
[1,2,3].should.include(3)
'foo bar baz'.should.include('foo')
{ name: 'TJ', pet: tobi }.user.should.include({ pet: tobi, name: 'TJ' })
{ foo: 'bar', baz: 'raz' }.should.have.keys('foo', 'bar')
(()-> throw new Error('failed to baz')).should.throwError(/^fail.+/)
user.should.have.property('pets').with.lengthOf(4)
user.should.be.a('object').and.have.property('name', 'tj')
###
###
It's possible that I could build the simulation without
creating these nest objects (just act on pairs of individuals)
but it's easier for me to think about this way, so I think
I'm going to go with it for now.
###
Feature "Nests",
"In order to model crane populations",
"as a modeler",
"I need to model nests", ->
Feature "Nests have a pair of birds",
"In order to model nesting",
"as a modeler",
"every nest needs to have one pair of birds that 'built' it", ->
Scenario "New nest", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two birds", ->
firstBird = new Bird()
secondBird = new Bird()
When "I construct a nest with that pair", ->
nest = new Nest([firstBird, secondBird])
Then "the nest should be built by those birds", ->
builders = nest.builders()
builders.length.should.eql 2
builders.should.include firstBird
builders.should.include secondBird
Feature "Nests have a nesting time",
"In order to model nesting",
"as a modeler",
"every nest needs to have a early/late nesting time", ->
Scenario "Early nester wins", ->
Scenario "Both parents are early nesters", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two early nesters", ->
firstBird = new Bird(Bird.EARLY)
secondBird = new Bird(Bird.EARLY)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be EARLY", ->
nest.nestingTime().should.eql Bird.EARLY
Scenario "Both parents are late nesters", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two early nesters", ->
firstBird = new Bird(Bird.LATE)
secondBird = new Bird(Bird.LATE)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be LATE", ->
nest.nestingTime().should.eql Bird.LATE
Scenario "Parents have different preferences", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two preferences with different preferences", ->
firstBird = new Bird(Bird.EARLY)
secondBird = new Bird(Bird.LATE)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be EARLY", ->
nest.nestingTime().should.eql Bird.EARLY
| 204022 | 'use strict'
require 'mocha-cakes'
ModelParameters = require '../lib/model_parameters'
Bird = require '../lib/bird'
Nest = require '../lib/nest'
###
======== A Handy Little Mocha-cakes Reference ========
https://github.com/quangv/mocha-cakes
https://github.com/visionmedia/should.js
https://github.com/visionmedia/mocha
Mocha-cakes:
Feature, Scenario: maps to describe
Given, When, Then: maps to it,
but if first message argument is ommited, it'll be a describe
And, But, I: maps to it,
but if first message argument is ommited, it'll be a describe
Mocha hooks:
before ()-> # before describe
after ()-> # after describe
beforeEach ()-> # before each it
afterEach ()-> # after each it
Should assertions:
should.exist('hello')
should.fail('expected an error!')
true.should.be.ok
true.should.be.true
false.should.be.false
(()-> arguments)(1,2,3).should.be.arguments
[1,2,3].should.eql([1,2,3])
should.strictEqual(undefined, value)
user.age.should.be.within(5, 50)
username.should.match(/^\w+$/)
user.should.be.a('object')
[].should.be.an.instanceOf(Array)
user.should.have.property('age', 15)
user.age.should.be.above(5)
user.age.should.be.below(100)
user.pets.should.have.length(5)
res.should.have.status(200) #res.statusCode should be 200
res.should.be.json
res.should.be.html
res.should.have.header('Content-Length', '123')
[].should.be.empty
[1,2,3].should.include(3)
'foo bar baz'.should.include('foo')
{ name: '<NAME>', pet: tobi }.user.should.include({ pet: <NAME>bi, name: '<NAME>' })
{ foo: 'bar', baz: 'raz' }.should.have.keys('foo', 'bar')
(()-> throw new Error('failed to baz')).should.throwError(/^fail.+/)
user.should.have.property('pets').with.lengthOf(4)
user.should.be.a('object').and.have.property('name', '<NAME>')
###
###
It's possible that I could build the simulation without
creating these nest objects (just act on pairs of individuals)
but it's easier for me to think about this way, so I think
I'm going to go with it for now.
###
Feature "Nests",
"In order to model crane populations",
"as a modeler",
"I need to model nests", ->
Feature "Nests have a pair of birds",
"In order to model nesting",
"as a modeler",
"every nest needs to have one pair of birds that 'built' it", ->
Scenario "New nest", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two birds", ->
firstBird = new Bird()
secondBird = new Bird()
When "I construct a nest with that pair", ->
nest = new Nest([firstBird, secondBird])
Then "the nest should be built by those birds", ->
builders = nest.builders()
builders.length.should.eql 2
builders.should.include firstBird
builders.should.include secondBird
Feature "Nests have a nesting time",
"In order to model nesting",
"as a modeler",
"every nest needs to have a early/late nesting time", ->
Scenario "Early nester wins", ->
Scenario "Both parents are early nesters", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two early nesters", ->
firstBird = new Bird(Bird.EARLY)
secondBird = new Bird(Bird.EARLY)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be EARLY", ->
nest.nestingTime().should.eql Bird.EARLY
Scenario "Both parents are late nesters", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two early nesters", ->
firstBird = new Bird(Bird.LATE)
secondBird = new Bird(Bird.LATE)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be LATE", ->
nest.nestingTime().should.eql Bird.LATE
Scenario "Parents have different preferences", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two preferences with different preferences", ->
firstBird = new Bird(Bird.EARLY)
secondBird = new Bird(Bird.LATE)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be EARLY", ->
nest.nestingTime().should.eql Bird.EARLY
| true | 'use strict'
require 'mocha-cakes'
ModelParameters = require '../lib/model_parameters'
Bird = require '../lib/bird'
Nest = require '../lib/nest'
###
======== A Handy Little Mocha-cakes Reference ========
https://github.com/quangv/mocha-cakes
https://github.com/visionmedia/should.js
https://github.com/visionmedia/mocha
Mocha-cakes:
Feature, Scenario: maps to describe
Given, When, Then: maps to it,
but if first message argument is ommited, it'll be a describe
And, But, I: maps to it,
but if first message argument is ommited, it'll be a describe
Mocha hooks:
before ()-> # before describe
after ()-> # after describe
beforeEach ()-> # before each it
afterEach ()-> # after each it
Should assertions:
should.exist('hello')
should.fail('expected an error!')
true.should.be.ok
true.should.be.true
false.should.be.false
(()-> arguments)(1,2,3).should.be.arguments
[1,2,3].should.eql([1,2,3])
should.strictEqual(undefined, value)
user.age.should.be.within(5, 50)
username.should.match(/^\w+$/)
user.should.be.a('object')
[].should.be.an.instanceOf(Array)
user.should.have.property('age', 15)
user.age.should.be.above(5)
user.age.should.be.below(100)
user.pets.should.have.length(5)
res.should.have.status(200) #res.statusCode should be 200
res.should.be.json
res.should.be.html
res.should.have.header('Content-Length', '123')
[].should.be.empty
[1,2,3].should.include(3)
'foo bar baz'.should.include('foo')
{ name: 'PI:NAME:<NAME>END_PI', pet: tobi }.user.should.include({ pet: PI:NAME:<NAME>END_PIbi, name: 'PI:NAME:<NAME>END_PI' })
{ foo: 'bar', baz: 'raz' }.should.have.keys('foo', 'bar')
(()-> throw new Error('failed to baz')).should.throwError(/^fail.+/)
user.should.have.property('pets').with.lengthOf(4)
user.should.be.a('object').and.have.property('name', 'PI:NAME:<NAME>END_PI')
###
###
It's possible that I could build the simulation without
creating these nest objects (just act on pairs of individuals)
but it's easier for me to think about this way, so I think
I'm going to go with it for now.
###
Feature "Nests",
"In order to model crane populations",
"as a modeler",
"I need to model nests", ->
Feature "Nests have a pair of birds",
"In order to model nesting",
"as a modeler",
"every nest needs to have one pair of birds that 'built' it", ->
Scenario "New nest", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two birds", ->
firstBird = new Bird()
secondBird = new Bird()
When "I construct a nest with that pair", ->
nest = new Nest([firstBird, secondBird])
Then "the nest should be built by those birds", ->
builders = nest.builders()
builders.length.should.eql 2
builders.should.include firstBird
builders.should.include secondBird
Feature "Nests have a nesting time",
"In order to model nesting",
"as a modeler",
"every nest needs to have a early/late nesting time", ->
Scenario "Early nester wins", ->
Scenario "Both parents are early nesters", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two early nesters", ->
firstBird = new Bird(Bird.EARLY)
secondBird = new Bird(Bird.EARLY)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be EARLY", ->
nest.nestingTime().should.eql Bird.EARLY
Scenario "Both parents are late nesters", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two early nesters", ->
firstBird = new Bird(Bird.LATE)
secondBird = new Bird(Bird.LATE)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be LATE", ->
nest.nestingTime().should.eql Bird.LATE
Scenario "Parents have different preferences", ->
firstBird = null
secondBird = null
nest = null
Given "I construct two preferences with different preferences", ->
firstBird = new Bird(Bird.EARLY)
secondBird = new Bird(Bird.LATE)
When "they construct a nest", ->
nest = new Nest([firstBird, secondBird])
Then "the nest will be EARLY", ->
nest.nestingTime().should.eql Bird.EARLY
|
[
{
"context": "un()\n autoRun.registerCommand(\n keyPath: 'leak-detector.autoRun'\n command: 'leak-detector:start'\n optio",
"end": 3754,
"score": 0.9985156059265137,
"start": 3733,
"tag": "KEY",
"value": "leak-detector.autoRun"
}
] | lib/main.coffee | aki77/atom-leak-detector | 0 | {CompositeDisposable, Disposable} = require 'atom'
module.exports =
config:
maxDisposables:
order: 1
type: 'integer'
default: 200
maxMarkers:
order: 2
type: 'integer'
default: 200
MaxPanels:
order: 3
type: 'integer'
default: 20
autoRun:
order: 10
type: 'boolean'
default: false
description: 'only in development mode (Requirement: auto-run package)'
activate: (state) ->
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:start': => @start()
deactivate: ->
@leakSubscriptions?.dispose()
@leakSubscriptions = null
@commandSubscription?.dispose()
@commandSubscription = null
handleEvents: (editor) ->
{displayBuffer} = editor
markerCreatedCallback = ->
makersLength = displayBuffer.getMarkerCount()
if makersLength > atom.config.get('leak-detector.maxMarkers')
obj = {}
Error.captureStackTrace(obj, markerCreatedCallback)
message = "possible DisplayBuffer memory leak detected. #{makersLength} markers added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
markerCreatedSubscription = displayBuffer.onDidCreateMarker(markerCreatedCallback)
editorDestroyedSubscription = editor.onDidDestroy =>
markerCreatedSubscription.dispose()
editorDestroyedSubscription.dispose()
@leakSubscriptions.remove(markerCreatedSubscription)
@leakSubscriptions.remove(editorDestroyedSubscription)
@leakSubscriptions.add(markerCreatedSubscription)
@leakSubscriptions.add(editorDestroyedSubscription)
start: ->
@leakSubscriptions = new CompositeDisposable
@leakSubscriptions.add(@wrapCompositeDisposable())
@leakSubscriptions.add(@watchPanels())
@leakSubscriptions.add(atom.workspace.observeTextEditors (editor) =>
@handleEvents(editor)
)
@commandSubscription?.dispose()
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:stop': => @stop()
stop: ->
@leakSubscriptions.dispose()
@leakSubscriptions = null
@commandSubscription?.dispose()
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:start': => @start()
onLeak: (info) ->
console.warn 'Leak Detection', info
wrapCompositeDisposable: ->
add = CompositeDisposable::add
CompositeDisposable::add = ->
add.apply(this, arguments)
if @disposables?.size > atom.config.get('leak-detector.maxDisposables')
obj = {}
Error.captureStackTrace(obj, CompositeDisposable::add)
message = "possible CompositeDisposable memory leak detected. #{@disposables.size} disposables added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
new Disposable ->
CompositeDisposable::add = add
watchPanels: ->
addedPanelCallback = ->
panelCount = @getPanels().length
if panelCount > atom.config.get('leak-detector.maxPanels')
obj = {}
Error.captureStackTrace(obj, addedPanelCallback)
message = "possible PanelContainer panels leak detected. #{panelCount} panels added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
subscriptions = new CompositeDisposable
for location, container of atom.workspace.panelContainers
subscriptions.add(container.onDidAddPanel(addedPanelCallback.bind(container)))
subscriptions
activateConfig: ->
pack = atom.packages.getActivePackage('auto-run')
return unless pack
autoRun = pack.mainModule.provideAutoRun()
autoRun.registerCommand(
keyPath: 'leak-detector.autoRun'
command: 'leak-detector:start'
options:
devMode: true
)
| 123344 | {CompositeDisposable, Disposable} = require 'atom'
module.exports =
config:
maxDisposables:
order: 1
type: 'integer'
default: 200
maxMarkers:
order: 2
type: 'integer'
default: 200
MaxPanels:
order: 3
type: 'integer'
default: 20
autoRun:
order: 10
type: 'boolean'
default: false
description: 'only in development mode (Requirement: auto-run package)'
activate: (state) ->
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:start': => @start()
deactivate: ->
@leakSubscriptions?.dispose()
@leakSubscriptions = null
@commandSubscription?.dispose()
@commandSubscription = null
handleEvents: (editor) ->
{displayBuffer} = editor
markerCreatedCallback = ->
makersLength = displayBuffer.getMarkerCount()
if makersLength > atom.config.get('leak-detector.maxMarkers')
obj = {}
Error.captureStackTrace(obj, markerCreatedCallback)
message = "possible DisplayBuffer memory leak detected. #{makersLength} markers added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
markerCreatedSubscription = displayBuffer.onDidCreateMarker(markerCreatedCallback)
editorDestroyedSubscription = editor.onDidDestroy =>
markerCreatedSubscription.dispose()
editorDestroyedSubscription.dispose()
@leakSubscriptions.remove(markerCreatedSubscription)
@leakSubscriptions.remove(editorDestroyedSubscription)
@leakSubscriptions.add(markerCreatedSubscription)
@leakSubscriptions.add(editorDestroyedSubscription)
start: ->
@leakSubscriptions = new CompositeDisposable
@leakSubscriptions.add(@wrapCompositeDisposable())
@leakSubscriptions.add(@watchPanels())
@leakSubscriptions.add(atom.workspace.observeTextEditors (editor) =>
@handleEvents(editor)
)
@commandSubscription?.dispose()
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:stop': => @stop()
stop: ->
@leakSubscriptions.dispose()
@leakSubscriptions = null
@commandSubscription?.dispose()
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:start': => @start()
onLeak: (info) ->
console.warn 'Leak Detection', info
wrapCompositeDisposable: ->
add = CompositeDisposable::add
CompositeDisposable::add = ->
add.apply(this, arguments)
if @disposables?.size > atom.config.get('leak-detector.maxDisposables')
obj = {}
Error.captureStackTrace(obj, CompositeDisposable::add)
message = "possible CompositeDisposable memory leak detected. #{@disposables.size} disposables added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
new Disposable ->
CompositeDisposable::add = add
watchPanels: ->
addedPanelCallback = ->
panelCount = @getPanels().length
if panelCount > atom.config.get('leak-detector.maxPanels')
obj = {}
Error.captureStackTrace(obj, addedPanelCallback)
message = "possible PanelContainer panels leak detected. #{panelCount} panels added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
subscriptions = new CompositeDisposable
for location, container of atom.workspace.panelContainers
subscriptions.add(container.onDidAddPanel(addedPanelCallback.bind(container)))
subscriptions
activateConfig: ->
pack = atom.packages.getActivePackage('auto-run')
return unless pack
autoRun = pack.mainModule.provideAutoRun()
autoRun.registerCommand(
keyPath: '<KEY>'
command: 'leak-detector:start'
options:
devMode: true
)
| true | {CompositeDisposable, Disposable} = require 'atom'
module.exports =
config:
maxDisposables:
order: 1
type: 'integer'
default: 200
maxMarkers:
order: 2
type: 'integer'
default: 200
MaxPanels:
order: 3
type: 'integer'
default: 20
autoRun:
order: 10
type: 'boolean'
default: false
description: 'only in development mode (Requirement: auto-run package)'
activate: (state) ->
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:start': => @start()
deactivate: ->
@leakSubscriptions?.dispose()
@leakSubscriptions = null
@commandSubscription?.dispose()
@commandSubscription = null
handleEvents: (editor) ->
{displayBuffer} = editor
markerCreatedCallback = ->
makersLength = displayBuffer.getMarkerCount()
if makersLength > atom.config.get('leak-detector.maxMarkers')
obj = {}
Error.captureStackTrace(obj, markerCreatedCallback)
message = "possible DisplayBuffer memory leak detected. #{makersLength} markers added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
markerCreatedSubscription = displayBuffer.onDidCreateMarker(markerCreatedCallback)
editorDestroyedSubscription = editor.onDidDestroy =>
markerCreatedSubscription.dispose()
editorDestroyedSubscription.dispose()
@leakSubscriptions.remove(markerCreatedSubscription)
@leakSubscriptions.remove(editorDestroyedSubscription)
@leakSubscriptions.add(markerCreatedSubscription)
@leakSubscriptions.add(editorDestroyedSubscription)
start: ->
@leakSubscriptions = new CompositeDisposable
@leakSubscriptions.add(@wrapCompositeDisposable())
@leakSubscriptions.add(@watchPanels())
@leakSubscriptions.add(atom.workspace.observeTextEditors (editor) =>
@handleEvents(editor)
)
@commandSubscription?.dispose()
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:stop': => @stop()
stop: ->
@leakSubscriptions.dispose()
@leakSubscriptions = null
@commandSubscription?.dispose()
@commandSubscription = atom.commands.add 'atom-workspace',
'leak-detector:start': => @start()
onLeak: (info) ->
console.warn 'Leak Detection', info
wrapCompositeDisposable: ->
add = CompositeDisposable::add
CompositeDisposable::add = ->
add.apply(this, arguments)
if @disposables?.size > atom.config.get('leak-detector.maxDisposables')
obj = {}
Error.captureStackTrace(obj, CompositeDisposable::add)
message = "possible CompositeDisposable memory leak detected. #{@disposables.size} disposables added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
new Disposable ->
CompositeDisposable::add = add
watchPanels: ->
addedPanelCallback = ->
panelCount = @getPanels().length
if panelCount > atom.config.get('leak-detector.maxPanels')
obj = {}
Error.captureStackTrace(obj, addedPanelCallback)
message = "possible PanelContainer panels leak detected. #{panelCount} panels added."
atom.notifications.addError(message, {detail: obj.stack, dismissable: true})
return
subscriptions = new CompositeDisposable
for location, container of atom.workspace.panelContainers
subscriptions.add(container.onDidAddPanel(addedPanelCallback.bind(container)))
subscriptions
activateConfig: ->
pack = atom.packages.getActivePackage('auto-run')
return unless pack
autoRun = pack.mainModule.provideAutoRun()
autoRun.registerCommand(
keyPath: 'PI:KEY:<KEY>END_PI'
command: 'leak-detector:start'
options:
devMode: true
)
|
[
{
"context": ", 962.113, 10, 6, 0.876, 48105638, 73911549],\n ['Nylon', 50000, 40, 1256.637, 15, 8, 0.818, 62831853, 91",
"end": 713,
"score": 0.9997532367706299,
"start": 708,
"tag": "NAME",
"value": "Nylon"
},
{
"context": " 1256.637, 15, 8, 0.818, 62831853, 91676349],\n ['Nylon'... | src/client/simulation/tension/tension-test.coffee | DavidSouther/dartmouth-engineering | 0 | # Default Constants. These all come from a spec (probably an email) somewhere.
START_WIDTH = 4
START_PULL = 2
START_DIAMETER = 10
START_MATERIAL = 'Steel'
sut = null
tensionDataTable = [
['Nylon', 50000, 1, 0.785, 1, 2, 1.326, 39270, 76195],
['Nylon', 50000, 5, 19.635, 5, 4, 1.012, 981748, 1665041],
['Nylon', 50000, 10, 78.540, 10, 6, 0.876, 3926991, 6033596],
['Nylon', 50000, 15, 176.715, 15, 8, 0.818, 8835729, 12891987],
['Nylon', 50000, 20, 314.159, 20, 10, 0.785, 15707963, 22214415],
['Nylon', 50000, 25, 490.874, 1, 2, 1.326, 24543693, 47621759],
['Nylon', 50000, 30, 706.858, 5, 4, 1.012, 35342917, 59941468],
['Nylon', 50000, 35, 962.113, 10, 6, 0.876, 48105638, 73911549],
['Nylon', 50000, 40, 1256.637, 15, 8, 0.818, 62831853, 91676349],
['Nylon', 50000, 50, 1963.495, 20, 10, 0.785, 98174770, 138840092],
['Steel', 250000, 1, 0.785, 1, 2, 1.326, 196350, 380974],
['Steel', 250000, 5, 19.635, 5, 4, 1.012, 4908739, 8325204],
['Steel', 250000, 10, 78.540, 10, 6, 0.876, 19634954, 30167979],
['Steel', 250000, 15, 176.715, 15, 8, 0.818, 44178647, 64459933],
['Steel', 250000, 20, 314.159, 20, 10, 0.785, 78539816, 111072073],
['Steel', 250000, 25, 490.874, 1, 2, 1.326, 122718463, 238108793],
['Steel', 250000, 30, 706.858, 5, 4, 1.012, 176714587, 299707340],
['Steel', 250000, 35, 962.113, 10, 6, 0.876, 240528188, 369557744],
['Steel', 250000, 40, 1256.637, 15, 8, 0.818, 314159265, 458381744],
['Steel', 250000, 50, 1963.495, 20, 10, 0.785, 490873852, 694200459],
]
describe 'Tension Simulation', ->
beforeEach module 'eau.simulation.tension'
describe 'Controller', ->
it 'sets default simulation properties', ->
el = renderElement('tension')
sut = el.$scope
sut.simulation.width.should.equal START_WIDTH
sut.simulation.pull.should.equal START_PULL
sut.simulation.diameter.should.equal START_DIAMETER
sut.simulation.material.name.should.equal START_MATERIAL
describe 'Calculation', ->
tensionDataTable.forEach (test, i)->
# [
# Material, Strength, Diameter | Area |
# Span, Depth | Angle, Tension, Load
# ]
setup = ->
el = renderElement('tension')
sut = el.$scope
mdx = if test[0] is 'Steel' then 0 else 1
sut.simulation.material = sut.materials[mdx]
sut.simulation.width = test[4]
sut.simulation.pull = test[5]
sut.simulation.diameter = test[2]
it "is correct for #{test[2]}mm #{test[0]}", ->
setup()
sut.theta().should.be.closeTo test[6], 1e-2, "Theta #{i}"
sut.area().should.be.closeTo test[3], 1e-2, "Area #{i}"
sut.simulation.stress().should.be.closeTo test[7], 1e2, "Tension #{i}"
sut.simulation.load().should.be.closeTo test[8], 1e2, "Load #{i}"
describe 'Directive', ->
describe 'Simulation', ->
| 153148 | # Default Constants. These all come from a spec (probably an email) somewhere.
START_WIDTH = 4
START_PULL = 2
START_DIAMETER = 10
START_MATERIAL = 'Steel'
sut = null
tensionDataTable = [
['Nylon', 50000, 1, 0.785, 1, 2, 1.326, 39270, 76195],
['Nylon', 50000, 5, 19.635, 5, 4, 1.012, 981748, 1665041],
['Nylon', 50000, 10, 78.540, 10, 6, 0.876, 3926991, 6033596],
['Nylon', 50000, 15, 176.715, 15, 8, 0.818, 8835729, 12891987],
['Nylon', 50000, 20, 314.159, 20, 10, 0.785, 15707963, 22214415],
['Nylon', 50000, 25, 490.874, 1, 2, 1.326, 24543693, 47621759],
['Nylon', 50000, 30, 706.858, 5, 4, 1.012, 35342917, 59941468],
['Nylon', 50000, 35, 962.113, 10, 6, 0.876, 48105638, 73911549],
['<NAME>', 50000, 40, 1256.637, 15, 8, 0.818, 62831853, 91676349],
['<NAME>', 50000, 50, 1963.495, 20, 10, 0.785, 98174770, 138840092],
['<NAME>', 250000, 1, 0.785, 1, 2, 1.326, 196350, 380974],
['<NAME>', 250000, 5, 19.635, 5, 4, 1.012, 4908739, 8325204],
['<NAME>', 250000, 10, 78.540, 10, 6, 0.876, 19634954, 30167979],
['<NAME>', 250000, 15, 176.715, 15, 8, 0.818, 44178647, 64459933],
['<NAME>', 250000, 20, 314.159, 20, 10, 0.785, 78539816, 111072073],
['<NAME>', 250000, 25, 490.874, 1, 2, 1.326, 122718463, 238108793],
['<NAME>', 250000, 30, 706.858, 5, 4, 1.012, 176714587, 299707340],
['<NAME>', 250000, 35, 962.113, 10, 6, 0.876, 240528188, 369557744],
['<NAME>', 250000, 40, 1256.637, 15, 8, 0.818, 314159265, 458381744],
['<NAME>', 250000, 50, 1963.495, 20, 10, 0.785, 490873852, 694200459],
]
describe 'Tension Simulation', ->
beforeEach module 'eau.simulation.tension'
describe 'Controller', ->
it 'sets default simulation properties', ->
el = renderElement('tension')
sut = el.$scope
sut.simulation.width.should.equal START_WIDTH
sut.simulation.pull.should.equal START_PULL
sut.simulation.diameter.should.equal START_DIAMETER
sut.simulation.material.name.should.equal START_MATERIAL
describe 'Calculation', ->
tensionDataTable.forEach (test, i)->
# [
# Material, Strength, Diameter | Area |
# Span, Depth | Angle, Tension, Load
# ]
setup = ->
el = renderElement('tension')
sut = el.$scope
mdx = if test[0] is 'Steel' then 0 else 1
sut.simulation.material = sut.materials[mdx]
sut.simulation.width = test[4]
sut.simulation.pull = test[5]
sut.simulation.diameter = test[2]
it "is correct for #{test[2]}mm #{test[0]}", ->
setup()
sut.theta().should.be.closeTo test[6], 1e-2, "Theta #{i}"
sut.area().should.be.closeTo test[3], 1e-2, "Area #{i}"
sut.simulation.stress().should.be.closeTo test[7], 1e2, "Tension #{i}"
sut.simulation.load().should.be.closeTo test[8], 1e2, "Load #{i}"
describe 'Directive', ->
describe 'Simulation', ->
| true | # Default Constants. These all come from a spec (probably an email) somewhere.
START_WIDTH = 4
START_PULL = 2
START_DIAMETER = 10
START_MATERIAL = 'Steel'
sut = null
tensionDataTable = [
['Nylon', 50000, 1, 0.785, 1, 2, 1.326, 39270, 76195],
['Nylon', 50000, 5, 19.635, 5, 4, 1.012, 981748, 1665041],
['Nylon', 50000, 10, 78.540, 10, 6, 0.876, 3926991, 6033596],
['Nylon', 50000, 15, 176.715, 15, 8, 0.818, 8835729, 12891987],
['Nylon', 50000, 20, 314.159, 20, 10, 0.785, 15707963, 22214415],
['Nylon', 50000, 25, 490.874, 1, 2, 1.326, 24543693, 47621759],
['Nylon', 50000, 30, 706.858, 5, 4, 1.012, 35342917, 59941468],
['Nylon', 50000, 35, 962.113, 10, 6, 0.876, 48105638, 73911549],
['PI:NAME:<NAME>END_PI', 50000, 40, 1256.637, 15, 8, 0.818, 62831853, 91676349],
['PI:NAME:<NAME>END_PI', 50000, 50, 1963.495, 20, 10, 0.785, 98174770, 138840092],
['PI:NAME:<NAME>END_PI', 250000, 1, 0.785, 1, 2, 1.326, 196350, 380974],
['PI:NAME:<NAME>END_PI', 250000, 5, 19.635, 5, 4, 1.012, 4908739, 8325204],
['PI:NAME:<NAME>END_PI', 250000, 10, 78.540, 10, 6, 0.876, 19634954, 30167979],
['PI:NAME:<NAME>END_PI', 250000, 15, 176.715, 15, 8, 0.818, 44178647, 64459933],
['PI:NAME:<NAME>END_PI', 250000, 20, 314.159, 20, 10, 0.785, 78539816, 111072073],
['PI:NAME:<NAME>END_PI', 250000, 25, 490.874, 1, 2, 1.326, 122718463, 238108793],
['PI:NAME:<NAME>END_PI', 250000, 30, 706.858, 5, 4, 1.012, 176714587, 299707340],
['PI:NAME:<NAME>END_PI', 250000, 35, 962.113, 10, 6, 0.876, 240528188, 369557744],
['PI:NAME:<NAME>END_PI', 250000, 40, 1256.637, 15, 8, 0.818, 314159265, 458381744],
['PI:NAME:<NAME>END_PI', 250000, 50, 1963.495, 20, 10, 0.785, 490873852, 694200459],
]
describe 'Tension Simulation', ->
beforeEach module 'eau.simulation.tension'
describe 'Controller', ->
it 'sets default simulation properties', ->
el = renderElement('tension')
sut = el.$scope
sut.simulation.width.should.equal START_WIDTH
sut.simulation.pull.should.equal START_PULL
sut.simulation.diameter.should.equal START_DIAMETER
sut.simulation.material.name.should.equal START_MATERIAL
describe 'Calculation', ->
tensionDataTable.forEach (test, i)->
# [
# Material, Strength, Diameter | Area |
# Span, Depth | Angle, Tension, Load
# ]
setup = ->
el = renderElement('tension')
sut = el.$scope
mdx = if test[0] is 'Steel' then 0 else 1
sut.simulation.material = sut.materials[mdx]
sut.simulation.width = test[4]
sut.simulation.pull = test[5]
sut.simulation.diameter = test[2]
it "is correct for #{test[2]}mm #{test[0]}", ->
setup()
sut.theta().should.be.closeTo test[6], 1e-2, "Theta #{i}"
sut.area().should.be.closeTo test[3], 1e-2, "Area #{i}"
sut.simulation.stress().should.be.closeTo test[7], 1e2, "Tension #{i}"
sut.simulation.load().should.be.closeTo test[8], 1e2, "Load #{i}"
describe 'Directive', ->
describe 'Simulation', ->
|
[
{
"context": " rich text editing jQuery UI widget\n# (c) 2011 Henri Bergius, IKS Consortium\n# Hallo may be freely distrib",
"end": 79,
"score": 0.9998492002487183,
"start": 66,
"tag": "NAME",
"value": "Henri Bergius"
}
] | src/plugins/textselection.coffee | git-j/hallo | 0 | # Hallo - a rich text editing jQuery UI widget
# (c) 2011 Henri Bergius, IKS Consortium
# Hallo may be freely distributed under the MIT license
((jQuery) ->
jQuery.widget "IKS.hallotextselection",
_start_container: null
options:
editable: null
toolbar: null
uuid: ''
buttonCssClass: null
current_version: null
in_document: false
is_nugget: true
_create: ->
@
populateToolbar: (toolbar) ->
buttonset = jQuery "<span class=\"#{@widgetName}\"></span>"
contentId = "#{@options.uuid}-#{@widgetName}-data"
target = @_prepareDropdown contentId
@_bindKeys()
setup= =>
# populate with available actions
target.find('.element-selector').remove()
selection = rangy.getSelection()
return false if selection.rangeCount == 0
range = selection.getRangeAt(0)
range_jq = $(range.cloneContents())
range_ca = null
@start_container = null
@_find_start_container(@options.editable.element[0], range.startContainer)
if ( @start_container )
range_ca = $(@start_container).closest('.citation')
is_citation = range_ca.hasClass('citation')
is_direct_citation = range_ca.hasClass('direct_citation')
is_indirect_citation = range_ca.hasClass('indirect_citation')
else
is_citation = false
is_direct_citation = false
is_indirect_citation = false
has_selection = range_jq.text() != ''
target.append(@_addElement('copy')) if has_selection
target.append(@_addElement('cut')) if has_selection
target.append(@_addElement('paste'))
target.append(@_addElement('as_name')) if has_selection && @options.is_nugget
target.append(@_addElement('as_tag')) if has_selection && @options.is_nugget
target.append(@_addElement('indirect_citation')) if (has_selection && is_direct_citation)
target.append(@_addElement('direct_citation')) if (has_selection && is_indirect_citation)
target.append(@_addElement('remove_citation')) if (has_selection && is_citation)
return true
buttonset.append target
buttonset.append @_prepareButton setup, target
toolbar.append buttonset
_find_start_container: (node,search_node) ->
if ( @start_container )
return
if ( node == search_node )
@start_container = node
if ( node.childNodes )
for child_node in node.childNodes
@_find_start_container(child_node,search_node)
_bindKeys: () ->
widget = @options.editable
widget.registerKey 'ctrl', 67, (event) => # c
widget.execute('copy')
event.preventDefault()
widget.registerKey 'ctrl', 88, (event) => # x
widget.execute('cut')
event.preventDefault()
widget.registerKey 'ctrl', 86, (event) => # v
widget.execute('paste')
event.preventDefault()
_prepareDropdown: (contentId) ->
contentArea = jQuery "<div id=\"#{contentId}\"></div>"
contentArea
_elementText: (element) ->
if ( window.action_list && window.action_list['hallojs_textselection_' + element] != undefined )
element_text = window.action_list['hallojs_textselection_' + element].title
_addElement: (element) ->
#console.log(element)
element_text = @_elementText(element)
el = jQuery "<button class=\"element-selector\">#{element_text}</button>"
this_editable = @options.editable
el.bind "click", (ev) =>
selection = rangy.getSelection()
return if selection.rangeCount == 0
range = selection.getRangeAt(0)
range_jq = $(range.cloneContents())
nugget = new DOMNugget();
if ( element == 'copy' )
this_editable.execute('copy');
else if ( element == 'cut' )
this_editable.execute('cut');
else if ( element == 'paste' )
this_editable.execute('paste');
else if ( element == 'as_name' )
if ( range_jq.text() != '' )
nugget.rename(@options.editable.element, range_jq.text())
else if ( element == 'as_tag' )
if ( range_jq.text() != '' )
nugget.createTag(@options.editable.element, range_jq.text())
else if ( element == 'direct_citation')
console.log('NOT IMPLEMENTED:',element)
else if ( element == 'indirect_citation')
console.log('NOT IMPLEMENTED:',element)
else if ( element == 'remove_citation')
@start_container = null
@_find_start_container(@options.editable.element[0],range.startContainer)
$(@start_container).closest('.citation').removeClass('citation')
@options.editable.element.blur()
@options.editable.element.focus()
_prepareButton: (setup, target) ->
buttonElement = jQuery '<span></span>'
button_label = 'textselection'
if ( window.action_list && window.action_list['hallojs_textselection'] != undefined )
button_label = window.action_list['hallojs_textselection'].title
buttonElement.hallodropdownbutton
uuid: @options.uuid
editable: @options.editable
label: button_label
command: 'textselection'
icon: 'icon-text-height'
target: target
setup: setup
cssClass: @options.buttonCssClass
buttonElement
)(jQuery)
| 209978 | # Hallo - a rich text editing jQuery UI widget
# (c) 2011 <NAME>, IKS Consortium
# Hallo may be freely distributed under the MIT license
((jQuery) ->
jQuery.widget "IKS.hallotextselection",
_start_container: null
options:
editable: null
toolbar: null
uuid: ''
buttonCssClass: null
current_version: null
in_document: false
is_nugget: true
_create: ->
@
populateToolbar: (toolbar) ->
buttonset = jQuery "<span class=\"#{@widgetName}\"></span>"
contentId = "#{@options.uuid}-#{@widgetName}-data"
target = @_prepareDropdown contentId
@_bindKeys()
setup= =>
# populate with available actions
target.find('.element-selector').remove()
selection = rangy.getSelection()
return false if selection.rangeCount == 0
range = selection.getRangeAt(0)
range_jq = $(range.cloneContents())
range_ca = null
@start_container = null
@_find_start_container(@options.editable.element[0], range.startContainer)
if ( @start_container )
range_ca = $(@start_container).closest('.citation')
is_citation = range_ca.hasClass('citation')
is_direct_citation = range_ca.hasClass('direct_citation')
is_indirect_citation = range_ca.hasClass('indirect_citation')
else
is_citation = false
is_direct_citation = false
is_indirect_citation = false
has_selection = range_jq.text() != ''
target.append(@_addElement('copy')) if has_selection
target.append(@_addElement('cut')) if has_selection
target.append(@_addElement('paste'))
target.append(@_addElement('as_name')) if has_selection && @options.is_nugget
target.append(@_addElement('as_tag')) if has_selection && @options.is_nugget
target.append(@_addElement('indirect_citation')) if (has_selection && is_direct_citation)
target.append(@_addElement('direct_citation')) if (has_selection && is_indirect_citation)
target.append(@_addElement('remove_citation')) if (has_selection && is_citation)
return true
buttonset.append target
buttonset.append @_prepareButton setup, target
toolbar.append buttonset
_find_start_container: (node,search_node) ->
if ( @start_container )
return
if ( node == search_node )
@start_container = node
if ( node.childNodes )
for child_node in node.childNodes
@_find_start_container(child_node,search_node)
_bindKeys: () ->
widget = @options.editable
widget.registerKey 'ctrl', 67, (event) => # c
widget.execute('copy')
event.preventDefault()
widget.registerKey 'ctrl', 88, (event) => # x
widget.execute('cut')
event.preventDefault()
widget.registerKey 'ctrl', 86, (event) => # v
widget.execute('paste')
event.preventDefault()
_prepareDropdown: (contentId) ->
contentArea = jQuery "<div id=\"#{contentId}\"></div>"
contentArea
_elementText: (element) ->
if ( window.action_list && window.action_list['hallojs_textselection_' + element] != undefined )
element_text = window.action_list['hallojs_textselection_' + element].title
_addElement: (element) ->
#console.log(element)
element_text = @_elementText(element)
el = jQuery "<button class=\"element-selector\">#{element_text}</button>"
this_editable = @options.editable
el.bind "click", (ev) =>
selection = rangy.getSelection()
return if selection.rangeCount == 0
range = selection.getRangeAt(0)
range_jq = $(range.cloneContents())
nugget = new DOMNugget();
if ( element == 'copy' )
this_editable.execute('copy');
else if ( element == 'cut' )
this_editable.execute('cut');
else if ( element == 'paste' )
this_editable.execute('paste');
else if ( element == 'as_name' )
if ( range_jq.text() != '' )
nugget.rename(@options.editable.element, range_jq.text())
else if ( element == 'as_tag' )
if ( range_jq.text() != '' )
nugget.createTag(@options.editable.element, range_jq.text())
else if ( element == 'direct_citation')
console.log('NOT IMPLEMENTED:',element)
else if ( element == 'indirect_citation')
console.log('NOT IMPLEMENTED:',element)
else if ( element == 'remove_citation')
@start_container = null
@_find_start_container(@options.editable.element[0],range.startContainer)
$(@start_container).closest('.citation').removeClass('citation')
@options.editable.element.blur()
@options.editable.element.focus()
_prepareButton: (setup, target) ->
buttonElement = jQuery '<span></span>'
button_label = 'textselection'
if ( window.action_list && window.action_list['hallojs_textselection'] != undefined )
button_label = window.action_list['hallojs_textselection'].title
buttonElement.hallodropdownbutton
uuid: @options.uuid
editable: @options.editable
label: button_label
command: 'textselection'
icon: 'icon-text-height'
target: target
setup: setup
cssClass: @options.buttonCssClass
buttonElement
)(jQuery)
| true | # Hallo - a rich text editing jQuery UI widget
# (c) 2011 PI:NAME:<NAME>END_PI, IKS Consortium
# Hallo may be freely distributed under the MIT license
((jQuery) ->
jQuery.widget "IKS.hallotextselection",
_start_container: null
options:
editable: null
toolbar: null
uuid: ''
buttonCssClass: null
current_version: null
in_document: false
is_nugget: true
_create: ->
@
populateToolbar: (toolbar) ->
buttonset = jQuery "<span class=\"#{@widgetName}\"></span>"
contentId = "#{@options.uuid}-#{@widgetName}-data"
target = @_prepareDropdown contentId
@_bindKeys()
setup= =>
# populate with available actions
target.find('.element-selector').remove()
selection = rangy.getSelection()
return false if selection.rangeCount == 0
range = selection.getRangeAt(0)
range_jq = $(range.cloneContents())
range_ca = null
@start_container = null
@_find_start_container(@options.editable.element[0], range.startContainer)
if ( @start_container )
range_ca = $(@start_container).closest('.citation')
is_citation = range_ca.hasClass('citation')
is_direct_citation = range_ca.hasClass('direct_citation')
is_indirect_citation = range_ca.hasClass('indirect_citation')
else
is_citation = false
is_direct_citation = false
is_indirect_citation = false
has_selection = range_jq.text() != ''
target.append(@_addElement('copy')) if has_selection
target.append(@_addElement('cut')) if has_selection
target.append(@_addElement('paste'))
target.append(@_addElement('as_name')) if has_selection && @options.is_nugget
target.append(@_addElement('as_tag')) if has_selection && @options.is_nugget
target.append(@_addElement('indirect_citation')) if (has_selection && is_direct_citation)
target.append(@_addElement('direct_citation')) if (has_selection && is_indirect_citation)
target.append(@_addElement('remove_citation')) if (has_selection && is_citation)
return true
buttonset.append target
buttonset.append @_prepareButton setup, target
toolbar.append buttonset
_find_start_container: (node,search_node) ->
if ( @start_container )
return
if ( node == search_node )
@start_container = node
if ( node.childNodes )
for child_node in node.childNodes
@_find_start_container(child_node,search_node)
_bindKeys: () ->
widget = @options.editable
widget.registerKey 'ctrl', 67, (event) => # c
widget.execute('copy')
event.preventDefault()
widget.registerKey 'ctrl', 88, (event) => # x
widget.execute('cut')
event.preventDefault()
widget.registerKey 'ctrl', 86, (event) => # v
widget.execute('paste')
event.preventDefault()
_prepareDropdown: (contentId) ->
contentArea = jQuery "<div id=\"#{contentId}\"></div>"
contentArea
_elementText: (element) ->
if ( window.action_list && window.action_list['hallojs_textselection_' + element] != undefined )
element_text = window.action_list['hallojs_textselection_' + element].title
_addElement: (element) ->
#console.log(element)
element_text = @_elementText(element)
el = jQuery "<button class=\"element-selector\">#{element_text}</button>"
this_editable = @options.editable
el.bind "click", (ev) =>
selection = rangy.getSelection()
return if selection.rangeCount == 0
range = selection.getRangeAt(0)
range_jq = $(range.cloneContents())
nugget = new DOMNugget();
if ( element == 'copy' )
this_editable.execute('copy');
else if ( element == 'cut' )
this_editable.execute('cut');
else if ( element == 'paste' )
this_editable.execute('paste');
else if ( element == 'as_name' )
if ( range_jq.text() != '' )
nugget.rename(@options.editable.element, range_jq.text())
else if ( element == 'as_tag' )
if ( range_jq.text() != '' )
nugget.createTag(@options.editable.element, range_jq.text())
else if ( element == 'direct_citation')
console.log('NOT IMPLEMENTED:',element)
else if ( element == 'indirect_citation')
console.log('NOT IMPLEMENTED:',element)
else if ( element == 'remove_citation')
@start_container = null
@_find_start_container(@options.editable.element[0],range.startContainer)
$(@start_container).closest('.citation').removeClass('citation')
@options.editable.element.blur()
@options.editable.element.focus()
_prepareButton: (setup, target) ->
buttonElement = jQuery '<span></span>'
button_label = 'textselection'
if ( window.action_list && window.action_list['hallojs_textselection'] != undefined )
button_label = window.action_list['hallojs_textselection'].title
buttonElement.hallodropdownbutton
uuid: @options.uuid
editable: @options.editable
label: button_label
command: 'textselection'
icon: 'icon-text-height'
target: target
setup: setup
cssClass: @options.buttonCssClass
buttonElement
)(jQuery)
|
[
{
"context": "oint/', (next) ->\n if controllers.index[@params.endpoint]?\n yield controllers.index[@params.e",
"end": 640,
"score": 0.546251118183136,
"start": 640,
"tag": "EMAIL",
"value": ""
},
{
"context": "/:endpoint/', (next) ->\n if controllers[@params.controller]? ... | src/urls.coffee | evanhuang8/teresa | 0 | ###
Url routes
###
router = require 'koa-router'
module.exports = () ->
urls = new router()
controllers =
index: require './controllers/index'
user: require './controllers/user'
community: require './controllers/community'
organization: require './controllers/organization'
client: require './controllers/client'
referral: require './controllers/referral'
service: require './controllers/service'
analytics: require './controllers/analytics'
# Index
urls.all '/', controllers.index.index
# Index endpoint/Controller index
urls.all '/:endpoint/', (next) ->
if controllers.index[@params.endpoint]?
yield controllers.index[@params.endpoint].call this
return
else if controllers[@params.endpoint]? and controllers[@params.endpoint].index?
yield controllers[@params.endpoint].index.apply this, [next]
return
yield next
return
# Controller endpoint
urls.all '/:controller/:endpoint/', (next) ->
if controllers[@params.controller]? and controllers[@params.controller][@params.endpoint]?
yield controllers[@params.controller][@params.endpoint].apply this, [next]
return
yield next
return
return urls | 102897 | ###
Url routes
###
router = require 'koa-router'
module.exports = () ->
urls = new router()
controllers =
index: require './controllers/index'
user: require './controllers/user'
community: require './controllers/community'
organization: require './controllers/organization'
client: require './controllers/client'
referral: require './controllers/referral'
service: require './controllers/service'
analytics: require './controllers/analytics'
# Index
urls.all '/', controllers.index.index
# Index endpoint/Controller index
urls.all '/:endpoint/', (next) ->
if controllers.index[@params<EMAIL>.endpoint]?
yield controllers.index[@params.endpoint].call this
return
else if controllers[@params.endpoint]? and controllers[@params.endpoint].index?
yield controllers[@params.endpoint].index.apply this, [next]
return
yield next
return
# Controller endpoint
urls.all '/:controller/:endpoint/', (next) ->
if controllers[@params.<EMAIL>]? and controllers[@params.controller][@params.endpoint]?
yield controllers[@params.controller][@params.endpoint].apply this, [next]
return
yield next
return
return urls | true | ###
Url routes
###
router = require 'koa-router'
module.exports = () ->
urls = new router()
controllers =
index: require './controllers/index'
user: require './controllers/user'
community: require './controllers/community'
organization: require './controllers/organization'
client: require './controllers/client'
referral: require './controllers/referral'
service: require './controllers/service'
analytics: require './controllers/analytics'
# Index
urls.all '/', controllers.index.index
# Index endpoint/Controller index
urls.all '/:endpoint/', (next) ->
if controllers.index[@paramsPI:EMAIL:<EMAIL>END_PI.endpoint]?
yield controllers.index[@params.endpoint].call this
return
else if controllers[@params.endpoint]? and controllers[@params.endpoint].index?
yield controllers[@params.endpoint].index.apply this, [next]
return
yield next
return
# Controller endpoint
urls.all '/:controller/:endpoint/', (next) ->
if controllers[@params.PI:EMAIL:<EMAIL>END_PI]? and controllers[@params.controller][@params.endpoint]?
yield controllers[@params.controller][@params.endpoint].apply this, [next]
return
yield next
return
return urls |
[
{
"context": "# Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public Li",
"end": 43,
"score": 0.9999136924743652,
"start": 29,
"tag": "EMAIL",
"value": "contact@ppy.sh"
}
] | resources/assets/coffee/react/status-page/map.coffee | osu-katakuna/osu-katakuna-web | 5 | # Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
# See the LICENCE file in the repository root for full licence text.
import * as React from 'react'
import { div, span } from 'react-dom-factories'
el = React.createElement
export class Map extends React.Component
constructor: (props) ->
super props
componentDidMount: =>
@_map()
componentDidUpdate: =>
@_map()
_map: ->
unless @map
@map = new StatusMap(@refs.status__map)
@map.update(@props.servers)
render: =>
div
ref: 'status__map'
className: 'status-map osu-layout__row--page-compact'
| 1177 | # Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the GNU Affero General Public License v3.0.
# See the LICENCE file in the repository root for full licence text.
import * as React from 'react'
import { div, span } from 'react-dom-factories'
el = React.createElement
export class Map extends React.Component
constructor: (props) ->
super props
componentDidMount: =>
@_map()
componentDidUpdate: =>
@_map()
_map: ->
unless @map
@map = new StatusMap(@refs.status__map)
@map.update(@props.servers)
render: =>
div
ref: 'status__map'
className: 'status-map osu-layout__row--page-compact'
| true | # Copyright (c) ppy Pty Ltd <PI:EMAIL:<EMAIL>END_PI>. Licensed under the GNU Affero General Public License v3.0.
# See the LICENCE file in the repository root for full licence text.
import * as React from 'react'
import { div, span } from 'react-dom-factories'
el = React.createElement
export class Map extends React.Component
constructor: (props) ->
super props
componentDidMount: =>
@_map()
componentDidUpdate: =>
@_map()
_map: ->
unless @map
@map = new StatusMap(@refs.status__map)
@map.update(@props.servers)
render: =>
div
ref: 'status__map'
className: 'status-map osu-layout__row--page-compact'
|
[
{
"context": "# Smart Time Ago v0.1.1\n\n# Copyright 2012, Terry Tai, Pragmatic.ly\n# https://pragmatic.ly/\n# Licensed ",
"end": 52,
"score": 0.999763011932373,
"start": 43,
"tag": "NAME",
"value": "Terry Tai"
},
{
"context": "ensed under the MIT license.\n# https://github.com/pragm... | src/timeago.coffee | enovatedesign/smart-time-ago | 0 | # Smart Time Ago v0.1.1
# Copyright 2012, Terry Tai, Pragmatic.ly
# https://pragmatic.ly/
# Licensed under the MIT license.
# https://github.com/pragmaticly/smart-time-ago/blob/master/LICENSE
class TimeAgo
constructor: (element, options) ->
@$element = $(element)
@options = $.extend({}, $.fn.timeago.defaults, options)
@refresh()
startTimer: ->
@interval = setTimeout(=>
@refresh()
, @startInterval)
stopTimer: ->
clearTimeout(@interval)
restartTimer: ->
@stopTimer()
@startTimer()
refresh: ->
@updateTime()
@updateInterval()
updateTime: ->
timeAgoInWords = @timeAgoInWords(@$element.attr(@options.attr))
@$element.html(timeAgoInWords)
updateInterval: ->
newestTimeSrc = @$element.attr(@options.attr)
newestTime = @parse(newestTimeSrc)
dis = @getTimeDistanceInSeconds(newestTime)
if @options.maxRelative and dis >= @options.maxRelative
@stopTimer()
else if @options.showNow and dis < @options.showNow
@startInterval = (@options.showNow - dis) * 1000
@restartTimer()
else if @options.showSeconds and dis < 60
@startInterval = 1000
@restartTimer()
else if dis < 2700
@startInterval = (60 - dis % 60) * 1000
@restartTimer()
else if dis < 5400
@startInterval = (5400 - dis) * 1000
@restartTimer()
else if dis < 151200
@startInterval = (3600 - dis % 3600) * 1000
@restartTimer()
else
@startInterval = (86400 - dis % 86400) * 1000
@restartTimer()
timeAgoInWords: (timeString) ->
absolutTime = @parse(timeString)
dis = @getTimeDistanceInSeconds(absolutTime) #distance in seconds
if @options.showNow and @options.showNow > dis
@options.lang.prefixes.now
else if @options.maxRelative and @options.maxRelative <= dis
@options.absoluteDate(absolutTime, timeString)
else
@options.relativeDate(@options.lang.prefixes.ago, @distanceOfTimeInWords(dis), (@options.suffix or @options.lang.suffix))
parse: (iso8601) ->
timeStr = $.trim(iso8601)
timeStr = timeStr.replace(/\.\d+/,"")
timeStr = timeStr.replace(/-/,"/").replace(/-/,"/")
timeStr = timeStr.replace(/T/," ").replace(/Z/," UTC")
timeStr = timeStr.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2")
new Date(timeStr)
getTimeDistanceInSeconds: (absolutTime) ->
timeDistance = new Date().getTime() - absolutTime.getTime()
Math.round(Math.abs(timeDistance) / 1000)
distanceOfTimeInWords: (dis) ->
#TODO support i18n.
space = if @options.spacing then ' ' else ''
if dis < 60
if @options.showSeconds
if dis == 0 or dis == 1
"1#{ space }#{ @options.lang.units.second }"
else
"#{ dis }#{ space }#{ @options.lang.units.seconds }"
else
"#{ if @options.approximate then @options.lang.prefixes.lt + " " else "1" + space }#{ @options.lang.units.minute }"
else if dis < 120
"1#{ space }#{ @options.lang.units.minute }"
else if dis < 2700
"#{ Math.round(dis / 60) }#{ space }#{ @options.lang.units.minutes }"
else if dis < 5400
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.hour }"
else if dis < 86400
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }#{ Math.round(dis / 3600) }#{ space }#{ @options.lang.units.hours }"
else if dis < 151200
"1#{ space }#{ @options.lang.units.day }"
else if dis < 2592000
"#{ Math.round(dis / 86400) }#{ space }#{ @options.lang.units.days }"
else if dis < 5184000
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.month }"
else if dis < 31536000 #1 yr
"#{ Math.round(dis / 2592000) }#{ space }#{ @options.lang.units.months }"
else if dis < 39312000 #1 yr, 3 months
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.year }"
else if dis < 54864000 #1 yr, 9 months
"#{ if @options.approximate then @options.lang.prefixes.over + " " else "" }1#{ space }#{ @options.lang.units.year }"
else if dis < 63072000 #2 yr minus half minute
"#{ if @options.approximate then @options.lang.prefixes.almost + " " else "" }2#{ space }#{ @options.lang.units.years }"
else
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }#{ Math.round(dis / 31536000) }#{ space }#{ @options.lang.units.years }"
$.fn.timeago = (options = {}) ->
@each ->
$this = $(this)
attr = $this.attr(options.attr or $.fn.timeago.defaults.attr)
if attr == undefined or attr == false
return
data = $this.data("timeago")
if (!data)
$this.data("timeago", new TimeAgo(this, options))
else if (typeof options is 'string')
data[options]()
$.fn.findAndSelf = (selector) ->
this.find(selector).add(this.filter(selector))
$.fn.timeago.Constructor = TimeAgo
$.fn.timeago.defaults =
attr: 'datetime'
spacing: true
approximate: true
showSeconds: false
showNow: false
maxRelative: false
absoluteDate: (date, datetime) -> datetime
relativeDate: (prefix, distance, suffix) ->
"#{prefix}#{distance}#{suffix}"
lang:
units:
second: "second"
seconds: "seconds"
minute: "minute"
minutes: "minutes"
hour: "hour"
hours: "hours"
day: "day"
days: "days"
month: "month"
months: "months"
year: "year"
years: "years"
prefixes:
now: "just now"
lt: "less than a"
about: "about"
over: "over"
almost: "almost"
ago: ""
suffix: ' ago'
| 153729 | # Smart Time Ago v0.1.1
# Copyright 2012, <NAME>, Pragmatic.ly
# https://pragmatic.ly/
# Licensed under the MIT license.
# https://github.com/pragmaticly/smart-time-ago/blob/master/LICENSE
class TimeAgo
constructor: (element, options) ->
@$element = $(element)
@options = $.extend({}, $.fn.timeago.defaults, options)
@refresh()
startTimer: ->
@interval = setTimeout(=>
@refresh()
, @startInterval)
stopTimer: ->
clearTimeout(@interval)
restartTimer: ->
@stopTimer()
@startTimer()
refresh: ->
@updateTime()
@updateInterval()
updateTime: ->
timeAgoInWords = @timeAgoInWords(@$element.attr(@options.attr))
@$element.html(timeAgoInWords)
updateInterval: ->
newestTimeSrc = @$element.attr(@options.attr)
newestTime = @parse(newestTimeSrc)
dis = @getTimeDistanceInSeconds(newestTime)
if @options.maxRelative and dis >= @options.maxRelative
@stopTimer()
else if @options.showNow and dis < @options.showNow
@startInterval = (@options.showNow - dis) * 1000
@restartTimer()
else if @options.showSeconds and dis < 60
@startInterval = 1000
@restartTimer()
else if dis < 2700
@startInterval = (60 - dis % 60) * 1000
@restartTimer()
else if dis < 5400
@startInterval = (5400 - dis) * 1000
@restartTimer()
else if dis < 151200
@startInterval = (3600 - dis % 3600) * 1000
@restartTimer()
else
@startInterval = (86400 - dis % 86400) * 1000
@restartTimer()
timeAgoInWords: (timeString) ->
absolutTime = @parse(timeString)
dis = @getTimeDistanceInSeconds(absolutTime) #distance in seconds
if @options.showNow and @options.showNow > dis
@options.lang.prefixes.now
else if @options.maxRelative and @options.maxRelative <= dis
@options.absoluteDate(absolutTime, timeString)
else
@options.relativeDate(@options.lang.prefixes.ago, @distanceOfTimeInWords(dis), (@options.suffix or @options.lang.suffix))
parse: (iso8601) ->
timeStr = $.trim(iso8601)
timeStr = timeStr.replace(/\.\d+/,"")
timeStr = timeStr.replace(/-/,"/").replace(/-/,"/")
timeStr = timeStr.replace(/T/," ").replace(/Z/," UTC")
timeStr = timeStr.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2")
new Date(timeStr)
getTimeDistanceInSeconds: (absolutTime) ->
timeDistance = new Date().getTime() - absolutTime.getTime()
Math.round(Math.abs(timeDistance) / 1000)
distanceOfTimeInWords: (dis) ->
#TODO support i18n.
space = if @options.spacing then ' ' else ''
if dis < 60
if @options.showSeconds
if dis == 0 or dis == 1
"1#{ space }#{ @options.lang.units.second }"
else
"#{ dis }#{ space }#{ @options.lang.units.seconds }"
else
"#{ if @options.approximate then @options.lang.prefixes.lt + " " else "1" + space }#{ @options.lang.units.minute }"
else if dis < 120
"1#{ space }#{ @options.lang.units.minute }"
else if dis < 2700
"#{ Math.round(dis / 60) }#{ space }#{ @options.lang.units.minutes }"
else if dis < 5400
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.hour }"
else if dis < 86400
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }#{ Math.round(dis / 3600) }#{ space }#{ @options.lang.units.hours }"
else if dis < 151200
"1#{ space }#{ @options.lang.units.day }"
else if dis < 2592000
"#{ Math.round(dis / 86400) }#{ space }#{ @options.lang.units.days }"
else if dis < 5184000
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.month }"
else if dis < 31536000 #1 yr
"#{ Math.round(dis / 2592000) }#{ space }#{ @options.lang.units.months }"
else if dis < 39312000 #1 yr, 3 months
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.year }"
else if dis < 54864000 #1 yr, 9 months
"#{ if @options.approximate then @options.lang.prefixes.over + " " else "" }1#{ space }#{ @options.lang.units.year }"
else if dis < 63072000 #2 yr minus half minute
"#{ if @options.approximate then @options.lang.prefixes.almost + " " else "" }2#{ space }#{ @options.lang.units.years }"
else
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }#{ Math.round(dis / 31536000) }#{ space }#{ @options.lang.units.years }"
$.fn.timeago = (options = {}) ->
@each ->
$this = $(this)
attr = $this.attr(options.attr or $.fn.timeago.defaults.attr)
if attr == undefined or attr == false
return
data = $this.data("timeago")
if (!data)
$this.data("timeago", new TimeAgo(this, options))
else if (typeof options is 'string')
data[options]()
$.fn.findAndSelf = (selector) ->
this.find(selector).add(this.filter(selector))
$.fn.timeago.Constructor = TimeAgo
$.fn.timeago.defaults =
attr: 'datetime'
spacing: true
approximate: true
showSeconds: false
showNow: false
maxRelative: false
absoluteDate: (date, datetime) -> datetime
relativeDate: (prefix, distance, suffix) ->
"#{prefix}#{distance}#{suffix}"
lang:
units:
second: "second"
seconds: "seconds"
minute: "minute"
minutes: "minutes"
hour: "hour"
hours: "hours"
day: "day"
days: "days"
month: "month"
months: "months"
year: "year"
years: "years"
prefixes:
now: "just now"
lt: "less than a"
about: "about"
over: "over"
almost: "almost"
ago: ""
suffix: ' ago'
| true | # Smart Time Ago v0.1.1
# Copyright 2012, PI:NAME:<NAME>END_PI, Pragmatic.ly
# https://pragmatic.ly/
# Licensed under the MIT license.
# https://github.com/pragmaticly/smart-time-ago/blob/master/LICENSE
class TimeAgo
constructor: (element, options) ->
@$element = $(element)
@options = $.extend({}, $.fn.timeago.defaults, options)
@refresh()
startTimer: ->
@interval = setTimeout(=>
@refresh()
, @startInterval)
stopTimer: ->
clearTimeout(@interval)
restartTimer: ->
@stopTimer()
@startTimer()
refresh: ->
@updateTime()
@updateInterval()
updateTime: ->
timeAgoInWords = @timeAgoInWords(@$element.attr(@options.attr))
@$element.html(timeAgoInWords)
updateInterval: ->
newestTimeSrc = @$element.attr(@options.attr)
newestTime = @parse(newestTimeSrc)
dis = @getTimeDistanceInSeconds(newestTime)
if @options.maxRelative and dis >= @options.maxRelative
@stopTimer()
else if @options.showNow and dis < @options.showNow
@startInterval = (@options.showNow - dis) * 1000
@restartTimer()
else if @options.showSeconds and dis < 60
@startInterval = 1000
@restartTimer()
else if dis < 2700
@startInterval = (60 - dis % 60) * 1000
@restartTimer()
else if dis < 5400
@startInterval = (5400 - dis) * 1000
@restartTimer()
else if dis < 151200
@startInterval = (3600 - dis % 3600) * 1000
@restartTimer()
else
@startInterval = (86400 - dis % 86400) * 1000
@restartTimer()
timeAgoInWords: (timeString) ->
absolutTime = @parse(timeString)
dis = @getTimeDistanceInSeconds(absolutTime) #distance in seconds
if @options.showNow and @options.showNow > dis
@options.lang.prefixes.now
else if @options.maxRelative and @options.maxRelative <= dis
@options.absoluteDate(absolutTime, timeString)
else
@options.relativeDate(@options.lang.prefixes.ago, @distanceOfTimeInWords(dis), (@options.suffix or @options.lang.suffix))
parse: (iso8601) ->
timeStr = $.trim(iso8601)
timeStr = timeStr.replace(/\.\d+/,"")
timeStr = timeStr.replace(/-/,"/").replace(/-/,"/")
timeStr = timeStr.replace(/T/," ").replace(/Z/," UTC")
timeStr = timeStr.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2")
new Date(timeStr)
getTimeDistanceInSeconds: (absolutTime) ->
timeDistance = new Date().getTime() - absolutTime.getTime()
Math.round(Math.abs(timeDistance) / 1000)
distanceOfTimeInWords: (dis) ->
#TODO support i18n.
space = if @options.spacing then ' ' else ''
if dis < 60
if @options.showSeconds
if dis == 0 or dis == 1
"1#{ space }#{ @options.lang.units.second }"
else
"#{ dis }#{ space }#{ @options.lang.units.seconds }"
else
"#{ if @options.approximate then @options.lang.prefixes.lt + " " else "1" + space }#{ @options.lang.units.minute }"
else if dis < 120
"1#{ space }#{ @options.lang.units.minute }"
else if dis < 2700
"#{ Math.round(dis / 60) }#{ space }#{ @options.lang.units.minutes }"
else if dis < 5400
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.hour }"
else if dis < 86400
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }#{ Math.round(dis / 3600) }#{ space }#{ @options.lang.units.hours }"
else if dis < 151200
"1#{ space }#{ @options.lang.units.day }"
else if dis < 2592000
"#{ Math.round(dis / 86400) }#{ space }#{ @options.lang.units.days }"
else if dis < 5184000
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.month }"
else if dis < 31536000 #1 yr
"#{ Math.round(dis / 2592000) }#{ space }#{ @options.lang.units.months }"
else if dis < 39312000 #1 yr, 3 months
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }1#{ space }#{ @options.lang.units.year }"
else if dis < 54864000 #1 yr, 9 months
"#{ if @options.approximate then @options.lang.prefixes.over + " " else "" }1#{ space }#{ @options.lang.units.year }"
else if dis < 63072000 #2 yr minus half minute
"#{ if @options.approximate then @options.lang.prefixes.almost + " " else "" }2#{ space }#{ @options.lang.units.years }"
else
"#{ if @options.approximate then @options.lang.prefixes.about + " " else "" }#{ Math.round(dis / 31536000) }#{ space }#{ @options.lang.units.years }"
$.fn.timeago = (options = {}) ->
@each ->
$this = $(this)
attr = $this.attr(options.attr or $.fn.timeago.defaults.attr)
if attr == undefined or attr == false
return
data = $this.data("timeago")
if (!data)
$this.data("timeago", new TimeAgo(this, options))
else if (typeof options is 'string')
data[options]()
$.fn.findAndSelf = (selector) ->
this.find(selector).add(this.filter(selector))
$.fn.timeago.Constructor = TimeAgo
$.fn.timeago.defaults =
attr: 'datetime'
spacing: true
approximate: true
showSeconds: false
showNow: false
maxRelative: false
absoluteDate: (date, datetime) -> datetime
relativeDate: (prefix, distance, suffix) ->
"#{prefix}#{distance}#{suffix}"
lang:
units:
second: "second"
seconds: "seconds"
minute: "minute"
minutes: "minutes"
hour: "hour"
hours: "hours"
day: "day"
days: "days"
month: "month"
months: "months"
year: "year"
years: "years"
prefixes:
now: "just now"
lt: "less than a"
about: "about"
over: "over"
almost: "almost"
ago: ""
suffix: ' ago'
|
[
{
"context": "tion freeze\n#\n# MIT License\n#\n# Copyright (c) 2018 Dennis Raymondo van der Sluis\n#\n# Permission is hereby granted, free of charge,",
"end": 139,
"score": 0.9998847842216492,
"start": 110,
"tag": "NAME",
"value": "Dennis Raymondo van der Sluis"
}
] | freeze-deep.coffee | thght/freeze-deep | 2 | #
# A fast and type safe deep (recursive) object/array/function freeze
#
# MIT License
#
# Copyright (c) 2018 Dennis Raymondo van der Sluis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
FUNCTION_PROPS = [ 'caller', 'callee', 'arguments' ]
# use flawed 'object' identification to allow for arrays
isArrObj = ( obj ) -> (typeof obj is 'object')
isFunction = ( obj ) -> (typeof obj is 'function')
specialFunction = ( key, value ) -> (isFunction value) and (~FUNCTION_PROPS.indexOf key)
module.exports= freezeDeep= ( obj, recurse ) ->
# don't try to loop over a non-object/array
if recurse or (isArrObj obj) or (isFunction obj)
Object.freeze obj
for own key, value of obj
continue if (Object.isFrozen value)
if (isArrObj value) or (specialFunction key, value)
freezeDeep value, true
return obj | 154543 | #
# A fast and type safe deep (recursive) object/array/function freeze
#
# MIT License
#
# Copyright (c) 2018 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
FUNCTION_PROPS = [ 'caller', 'callee', 'arguments' ]
# use flawed 'object' identification to allow for arrays
isArrObj = ( obj ) -> (typeof obj is 'object')
isFunction = ( obj ) -> (typeof obj is 'function')
specialFunction = ( key, value ) -> (isFunction value) and (~FUNCTION_PROPS.indexOf key)
module.exports= freezeDeep= ( obj, recurse ) ->
# don't try to loop over a non-object/array
if recurse or (isArrObj obj) or (isFunction obj)
Object.freeze obj
for own key, value of obj
continue if (Object.isFrozen value)
if (isArrObj value) or (specialFunction key, value)
freezeDeep value, true
return obj | true | #
# A fast and type safe deep (recursive) object/array/function freeze
#
# MIT License
#
# Copyright (c) 2018 PI:NAME:<NAME>END_PI
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
FUNCTION_PROPS = [ 'caller', 'callee', 'arguments' ]
# use flawed 'object' identification to allow for arrays
isArrObj = ( obj ) -> (typeof obj is 'object')
isFunction = ( obj ) -> (typeof obj is 'function')
specialFunction = ( key, value ) -> (isFunction value) and (~FUNCTION_PROPS.indexOf key)
module.exports= freezeDeep= ( obj, recurse ) ->
# don't try to loop over a non-object/array
if recurse or (isArrObj obj) or (isFunction obj)
Object.freeze obj
for own key, value of obj
continue if (Object.isFrozen value)
if (isArrObj value) or (specialFunction key, value)
freezeDeep value, true
return obj |
[
{
"context": ".should.eql \"\"\"\n OMH,ONKCHhJmjadoA\n D,GeACHiN\n \"\"\"\n next()",
"end": 1005,
"score": 0.7251763343811035,
"start": 1000,
"tag": "NAME",
"value": "ACHiN"
}
] | tools/wise-simulator/node_modules/csv/node_modules/csv-stringify/test/api.pipe.coffee | homerquan/wise-stream | 3 |
fs = require 'fs'
should = require 'should'
generate = require 'csv-generate'
stringify = if process.env.CSV_COV then require '../lib-cov' else require '../src'
describe 'API pipe', ->
it 'pipe to destination', (next) ->
data = ''
generator = generate length: 2, objectMode: true, seed: 1, columns: 2
stringifier = stringify eof: false
ws = fs.createWriteStream '/tmp/large.out'
generator.pipe(stringifier).pipe(ws).on 'finish', ->
fs.readFile '/tmp/large.out', 'ascii', (err, data) ->
data.should.eql """
OMH,ONKCHhJmjadoA
D,GeACHiN
"""
fs.unlink '/tmp/large.out', next
it 'pipe from source', (next) ->
data = ''
generator = generate length: 2, objectMode: true, seed: 1, columns: 2
stringifier = generator.pipe stringify eof: false
stringifier.on 'readable', ->
while(d = stringifier.read())
data += d
stringifier.on 'finish', ->
data.should.eql """
OMH,ONKCHhJmjadoA
D,GeACHiN
"""
next() | 21479 |
fs = require 'fs'
should = require 'should'
generate = require 'csv-generate'
stringify = if process.env.CSV_COV then require '../lib-cov' else require '../src'
describe 'API pipe', ->
it 'pipe to destination', (next) ->
data = ''
generator = generate length: 2, objectMode: true, seed: 1, columns: 2
stringifier = stringify eof: false
ws = fs.createWriteStream '/tmp/large.out'
generator.pipe(stringifier).pipe(ws).on 'finish', ->
fs.readFile '/tmp/large.out', 'ascii', (err, data) ->
data.should.eql """
OMH,ONKCHhJmjadoA
D,GeACHiN
"""
fs.unlink '/tmp/large.out', next
it 'pipe from source', (next) ->
data = ''
generator = generate length: 2, objectMode: true, seed: 1, columns: 2
stringifier = generator.pipe stringify eof: false
stringifier.on 'readable', ->
while(d = stringifier.read())
data += d
stringifier.on 'finish', ->
data.should.eql """
OMH,ONKCHhJmjadoA
D,Ge<NAME>
"""
next() | true |
fs = require 'fs'
should = require 'should'
generate = require 'csv-generate'
stringify = if process.env.CSV_COV then require '../lib-cov' else require '../src'
describe 'API pipe', ->
it 'pipe to destination', (next) ->
data = ''
generator = generate length: 2, objectMode: true, seed: 1, columns: 2
stringifier = stringify eof: false
ws = fs.createWriteStream '/tmp/large.out'
generator.pipe(stringifier).pipe(ws).on 'finish', ->
fs.readFile '/tmp/large.out', 'ascii', (err, data) ->
data.should.eql """
OMH,ONKCHhJmjadoA
D,GeACHiN
"""
fs.unlink '/tmp/large.out', next
it 'pipe from source', (next) ->
data = ''
generator = generate length: 2, objectMode: true, seed: 1, columns: 2
stringifier = generator.pipe stringify eof: false
stringifier.on 'readable', ->
while(d = stringifier.read())
data += d
stringifier.on 'finish', ->
data.should.eql """
OMH,ONKCHhJmjadoA
D,GePI:NAME:<NAME>END_PI
"""
next() |
[
{
"context": "---------------------\n\n produce : () ->\n key = prng(16).toString 'hex'\n val = [ @_i++, key ]\n @_objs[key] = ",
"end": 375,
"score": 0.9615683555603027,
"start": 358,
"tag": "KEY",
"value": "prng(16).toString"
},
{
"context": "-\n\n produce : () ->\n k... | node_modules/merkle-tree/test/files/obj_factory.iced | AngelKey/Angelkey.nodeclient | 151 |
{prng} = require 'crypto'
exports.skip = true
#===============================================================
exports.ObjFactory = class ObjFactory
#----------------------------
constructor : () ->
@_objs = {}
@_i = 0
#----------------------------
dump_all : () -> @_objs
#----------------------------
produce : () ->
key = prng(16).toString 'hex'
val = [ @_i++, key ]
@_objs[key] = val
return { key, val }
#----------------------------
modify_some : (n = 2) ->
i = 0
for k,v of @_objs
if (i % n) is 0
v[0] *= 2
v[1] += "-yo-dawg"
i++
#===============================================================
| 99993 |
{prng} = require 'crypto'
exports.skip = true
#===============================================================
exports.ObjFactory = class ObjFactory
#----------------------------
constructor : () ->
@_objs = {}
@_i = 0
#----------------------------
dump_all : () -> @_objs
#----------------------------
produce : () ->
key = <KEY> '<KEY>'
val = [ @_i++, key ]
@_objs[key] = val
return { key, val }
#----------------------------
modify_some : (n = 2) ->
i = 0
for k,v of @_objs
if (i % n) is 0
v[0] *= 2
v[1] += "-yo-dawg"
i++
#===============================================================
| true |
{prng} = require 'crypto'
exports.skip = true
#===============================================================
exports.ObjFactory = class ObjFactory
#----------------------------
constructor : () ->
@_objs = {}
@_i = 0
#----------------------------
dump_all : () -> @_objs
#----------------------------
produce : () ->
key = PI:KEY:<KEY>END_PI 'PI:KEY:<KEY>END_PI'
val = [ @_i++, key ]
@_objs[key] = val
return { key, val }
#----------------------------
modify_some : (n = 2) ->
i = 0
for k,v of @_objs
if (i % n) is 0
v[0] *= 2
v[1] += "-yo-dawg"
i++
#===============================================================
|
[
{
"context": "entry = GG.LeaderboardEntry.create\n name: name\n score: score\n\n if not prevScoreNam",
"end": 60945,
"score": 0.7032814621925354,
"start": 60941,
"tag": "NAME",
"value": "name"
}
] | app/src/controllers.coffee | concord-consortium/genigames | 0 | minispade.require 'genigames/controller-mixins'
## Static variables ##
GG.BREED_AUTOMATED = "automated"
GG.BREED_CONTROLLED = "controlled"
GG.userController = Ember.Object.create
learnerDataUrl: (->
lid = @get('learnerId')
if lid?
GG.PORTAL_URL + '/dataservice/bucket_loggers/learner/' + lid + '/bucket_contents.bundle'
else
null
).property('learnerId')
user: null
state: null
learnerId: null
classWord: null
loaded: false
groupInfoSaved: false
learnerChanged: (->
# TODO update learner data
console.log 'learner changed: ', @get('learnerId')
@set('loaded', false)
$.getJSON(@get('learnerDataUrl'), (data) =>
@set('state', data)
@get('user').restoreState()
@set('loaded', true)
if (@get('user.codeName') == null)
@get('user').set 'codeName', GG.codeNameGenerator.generate()
).error =>
@set('state', null)
@set('loaded', true)
).observes('learnerId')
addReputation: (amt) ->
user = @get 'user'
return unless user
user.set 'reputation', user.get('reputation') + amt
evt = if GG.reputationController.get('swapChangedEarned') then GG.Events.REPUTATION_EARNED else GG.Events.REPUTATION_CHANGED
GG.logController.logEvent evt, amount: amt, result: user.get('reputation')
loadState: (type, obj)->
allState = @get('state')
if allState? and allState[type]? and allState[type][obj.get('_id')]?
return allState[type][obj.get('_id')]
else
return {}
stateQueue: []
stateQueueProcessing: false
saveState: (type, obj)->
stateQueue = @get('stateQueue')
stateQueue.push({type: type, obj: obj})
@processStateQueue() unless @get('stateQueueProcessing')
processStateQueue: ->
@set('stateQueueProcessing', true)
queue = @get('stateQueue')
allState = @get('state') || {}
while queue.length > 0
item = queue.shift()
type = item.type
obj = item.obj
allState[type] ||= {}
allState[type][obj.get('_id')] = obj.serialize()
@set('state', allState)
@set('stateQueueProcessing', false)
Ember.run.once this, "persistSaveState"
persistSaveState: ->
if @get('learnerDataUrl')?
allState = @get('state') || {}
$.post @get('learnerDataUrl'), JSON.stringify(allState), (data) =>
console.log 'state saved'
GG.townsController = Ember.ArrayController.create
content : []
currentTown: null
townToBeUnlocked: null
addTown: (town) ->
@pushObject town
currentTownIndex: (->
@indexOf(@get('currentTown'))
).property('currentTown')
firstIncompleteTown: (->
towns = @get('content')
for i in [0...(towns.length)]
t = towns[i]
return t unless t.get('completed')
).property('content')
setCurrentTown: (town, force=false) ->
@completeTownsThrough @indexOf(town) - 1 if force
return false if town is @currentTown
if @indexOf(town) >= 0
@set 'currentTown', town
GG.tasksController.reset()
for ts in town.get 'realTasks'
GG.tasksController.addTask ts
GG.logController.logEvent GG.Events.ENTERED_TOWN, name: town.get('name')
return true
else
throw "GG.townsController.setCurrentTown: argument is not a known town"
# loads a town by name or number
loadTown: (townName) ->
if (not isNaN parseInt(townName))
town = @get('content')[townName-1]
else
town = (town for town in @get('content') when town.get('name') == townName)[0]
@setCurrentTown(town, true) if town?
nextTownsCost: (->
nextTown = @indexOf(@get 'townToBeUnlocked')
previousTown = @get('content')[nextTown-1] unless !nextTown
if not previousTown then return 0
previousTown.get('completionCost')
).property('townToBeUnlocked')
canPayForNextTown: (->
nextTown = @indexOf(@get 'townToBeUnlocked')
previousTown = @get('content')[nextTown-1] unless !nextTown
if not previousTown then return false
if (previousTown.get('locked')) then return false
return (GG.userController.get('user.reputation') >= previousTown.get('completionCost'))
).property('townToBeUnlocked', 'GG.userController.user.reputation')
unlockTown: ->
town = @get 'townToBeUnlocked'
if not town then return
town.set 'locked', false
GG.logController.logEvent GG.Events.UNLOCKED_TOWN, name: town.get('name')
completeCurrentTown: ->
town = @get('currentTown')
town.set('completed', true)
GG.logController.logEvent GG.Events.COMPLETED_TOWN, name: town.get('name')
# 'completeTownsThrough 2' will complete towns 0,1,2
completeTownsThrough: (n) ->
for town, i in @get('content') when i <= n
town.set('completed', true)
town.set('locked', false)
GG.tasksController.completeAllTasksForTown town
if town = @get("content.#{n+1}")
town.set('locked', false)
GG.logController.logEvent GG.Events.COMPLETED_TOWN, name: ("Towns through #" + n)
# the total cost of all towns unlocked so far
unlockedTownsCost: (->
cost = 0
for town, i in @get('content')
if (nextTown = @get("content.#{i+1}")) and not nextTown.get('locked')
cost += town.get 'completionCost'
cost
).property('currentTown', 'GG.userController.user')
GG.tasksController = Ember.ArrayController.create
content : []
currentTask: null
taskStartTime: 0
reset: ->
@set 'content', []
@set 'currentTask', null
addTask: (task) ->
@pushObject task
setCurrentTask: (task, muteLog = false) ->
return if task is @get 'currentTask'
if @indexOf(task) >= 0
if GG.baselineController.get 'isBaseline'
task.set 'cyclesRemaining', 0
else
task.set 'cyclesRemaining', task.get 'cycles'
@set 'currentTask', task
for femaleAlleles in task.initialDrakes.females
org = BioLogica.Organism.createLiveOrganism GG.DrakeSpecies, femaleAlleles, BioLogica.FEMALE
GG.parentController.pushObject GG.Drake.createFromBiologicaOrganism org
for maleAlleles in task.initialDrakes.males
org = BioLogica.Organism.createLiveOrganism GG.DrakeSpecies, maleAlleles, BioLogica.MALE
GG.parentController.pushObject GG.Drake.createFromBiologicaOrganism org
unless muteLog
GG.logController.logEvent GG.Events.STARTED_TASK, name: task.get('name')
@set('taskStartTime', new Date().getTime())
else
throw "GG.tasksController.setCurrentTask: argument is not a known task"
setNextAvailableTask: (taskIndex) ->
tasks = @get('content')
@completeTasksThrough taskIndex - 1 if taskIndex < tasks.length
clearCurrentTask: ->
@set 'currentTask', null
GG.parentController.reset()
awardTaskReputation: (success) ->
task = @get 'currentTask'
isCourse = GG.obstacleCourseController.get 'hasObstacleCourse'
if isCourse
reputation = GG.obstacleCourseController.get 'reputationEarned'
else
reputation = task.get('reputation')
event = if (isCourse and !success) then GG.Events.INCOMPLETE_COURSE else GG.Events.COMPLETED_TASK
GG.reputationController.addReputation(reputation, event)
GG.reputationController.finalizeReputationForTaskRun()
return GG.reputationController.finalizeReputation()
completeCurrentTask: ->
task = @get 'currentTask'
task.set 'completed', true
# If the current task is not complete, that means completion was forced.
# A task with an obstacle course will do this when breeds remaining hits 0, for example.
reputation = @awardTaskReputation(@get('isCurrentTaskComplete'))
GG.logController.logEvent GG.Events.COMPLETED_TASK,
name: task.get('name')
breedCounter: GG.cyclesController.get('cycles')
elapsedTimeMs: (new Date().getTime()) - @get('taskStartTime')
reputationEarned: reputation
restartCurrentTask: ->
task = @get 'currentTask'
GG.reputationController.resetCurrent()
GG.logController.logEvent GG.Events.RESTARTED_TASK, name: task.get('name')
@clearCurrentTask()
@setCurrentTask(task)
@taskAccepted task
completeTasksThrough: (n) ->
for task, i in @get('content') when i <= n
task.set('completed', true)
powerups = task.get('powerups')
if powerups && powerups.length > 0
powerup = powerups[0]
GG.powerUpController.unlockPowerup(powerup)
GG.logController.logEvent GG.Events.COMPLETED_TASK, name: ("Tasks through #" + n)
completeAllTasksForTown: (town) ->
for task, i in town.get('realTasks')
task.set('completed', true)
powerups = task.get('powerups')
if powerups && powerups.length > 0
powerup = powerups[0]
GG.powerUpController.unlockPowerup(powerup)
GG.logController.logEvent GG.Events.COMPLETED_TASK, name: ("Completed all tasks for #{town.get('name')}")
currentLevelId: (->
task = @get('currentTask')
id = ""
if GG.baselineController.get('isBaseline')
if task and task.get('baselineName')
id = ": " + task.get 'baselineName'
else
if task
id = ": " + task.get 'name'
id = id.replace("Task", "Drake")
return id
).property('currentTask')
currentTargetTraits: (->
target = @get 'currentTask.targetDrake'
if target
target = target.replace(/, ?/g,"</li><li>")
new Handlebars.SafeString "<ul><li>" + target + "</li></ul>"
else ""
).property('currentTask')
targetCountBinding: Ember.Binding.oneWay('currentTask.targetCount')
matchCountBinding: Ember.Binding.oneWay('currentTask.matchCount')
showTaskDescription: (task) ->
@setCurrentTask task
otherTask.set('showQuestionBubble', false) for otherTask in GG.tasksController.content
task.set 'showSpeechBubble', true
showTaskEndMessage: (task) ->
if task.get('npc.speech.completionText')?
task.set 'isShowingEndMessage', true
task.set 'showSpeechBubble', true
else
GG.statemanager.send 'done'
showTaskThanksMessage: (task) ->
task.set 'isShowingThanksMessage', true
task.set 'isShowingFailMessage', false
task.set 'isShowingEndMessage', false
task.set 'showSpeechBubble', true
showTaskFailMessage: (task) ->
task.set 'isShowingThanksMessage', false
task.set 'isShowingEndMessage', false
task.set 'isShowingFailMessage', true
task.set 'showSpeechBubble', true
showTaskCompletion: (success) ->
if GG.baselineController.get('isNotBaseline') and GG.lastShownDialog?
try
GG.tutorialMessageController.set('finishButtonTutorialShown', true)
GG.lastShownDialog.qtip('hide')
catch e
GG.lastShownDialog = null
GG.statemanager.transitionTo 'inTown', [@get('currentTask'), success]
showTaskNonCompletion: ->
msg = "That's not the %@ you're looking for!".fmt(Ember.I18n.t('drake'))
msg += " You're trying to "
msg += (
@get('currentTask.npc.speech.shortText').toLowerCase() ||
("breed a drake with " + @get('currentTask.targetDrake') + ".")
).replace('drake', Ember.I18n.t('drake'))
GG.showModalDialog msg
taskAccepted: (task) ->
task.set 'showSpeechBubble', false
GG.statemanager.transitionTo 'inTask'
isCurrentTaskComplete: ->
task = @get 'currentTask'
drake = GG.breedingController.get 'child'
if not task? or not drake?
return false
# parse required characteristics
parsedCharacteristics = task.get('targetDrake').split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
if drake.hasCharacteristics(parsedCharacteristics)
task.set 'matchCount', (task.get 'matchCount')+1
return true if task.get('matchCount') >= task.get('targetCount')
return false
powerupsBinding: Ember.Binding.oneWay('GG.userController.user.powerups')
meiosisControlEnabled: (->
GG.powerUpController.hasPowerup("meiosis control") || !!@get('currentTask.meiosisControl')
).property('currentTask.meiosisControl', 'powerups.@each')
hasHiddenGenes: (->
hidden = @get 'currentTask.hiddenGenes'
if hidden? and hidden.length > 0
return true
else
return false
).property('currentTask.hiddenGenes')
baselineTaskReputation: (->
rep = 0
if @get('currentTask')?
cyclesUsed = @get('currentTask.cyclesRemaining')
cyclesAllowed = @get('currentTask.cycles')
if cyclesUsed < (cyclesAllowed/2)
rep = 100
else if cyclesUsed > (cyclesAllowed*2)
rep = 0
else
allowed = (cyclesAllowed*2)-(cyclesAllowed/2)
used = cyclesUsed - (cyclesAllowed/2)
remaining = allowed - used
rep = Math.floor(100*(remaining/allowed))
return rep
).property('currentTask','currentTask.cyclesRemaining')
updateHeartFills: ->
task.propertyDidChange('reputationEarned') for task in @get('content')
GG.drakeController = Ember.Object.create
visibleGenesBinding: 'GG.tasksController.currentTask.visibleGenes'
hiddenGenesBinding: 'GG.tasksController.currentTask.hiddenGenes'
GG.parentController = Ember.ArrayController.create
content: []
maxMales: 40
maxFemales: 40
selectedMother: null
selectedFather: null
reset: ->
@set 'selectedMother', null
@set 'selectedFather', null
@clear()
females: (->
drake for drake in @get('content') when drake.sex is GG.FEMALE
).property('content.@each')
males: (->
drake for drake in @get('content') when drake.sex is GG.MALE
).property('content.@each')
hasRoom: (drake) ->
if drake.sex is GG.MALE
return @get('males').length < @get 'maxMales'
else
return @get('females').length < @get 'maxFemales'
whosSelected: (->
mother = @get('selectedMother')
father = @get('selectedFather')
if mother or father
return "mother" unless father
return "father" unless mother
return "both"
return "none"
).property('selectedMother', 'selectedFather')
GG.fatherPoolController = Ember.ArrayController.create
contentBinding: 'GG.parentController.males'
selectedBinding: 'GG.parentController.selectedFather'
hidden: true
GG.motherPoolController = Ember.ArrayController.create
contentBinding: 'GG.parentController.females'
selectedBinding: 'GG.parentController.selectedMother'
hidden: true
# Fixme: This needs to be rethrought now that we will always only
# have one offspring. Maybe it can just be replaced by breedingController.child
GG.offspringController = Ember.Object.create
content: null
hidden: false
selectedBinding: 'content'
GG.breedingController = Ember.Object.create
motherBinding: 'GG.parentController.selectedMother'
fatherBinding: 'GG.parentController.selectedFather'
isShowingBreeder: false
isShowingBreeder2: false # stupid stupid Ember...
isBreeding: false
breedType: GG.BREED_AUTOMATED
child: null
childSavedToParents: false
breedDrake: ->
if (@get('mother') && @get('father')) || GG.meiosisController.get('chosenAlleles')?
@set 'isBreeding', true
org = null
if GG.meiosisController.get('chosenAlleles')?
org = BioLogica.Organism.createOrganism(GG.DrakeSpecies, GG.meiosisController.get('chosenAlleles'), GG.meiosisController.get('chosenSex'))
else
org = BioLogica.breed @get('mother.biologicaOrganism'), @get('father.biologicaOrganism')
drake = GG.Drake.createFromBiologicaOrganism org
drake.set 'bred', true
if GG.meiosisController.get('chosenAlleles')?
revealed = GG.meiosisController.get('chosenRevealedAlleles')
for r in [0...revealed.length]
rev = revealed[r]
drake.markRevealed(rev.side, rev.allele)
GG.breedingController.set 'child', drake
GG.offspringController.set 'content', drake
Ember.run.next ->
GG.statemanager.send 'showOffspring'
@set 'isBreeding', false
GG.logController.logEvent GG.Events.BRED_DRAGON,
mother: @get('mother.biologicaOrganism.alleles')
father: @get('father.biologicaOrganism.alleles')
offspring: drake.get('biologicaOrganism.alleles')
offspringSex: drake.get('sex')
GG.cyclesController = Ember.Object.create
cyclesBinding: 'GG.tasksController.currentTask.cyclesRemaining'
increment: (amt=1) ->
@set 'cycles', @get('cycles')+amt
decrement: (amt=1) ->
cycles = @get 'cycles'
return if cycles <= 0
@set 'cycles', cycles-amt
reset: ->
setTimeout =>
@updateCounter()
, 1000
updateCounter: (->
cycles = @get 'cycles'
return if cycles < 0
hundreds = Math.floor(cycles / 100) % 10
$('#moveCounterHundreds').animate({backgroundPosition: @getPosition(hundreds)}, 200)
tens = Math.floor(cycles / 10) % 10
$('#moveCounterTens').animate({backgroundPosition: @getPosition(tens)}, 200)
ones = cycles % 10
$('#moveCounterOnes').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('cycles')
getPosition: (num) ->
pos = num * 26
"(0px -" + pos + "px)"
GG.logController = Ember.Object.create
learnerIdBinding: 'GG.userController.learnerId'
learnerLogUrl: (->
lid = @get('learnerId')
if lid?
GG.PORTAL_URL + '/dataservice/bucket_loggers/learner/' + lid + '/bucket_log_items.bundle'
else
null
).property('learnerId')
learnerLogUrlChanged: (->
if @get('learnerLogUrl')?
@processEventQueue()
).observes('learnerLogUrl')
syncTime: new SyncTime(GG.PORTAL_URL + '/time')
session: null
eventQueue: []
eventQueueInProgress: []
triedToEmptyEventQueue: false
startNewSession: ->
@set('session', @generateGUID())
@logEvent GG.Events.STARTED_SESSION
@startEventQueuePolling()
startEventQueuePolling: ->
setInterval =>
@processEventQueue() unless @eventQueueInProgress.length > 0
, 10000
processEventQueue: ->
if @get('triedToEmptyEventQueue') and @eventQueue.length is 0
# we had lost connection but now we have regained it
@set 'triedToEmptyEventQueue', false
GG.statemanager.send 'notifyConnectionRegained'
if @get('learnerLogUrl')? and @eventQueue.length > 0
# a previous save event failed, so we have events in our queue
if @get('triedToEmptyEventQueue')
# we already tried to empty event queue once and we didn't succeed
GG.statemanager.send 'notifyConnectionLost'
@set 'triedToEmptyEventQueue', true
@eventQueueInProgress = @eventQueue.slice(0)
@eventQueue = []
while @eventQueueInProgress.length > 0
evt = @eventQueueInProgress.shift()
@persistEvent(evt)
logEvent: (evt, params) ->
date = @syncTime.now()
logData =
session : @get('session')
time : date.getTime()
prettyTime : date.toString()
internetTime: date.toInternetTime(2)
timeDrift : @syncTime.drift
event : evt
parameters : params
@persistEvent logData
persistEvent: (evt)->
if @get('learnerLogUrl')?
$.post(@get('learnerLogUrl'), JSON.stringify(evt), (data)->
console.log 'log event saved'
).error =>
console.log 'log event save failed!'
@eventQueue.push evt
else
console.log 'log event generated (no save)', evt
@eventQueue.push evt
generateGUID: ->
S4 = -> (((1+Math.random())*0x10000)|0).toString(16).substring(1)
S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()
GG.sessionController = Ember.Object.create
checkTokenUrl: GG.PORTAL_URL + '/verify_cc_token'
loginUrl: GG.PORTAL_URL + '/remote_login'
logoutUrl: GG.PORTAL_URL + '/remote_logout'
userBinding: 'GG.userController.user'
loadedBinding: 'GG.userController.loaded'
error: false
loggingIn: false
firstTime: true
registrationError: false
registrationErrorMessage: null
preloadingComplete: false
waitingForPreload: false
registeredUsername: null
loggedIn: (->
@get('user') != null
).property('user')
classesWithLearners: (->
found = []
classes = @get('user.classes')
if classes? and classes.length > 0
for i in [0...(classes.length)]
cl = classes[i]
if cl? and cl.learner? and cl.learner > 0
cl.label = cl.name + " (" + cl.teacher + ")"
found.push(cl)
return found
).property('user')
checkCCAuthToken: ->
$.ajax
type: "GET"
url: @checkTokenUrl
xhrFields:
withCredentials: true
success: (data) =>
if data.error?
@set('error', true)
@set('loggingIn', false)
else
user = GG.User.create data
@set('user', user)
GG.statemanager.send 'successfulLogin'
error: =>
@set('loggingIn', false)
@set('error', true)
setTimeout ->
if username = GG.sessionController.get 'registeredUsername'
$('#username-field input').attr 'value', username
, 50
loginPortal: (username, password)->
@set('firstTime', false)
$.ajax
type: "POST"
url: @loginUrl
data: "login=#{username}&password=#{password}"
dataType: "application/x-www-form-urlencoded"
xhrFields:
withCredentials: true
success: (data) =>
@checkCCAuthToken()
error: =>
# unsure why we get 'error' even when request returns 200
@checkCCAuthToken()
logoutPortal: ->
@set('firstTime', true)
@set('user', null)
@set('loaded', false)
@set('loggingIn', false)
GG.userController.set('classWord', null)
GG.userController.set('learnerId', null)
GG.tasksController.set('content',[])
GG.townsController.set('content',[])
GG.leaderboardController.set('content',[])
$.ajax
type: "POST"
url: @logoutUrl
xhrFields:
withCredentials: true
complete: =>
GG.statemanager.transitionTo 'loggingIn'
GG.actionCostsController = Ember.Object.create
getCost: (action) ->
level = GG.townsController.get('currentTownIndex')
pts = [].concat @get('content.'+action)
if level >= pts.length
level = (pts.length - 1) # the final value is used for all remaining levels
pts[level] || 0
GG.meiosisController = Ember.Object.create
canBreedDuringAnimation: true
speedControlEnabled: (->
# enable on town 1 task 7
townId = 1 + GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = 1 + GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId*10 + taskId >= 17
).property('GG.townsController.currentTown', 'GG.tasksController.currentTask')
inAnimation: false
motherView: null
fatherView: null
firstView: null
secondView: null
motherGameteNumberBinding: 'motherView.randomGameteNumberOverride'
fatherGameteNumberBinding: 'fatherView.randomGameteNumberOverride'
chosenMotherAllelesBinding: 'motherView.chosenGameteAlleles'
chosenFatherAllelesBinding: 'fatherView.chosenGameteAlleles'
chosenMotherGameteBinding: 'motherView.chosenGamete'
chosenFatherGameteBinding: 'fatherView.chosenGamete'
chosenSexBinding: 'fatherView.chosenSex'
firstParent: null
secondParent: null
selectFirstParent: (parent, force) ->
return if @get('inAnimation') unless force
@set 'firstParent', parent
@set 'secondParent', (if parent is "mother" then "father" else "mother")
if !parent?
@set 'firstView', null
@set 'secondView', null
else if parent is "mother"
@set 'firstView', @get 'motherView'
@set 'secondView', @get 'fatherView'
else
@set 'firstView', @get 'fatherView'
@set 'secondView', @get 'motherView'
if @get 'waitingForParentSelection'
@animate()
chosenAlleles: (->
return @get('chosenMotherAlleles') + "," + @get('chosenFatherAlleles')
).property('chosenMotherAlleles','chosenFatherAlleles')
chosenRevealedAlleles: (->
femGam = @get 'chosenMotherGamete'
maleGam = @get 'chosenFatherGamete'
res = []
for own ch of maleGam
rev = maleGam[ch].revealed || []
for i in [0...rev.length]
res.push {allele: rev[i], side: 'b'}
for own ch of femGam
rev = femGam[ch].revealed || []
for i in [0...rev.length]
res.push {allele: rev[i], side: 'a'}
return res
).property('chosenMotherGamete','chosenFatherGamete')
animate: (callback)->
if @get('firstView')? and @get('secondView')?
@set 'waitingForParentSelection', false
@set('inAnimation', true)
$(".parent-select-target").removeClass("active")
GG.tutorialMessageController.showMeiosisTutorial @get('firstParent'), =>
@get('firstView').animate =>
@get('secondView').animate =>
GG.MeiosisAnimation.mergeChosenGametes("#" + @get('fatherView.elementId'), "#" + @get('motherView.elementId'), =>
@set('inAnimation', false)
if callback
callback()
else @get('delayedCallback')()
)
else
@set 'waitingForParentSelection', true
@set 'delayedCallback', callback
resetAnimation: ->
if @get('motherView')? and @get('fatherView')?
@selectFirstParent(null, true)
@get('motherView').resetAnimation()
@get('fatherView').resetAnimation()
@set('selectedChromosomes', { father: {}, mother: {}})
@set('chromosomeSelected', false)
@set('selectedCrossover', null)
@set('crossoverSelected', false)
@set('inAnimation', false)
@set('motherGameteNumber', -1)
@set('fatherGameteNumber', -1)
chromosomeSelected: false
selectedChromosomes: { father: {}, mother: {}}
deselectChromosome: (chromoView) ->
selected = @get('selectedChromosomes')
source = if chromoView.get('content.sex') == GG.MALE then "father" else "mother"
chromo = chromoView.get('chromo')
chromo = "XY" if chromo is "X" or chromo is "Y"
chromoView.set('selected', false)
selected[source][chromo] = null
# Refund the reputation that was charged to select this chromosome
GG.reputationController.addReputation(GG.actionCostsController.getCost('chromosomeSelected'), GG.Events.CHOSE_CHROMOSOME)
clearNum = true
for own chrom,view of selected[source]
clearNum = false if view?
if clearNum
gameteNumberProp = if source is "father" then 'fatherGameteNumber' else 'motherGameteNumber'
@set(gameteNumberProp, -1)
# TODO We should probably revert any cell num swaps that happened on selection, so the user can't
# cheat by selecting and then deselecting and having them move to the same gamete anyway
selectChromosome: (chromoView) ->
@set('chromosomeSelected', true)
selected = @get('selectedChromosomes')
source = if chromoView.get('content.sex') == GG.MALE then "father" else "mother"
chromo = chromoView.get('chromo')
chromo = "XY" if chromo is "X" or chromo is "Y"
if selected[source][chromo]?
selected[source][chromo].set('selected', false)
else
# There was no previously selected chromosome, so charge rep points
GG.reputationController.subtractReputation(GG.actionCostsController.getCost('chromosomeSelected'), GG.Events.CHOSE_CHROMOSOME)
selected[source][chromo] = chromoView
gameteNumberProp = if source is "father" then 'fatherGameteNumber' else 'motherGameteNumber'
destGameteNum = @get(gameteNumberProp)
sourceGameteNum = chromoView.get('cellNum')
if destGameteNum == -1
@set(gameteNumberProp, sourceGameteNum)
else
# if the selected chromosome is *not* in the to-be-selected gamete, move it into it
if sourceGameteNum != destGameteNum
Ember.run =>
# get the gametes
gametes = if source is "father" then @get('fatherView.gametes') else @get('motherView.gametes')
# swap the source chromo and the destination chromo
destChromo = gametes.cells[destGameteNum][chromo]
gametes.cells[destGameteNum][chromo] = gametes.cells[sourceGameteNum][chromo]
gametes.cells[sourceGameteNum][chromo] = destChromo
# swap the endCellInfo numbers
destRealSide = ''
sourceRealSide = ''
for own side,num of gametes.endCellInfo[chromo]
sourceRealSide = side if num == sourceGameteNum
destRealSide = side if num == destGameteNum
gametes.endCellInfo[chromo][sourceRealSide] = destGameteNum
gametes.endCellInfo[chromo][destRealSide] = sourceGameteNum
if source is "father"
@set('fatherView.gametes', $.extend(true, {}, gametes))
@get('fatherView').notifyPropertyChange('gametes')
else
@set('motherView.gametes', $.extend(true, {}, gametes))
@get('motherView').notifyPropertyChange('gametes')
visibility: (chromoView, allele)->
if chromoView.get('visibleAlleles').indexOf(allele) != -1
return 'visible'
if chromoView.get('hiddenAlleles').indexOf(allele) != -1
return 'hidden'
else
return 'invisible'
crossoverSelected: false
selectedCrossover: null
selectCrossover: (destCross)->
@set('crossoverSelected', true)
# get the gene for this allele
gene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, destCross.allele)
destCross.gene = gene
source = if destCross.chromoView.get('content.sex') == GG.MALE then "father" else "mother"
meiosisView = @get(source + 'View')
parentSelector = '#' + meiosisView.get('elementId')
# Highlight the valid second choices, by removing 'clickable' on invalid ones
leftRight = destCross.chromoView.get('right')
points = parentSelector + ' .crossoverPoint:not(.' + gene.name + ')'
points2 = parentSelector + ' .' + leftRight + ' .crossoverPoint.' + gene.name
$(points).removeClass('clickable').addClass('hidden')
$(points2).removeClass('clickable').addClass('hidden')
# mark this one as selected
$('#' + destCross.chromoView.get('elementId') + ' .crossoverPoint.' + gene.name).removeClass('hidden').addClass('selected')
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step1").addClass('hidden')
$(parentSelector + " .crossoverSelection .step2").removeClass('hidden')
if @get('selectedCrossover')?
sourceCross = @get('selectedCrossover')
if sourceCross.gene.name == destCross.gene.name and sourceCross.chromoView.get('side') != destCross.chromoView.get('side')
GG.reputationController.subtractReputation(GG.actionCostsController.getCost('crossoverMade'), GG.Events.MADE_CROSSOVER)
# cross these two
$('#' + destCross.chromoView.get('elementId') + ' .crossoverPoint.' + gene.name).removeClass('clickable').addClass('selected')
# get all genes after this one
genesToSwap = [gene]
allelesToSwap = [
{
gene: sourceCross.gene,
source: sourceCross.allele,
sourceVisibility: @visibility(sourceCross.chromoView, sourceCross.allele)
dest: destCross.allele
destVisibility: @visibility(destCross.chromoView, destCross.allele)
}
]
for allele in sourceCross.chromoView.get('alleles')
alGene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, allele.allele)
if alGene.start > sourceCross.gene.start
genesToSwap.push(alGene)
allelesToSwap.push
gene: alGene
source: allele.allele
sourceVisibility: @visibility(sourceCross.chromoView, allele.allele)
for allele in destCross.chromoView.get('alleles')
alGene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, allele.allele)
if alGene.start > sourceCross.gene.start
allelesToSwap.map (item)=>
if item.gene.name == alGene.name
item.dest = allele.allele
item.destVisibility = @visibility(destCross.chromoView, allele.allele)
return item
GG.logController.logEvent GG.Events.MADE_CROSSOVER,
sourceChromo:
drake: if sourceCross.chromoView.get('content.female') then "mother" else "father"
side: sourceCross.chromoView.get('side')
chromo: sourceCross.chromoView.get('chromo')
sister: sourceCross.chromoView.get('sister')
destinationChromo:
drake: if destCross.chromoView.get('content.female') then "mother" else "father"
side: destCross.chromoView.get('side')
chromo: destCross.chromoView.get('chromo')
sister: destCross.chromoView.get('sister')
allelesToSwap: allelesToSwap
# swap them visually
sourceCell = sourceCross.chromoView.get('cellNum')
destCell = destCross.chromoView.get('cellNum')
moves = {}
for swapGene in genesToSwap
moves[swapGene.name] ?= {}
moves[swapGene.name][sourceCell] = destCell
moves[swapGene.name][destCell] = sourceCell
meiosisView.animateMoves moves, =>
# swap them in the gametes.cells
gametes = meiosisView.get('gametes')
chromo = sourceCross.chromoView.get('chromo')
chromo = 'XY' if chromo is 'X'
for swapAlleles in allelesToSwap
alleles = gametes.cells[sourceCell][chromo].alleles.without(swapAlleles.source)
alleles.push(swapAlleles.dest)
gametes.cells[sourceCell][chromo].alleles = alleles
alleles = gametes.cells[destCell][chromo].alleles.without(swapAlleles.dest)
alleles.push(swapAlleles.source)
gametes.cells[destCell][chromo].alleles = alleles
# also swap revealed status
sourceRevealed = gametes.cells[sourceCell][chromo].revealed || []
destRevealed = gametes.cells[destCell][chromo].revealed || []
isSourceRevealed = sourceRevealed.indexOf(swapAlleles.source) != -1
isDestRevealed = destRevealed.indexOf(swapAlleles.dest) != -1
# remove them both first, then insert them second.
# this way we avoid problems if the alleles are the same.
if isSourceRevealed
sourceRevealed = sourceRevealed.without(swapAlleles.source)
if isDestRevealed
destRevealed = destRevealed.without(swapAlleles.dest)
if isSourceRevealed
destRevealed.push(swapAlleles.source)
if isDestRevealed
sourceRevealed.push(swapAlleles.dest)
if isSourceRevealed or isDestRevealed
gametes.cells[sourceCell][chromo].revealed = sourceRevealed
gametes.cells[destCell][chromo].revealed = destRevealed
meiosisView.set('gametes', $.extend(true, {}, gametes))
meiosisView.notifyPropertyChange('gametes')
# update the step-by-step directions
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step2").addClass('hidden')
$(parentSelector + " .crossoverSelection .step3").removeClass('hidden')
@clearCrossPoints(meiosisView)
else if sourceCross.chromoView == destCross.chromoView
# deselect this cross point
@clearCrossPoints(meiosisView)
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step2").addClass('hidden')
$(parentSelector + " .crossoverSelection .step1").removeClass('hidden')
else
console.log("invalid second cross point!")
else
@set('selectedCrossover', destCross)
clearCrossPoints: (meiosisView)->
# clear the saved cross point
@set('selectedCrossover', null)
Ember.run.next ->
parentSelector = '#' + meiosisView.get('elementId')
selector = parentSelector + ' .crossoverPoint'
$(selector).addClass('clickable')
$(selector).removeClass('hidden')
$(selector).removeClass('selected')
GG.OBSTACLE_COURSE_INTERNAL = "obstacle_course_internal"
GG.OBSTACLE_COURSE_EXTERNAL = "obstacle_course_external"
GG.obstacleCourseController = Ember.Object.create
courseBinding: 'GG.tasksController.currentTask.obstacleCourse'
obstaclesBinding: 'course.obstacles'
drakeBinding: 'GG.offspringController.content'
breedsLeftBinding: 'GG.cyclesController.cycles'
taskComplete: (->
GG.tasksController.isCurrentTaskComplete()
).property('drake')
obstaclesPassed: 0
dialogVisible: false
currentObstacleIndex: 0
currentObstacle: null
mode: GG.OBSTACLE_COURSE_INTERNAL
hasObstacleCourse: (->
@get('course')? && GG.baselineController.get('isNotBaseline')
).property('course')
setFirstObstacle: (->
@set 'currentObstacle', @get('obstacles')?[0]
).observes 'obstacles'
setCurrentObstacle: (->
index = @get 'currentObstacleIndex'
@set 'currentObstacle', @get('obstacles')?[index]
).observes 'currentObstacleIndex'
goToNextObstacle: ->
nextIndex = @get('currentObstacleIndex')+1
@set 'currentObstacleIndex', nextIndex
showInfoDialog: ->
if not GG.tasksController.isCurrentTaskComplete()
text = "Uh oh, you're out of breeds! You're going to have to send this Drake to
the obstacle course. Good luck!"
else
breedsLeft = @get 'breedsLeft'
num = "no, one, two, three, four, five, six, seven, eight, nine, ten".split(", ")[breedsLeft]
s = if breedsLeft is 1 then "" else "s"
text = "Great job, I think this Drake will do well in the obstacle course!
Because you had #{num} breed#{s} remaining, your Drake "
text +=
if breedsLeft then "will be trained #{num} time#{s} before the course,
which will make it even faster!"
else "won't be trained before the course."
GG.showModalDialog text, -> GG.statemanager.send "startCourse"
reputationEarned: (->
return 0 unless @get('course')?
taskRep = GG.tasksController.get 'currentTask.reputation'
if not taskRep? then return null
taskComplete = @get 'taskComplete'
if taskComplete
training = @get 'breedsLeft'
# earn 10 points per breed left
return taskRep + (training * GG.actionCostsController.getCost('cycleRemainingBonus'))
else
# earn 10% of repuation per obstacle passed
# this calculation is ugly...
if @get('obstacles') && @get('obstacles').length > 0
@set 'obstaclesPassed', 0
for obstacle in @get('obstacles')
@calculateTime(obstacle, false)
passed = @get 'obstaclesPassed'
return Math.round taskRep * passed * 0.1
else
# we have an obstacle course with no obstacles (aka the tournament)
# calculate the score based on the number of matching traits
task = GG.tasksController.get 'currentTask'
drake = GG.breedingController.get 'child'
if not task? or not drake?
return Math.round(taskRep * 0.5)
# parse required characteristics
parsedCharacteristics = task.get('targetDrake').split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
matchedChars = drake.hasHowManyCharacteristics(parsedCharacteristics)
modifiers = [0, 0.2, 0.4, 0.6, 0.7, 1.0]
if matchedChars >= modifiers.length
matchedChars = modifiers.length - 1
return Math.round taskRep * modifiers[matchedChars]
).property('drake', 'obstaclesPassed')
myTotalTime: (->
return 0 unless @get('course')? and @get('obstacles')?
total = 0
for obstacle in @get('obstacles')
total += @calculateTime(obstacle, false)
return total
).property('course','breedsLeft','obstacles', 'drake')
opponentTotalTime: (->
return 0 unless @get('course')? and @get('obstacles')?
total = 0
for obstacle in @get('obstacles')
total += @calculateTime(obstacle, true)
return Math.round total
).property('course','opponentBreedsLeft','obstacles')
didPassObstacle: (obstacle=@get('currentObstacle')) ->
drake = @get 'drake'
target = obstacle.target
parsedCharacteristics = target.split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
drake.hasCharacteristics(parsedCharacteristics)
calculateTime: (obstacle, opponent=false)->
obsTime = obstacle.time || 1
# opponent always goes 10% slower
if opponent then return obsTime * 1.1
drake = @get 'drake'
target = obstacle.target
return 0 unless drake
return 1 unless target
unless @didPassObstacle obstacle
# failure
return obsTime * 4
@set 'obstaclesPassed', @get('obstaclesPassed') + 1
training = @get 'breedsLeft'
speedup = Math.pow(0.9, training) # reduce speed by 10% for each training cycle
return Math.round obsTime * speedup
GG.baselineController = Ember.Object.create
isBaseline: false
isNotBaseline: Ember.computed.not('isBaseline')
GG.tutorialMessageController = Ember.Object.create
enabled: true
isFirstTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId+taskId is 0
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisDescriptionTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId is 0 and taskId is 1
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
# TODO There should be a better way to detect this other than hard-coding it...
isFirstMeiosisControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 4) or (GG.baselineController.get('isBaseline') and townId is 1 and taskId is 0)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisGenderControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 6)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisSpeedControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 6)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstBackcrossTask: (->
GG.tasksController.get("currentTask.powerups.0.name") is "backcrossing"
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
traitBarTutorialShown: false
showTraitBarTutorial: ->
if @get('isFirstTask') and !@get 'traitBarTutorialShown'
setTimeout =>
GG.statemanager.send 'waitForTraitSelection'
, 200
@set 'traitBarTutorialShown', true
GG.showInfoDialog $('#trait-selection-tutorial-target'),
"Use the Trait Tracker to remember the traits you need. Atheena has asked for
a %@1 with wings. To move ahead, click wings now.".fmt(Ember.I18n.t('drake')),
target: "bottomMiddle"
tooltip: "topMiddle"
hideButton: true
firstDrakeSelected: false
showFirstDrakeSelectionTutorial: (parent) ->
if @get('isFirstTask') and !@get 'firstDrakeSelected'
target = if parent is "mother" then "topMiddle" else "bottomMiddle"
tooltip = if parent is "mother" then "bottomMiddle" else "topMiddle"
@set 'firstDrakeSelected', true
GG.showInfoDialog $("##{parent}-chromosome"),
'These are the %@1\'s chromosomes. Here, the gene for Wings is shown: <span style="position: relative;">
<img src="../images/allele-bg.png" style="position: absolute; top: -6px; left: 3px">
<span style="position: absolute; top: 0; left: 6px; font-weight: bold;" class="dominant">
W1</span></span>'.fmt(Ember.I18n.t('drake')),
target: target
tooltip: tooltip
meiosisSelectionTutorialShown: false
showMeiosisSelectionTutorial: ->
if @get('isFirstTask') and !@get 'meiosisSelectionTutorialShown'
@set 'meiosisSelectionTutorialShown', true
GG.showInfoDialog $('.father .mainCell'),
"To start meiosis, click on the mother or the father, or click on the chromosomes",
target: "rightBottom"
tooltip: "leftTop"
hideTip: true
showMaleParentsTutorial: ->
GG.showInfoDialog $("#male-parents-tutorial-target"),
"Here are the male parent %@1s.
Choose one for breeding now.".fmt(Ember.I18n.t('drake')),
target: "rightMiddle"
tooltip: "leftMiddle"
hideButton: true
showFemaleParentsTutorial: ->
GG.showInfoDialog $("#female-parents-tutorial-target"),
"Here are the female parent %@1s.
Choose one for breeding now.".fmt(Ember.I18n.t('drake')),
target: "rightMiddle"
tooltip: "leftMiddle"
hideButton: true
breedButtonTutorialShown: false
speedTutorialShown: false
motherBinding: 'GG.parentController.selectedMother'
fatherBinding: 'GG.parentController.selectedFather'
bothParentsSelected: (->
@get('mother')? and @get('father')?
).property('mother','father')
showBreedButtonTutorial: ->
if @get('isFirstTask') and !@get('breedButtonTutorialShown') and @get 'bothParentsSelected'
@set 'breedButtonTutorialShown', true
GG.showInfoDialog $("#breed-button"),
"Good job! Notice that males have beards and females don't.
Next, hit the Breed button to create the child.",
target: "leftMiddle"
tooltip: "rightMiddle"
else if @get('isFirstMeiosisSpeedControlTask') and !@get('speedTutorialShown') and @get 'bothParentsSelected'
@set 'speedTutorialShown', true
GG.showInfoDialog $('#meiosis-speed-slider'),
"Use this to control the speed of meiosis.",
target: "leftMiddle"
tooltip: "rightMiddle"
meiosisTutorialShown: false
meiosisTutorial2Shown: false
showMeiosisTutorial: (parent, callback)->
GG.hideInfoDialogs()
if @get('isFirstMeiosisDescriptionTask') and !@get('meiosisTutorialShown')
@set 'meiosisTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.#{parent}"),
"This is meiosis, the method by which half of a parent's genes are passed to the offspring.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback() if callback?
meiosisGenderTutorialShown: false
showMeiosisGenderTutorial: ->
if @get('isFirstMeiosisGenderControlTask') and !@get('meiosisGenderTutorialShown')
@set 'meiosisGenderTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.father"),
"Hint: When you need to control the sex of the offspring drake, use the father's X and Y chromosomes.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
modal: false
meiosisGameteTutorialShown: false
showMeiosisGameteTutorial: (callback, parent) ->
if @get('isFirstMeiosisDescriptionTask') and !@get 'meiosisGameteTutorialShown'
@set 'meiosisGameteTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.#{parent}"),
"Meiosis produces four gamete cells. Each gamete has one chromosome from each pair.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback()
meiosisFertilizationTutorialShown: false
showMeiosisFertilizationTutorial: (callback) ->
if @get('isFirstMeiosisDescriptionTask') and !@get('meiosisFertilizationTutorialShown')
@set 'meiosisFertilizationTutorialShown', true
GG.showInfoDialog $("#meiosis-container"),
"Fertilization is when a sperm and egg cell fuse. The fertilized cell then divides many times to develop into an individual."
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback()
finishButtonTutorialShown: false
showFinishButtonTutorial: ->
if @get('isFirstTask') and !@get('finishButtonTutorialShown')
@set 'finishButtonTutorialShown', true
GG.showInfoDialog $("#offspring-buttons .offspring-buttons-use"),
"When you have a %@1 that matches the task, hit Ready to Sell to
end breeding and sell the %@1 to Athena.".fmt(Ember.I18n.t('drake'))
target: "leftMiddle"
tooltip: "rightMiddle"
backcrossButtonTutorialShown: false
showBackcrossButtonTutorial: ->
if @get('isFirstBackcrossTask') and !@get('backcrossButtonTutorialShown')
@set 'backcrossButtonTutorialShown', true
GG.showInfoDialog $("#offspring-buttons .offspring-buttons-save"),
"You can now Backcross using any %@1 you breed. Click this button to
put the current offspring %@1 into a parent pool, then go back and
select it to breed.".fmt(Ember.I18n.t('drake'))
target: "leftMiddle"
tooltip: "rightMiddle"
GG.powerUpController = Ember.Object.create
powerup: {}
unlockPowerup: (powerup) ->
user = GG.userController.get 'user'
return unless user
powerups = user.get 'powerups'
powerups.pushObject(powerup.name) unless powerups.indexOf(powerup.name) != -1
@set 'powerupChanged', @get('powerupChanged') + 1
hasPowerup: (name) ->
user = GG.userController.get 'user'
return user && user.get('powerups').indexOf(name) != -1
powerupChanged: 0
GG.QTipStyle =
width:
max: 350
padding: '14px',
border:
width: 1
radius: 5
color: '#4e8da6'
name: 'light'
GG.lastShownDialog = null
GG.showInfoDialog = ($elem, text, opts={}) ->
opts.target ?= "leftMiddle"
opts.tooltip ?= "rightMiddle"
opts.maxWidth ?= 350
opts.modal ?= false
opts.modalFade ?= false
opts.buttonText ?= 'OK'
style = Ember.copy GG.QTipStyle, true
style.tip = opts.tooltip
if opts.hideTip
style.tip = false
if opts.hideButton
opts.buttonText = false
style.width =
max: opts.maxWidth
config =
content:
title:
text: '',
button: opts.buttonText
text: text
position:
corner:
target: opts.target
tooltip: opts.tooltip
show:
ready: true
solo: true
when: false
hide: false
style: style
if opts.hideAction?
config.api =
onHide: opts.hideAction
if opts.modal
backdrop = if opts.modalFade then "#modal-backdrop-fade" else "#modal-backdrop-clear"
config.api ?= {}
config.api.beforeShow = ->
$(backdrop).fadeIn(@options.show.effect.length)
config.api.beforeHide = ->
$(backdrop).fadeOut(@options.show.effect.length)
GG.lastShownDialog = $elem
$elem.qtip config
$elem.bind 'hide', ->
$(this).qtip('hide')
GG.showChainedInfoDialog = ($elem, textArr, opts={}) ->
opts.finalCallback = opts.hideAction unless opts.finalCallback?
text = textArr[0]
textArr = textArr.splice(1)
if textArr.length
opts.hideAction = ->
GG.showChainedInfoDialog $elem, textArr, opts
GG.showInfoDialog $elem, text, opts
else
opts.hideAction = opts.finalCallback
GG.showInfoDialog $elem, text, opts
GG.showModalDialog = (text, hideAction) ->
body = $('body')
GG.lastShownDialog = body
body.qtip
content:
title:
text: '',
button: 'OK'
text: text
position:
target: $(document.body)
corner: 'center'
show:
ready: true
solo: true
when: false
hide: false
style: GG.QTipStyle
api:
onHide: hideAction
beforeShow: ->
$('#modal-backdrop-fade').fadeIn(@options.show.effect.length)
beforeHide: ->
$('#modal-backdrop-fade').fadeOut(@options.show.effect.length)
GG.hideInfoDialogs = ->
$('.qtip').qtip('hide')
GG.reputationController = Ember.Object.create
swapChangedEarned: false
showTotal: true
reset: (->
@set('bestTaskReputation', Number.NEGATIVE_INFINITY)
@set('bestTaskReputationReasons', {})
@resetCurrent()
)
resetCurrent: ->
@set('currentTaskReputation', 0)
@set('currentTaskReputationReasons', {})
bestTaskReputationBinding: 'GG.tasksController.currentTask.reputationEarned'
bestTaskReputationReasons: {}
bestTaskReputationDisplay: (->
best = @get('bestTaskReputation')
if best < 0 then 0 else best
).property('bestTaskReputation')
currentTaskReputation: 0
currentTaskReputationReasons: {}
addReputation: (rep, reason)->
reasons = @get 'currentTaskReputationReasons'
current_rep = @get 'currentTaskReputation'
reasons[reason] ||= 0
reasons[reason] += rep
current_rep += rep
@set('currentTaskReputationReasons', reasons)
@set('currentTaskReputation', current_rep)
subtractReputation: (rep, reason)->
@addReputation(-rep, reason)
# ensure "current" rep for task is valid
finalizeReputationForTaskRun: ->
current = @get 'currentTaskReputation'
@set 'currentTaskReputation', Math.max current, 0
# the task is complete
finalizeReputation: ->
best = @get 'bestTaskReputation'
if GG.baselineController.get 'isBaseline'
# calculate "reputation" based on breeds used
current = GG.tasksController.get 'baselineTaskReputation'
else
current = @get 'currentTaskReputation'
current = 0 if current == null
evt = if @get('swapChangedEarned') then GG.Events.REPUTATION_CHANGED else GG.Events.REPUTATION_EARNED
GG.logController.logEvent evt, {amount: current}
if best == null || current > best
Ember.run =>
@set('bestTaskReputation', current)
@set('bestTaskReputationReasons', @get('currentTaskReputationReasons'))
best = 0 if best == Number.NEGATIVE_INFINITY
GG.userController.addReputation(current - best)
return current
_repFor: (evt)->
reasons = @get('currentTaskReputationReasons')
reasons[evt] || 0
currentTaskBinding: 'GG.tasksController.currentTask'
reputationForTask: (->
@get 'currentTask.reputation'
).property('currentTask')
breedsLeftBinding: 'GG.cyclesController.cycles'
hasObstacleCourseBinding: 'GG.obstacleCourseController.hasObstacleCourse'
animatedReputation: 0
currentTaskReputationAssumingCompletion: (->
current = @get('currentTaskReputation')
current += @get('reputationForTask')
if @get('hasObstacleCourse')
current += (@get('breedsLeft') * GG.actionCostsController.getCost('cycleRemainingBonus'))
#current -= @_repFor GG.Events.INCOMPLETE_COURSE
#current -= @_repFor GG.Events.COMPLETED_TASK
if current < 0 then 0 else current
).property('currentTaskReputation','reputationForTask','breedsLeft','hasObstacleCourse')
animateOnReputationChange: (->
changeAnimatedReputation = =>
animated = @get('animatedReputation')
current = @get('currentTaskReputationAssumingCompletion')
if ((animated + 15) < current) or ((animated - 15) > current)
@set('animatedReputation', current) # jump ahead
$("#task-reputation-available").removeClass("drop").removeClass("gain")
return
else if animated < current
@set('animatedReputation', animated+1)
$("#task-reputation-available").addClass("gain")
else if animated > current
@set('animatedReputation', animated-1)
$("#task-reputation-available").addClass("drop")
if @get('animatedReputation') != @get('currentTaskReputationAssumingCompletion')
setTimeout(changeAnimatedReputation, 150)
else
$("#task-reputation-available").removeClass("drop").removeClass("gain")
changeAnimatedReputation()
).observes('currentTaskReputationAssumingCompletion')
extraBreedsRep: (->
@_repFor GG.Events.BRED_WITH_EXTRA_CYCLE
).property('currentTaskReputation')
meiosisControlRep: (->
enables = @_repFor GG.Events.ENABLED_MEIOSIS_CONTROL
chromos = @_repFor GG.Events.CHOSE_CHROMOSOME
crosses = @_repFor GG.Events.MADE_CROSSOVER
enables + chromos + crosses
).property('currentTaskReputation')
alleleRevealRep: (->
@_repFor GG.Events.REVEALED_ALLELE
).property('currentTaskReputation')
GG.groupsController = Ember.Object.create
groups: Ember.ArrayProxy.create
content: Ember.A([
GG.GroupMember.create(),
GG.GroupMember.create()
])
error: false
verifyContent: ->
groups = @get('groups')
found = groups.find (user)->
user.get('invalidName') or user.get('invalidSchoolID')
if found or groups.get('length') < 1
@set('error', true)
return
@set('error', false)
removeUser: (user)->
console.log("remove user called: ", user)
groups = @get('groups')
groups.removeObject(user)
console.log("remove user ended")
addUser: ->
console.log("add user called")
groups = @get('groups')
groups.pushObject(GG.GroupMember.create())
console.log("add user ended")
GG.optionsController = Ember.Object.create
projectedDisplay: false
GG.manualEventController = Ember.Object.create
password: ""
task: null
drakeAlleles: ""
drakeSexes: [ "Female", "Male" ]
drakeSex: null
breedsRemaining: 0
time: 120
reputation: ""
cancel: ->
GG.statemanager.send 'closeAdminPanel'
submit: ->
session = GG.logController.get 'session'
GG.logController.set 'session', "MANUAL-SUBMISSION"
task = @get 'task'
alleles = @get("drakeAlleles") || "MANUAL-SUBMISSION"
sex = if @get("drakeSex") is "Female" then 1 else 0
breedCounter = @get('breedsRemaining')
time = 1000 * @get 'time'
reputation = @get 'reputation'
GG.logController.logEvent GG.Events.COMPLETED_TASK,
name: task.name
breedCounter: breedCounter
elapsedTimeMs: time
reputationEarned: reputation
GG.logController.logEvent GG.Events.SUBMITTED_OFFSPRING,
alleles: alleles
sex: @get "drakeSex"
success: true # must be always true for flash app
GG.logController.set 'session', session
GG.statemanager.send 'closeAdminPanel'
GG.leaderboardController = Ember.ArrayController.create
content : []
fbClassRef: null
fbClassCreator: (->
classWord = GG.userController.get 'classWord'
learnerId = GG.userController.get 'learnerId'
userName = GG.userController.get 'user.codeNameWithLearnerId'
if (not (classWord? and learnerId? and userName?)) or ~userName.indexOf("null")
@set 'fbClassRef', null
return
GG.logController.logEvent "Trying to connect to FireBase"
fbRef = new Firebase 'https://genigames-leaderboard.firebaseio.com/'
# find existing class ref, or create one with some initial data
fbRef.child(classWord).once 'value', (snapshot) =>
reputation = GG.userController.get 'user.reputation'
if (snapshot.val() == null)
# create class ref, add add self and score (FB needs some non-null data)
userCreationObj = {}
userCreationObj[userName] = reputation
fbRef.child(classWord).set userCreationObj, (error) =>
if error
GG.logController.logEvent "Error creating FireBase child node #{classWord}"
console.log "Error creating FB child node #{classWord}"
else
GG.logController.logEvent "Created FireBase child node #{classWord}"
@set 'fbClassRef', fbRef.child(classWord)
else
GG.logController.logEvent "Using FireBase child node #{classWord}"
fbRef.child(classWord).child(userName).setWithPriority(reputation, -reputation)
@set 'fbClassRef', fbRef.child(classWord)
).observes('GG.userController.classWord', 'GG.userController.learnerId', 'GG.userController.user.codeNameWithLearnerId')
fbClassObserver: (->
changedCallback = (scoreSnapshot, prevScoreName) =>
name = scoreSnapshot.name()
score = scoreSnapshot.val()
entry = @find (e) -> e.get("name") is name
if entry?
entry.set 'score', score
@removeObject entry
else
entry = GG.LeaderboardEntry.create
name: name
score: score
if not prevScoreName?
@insertAt 0, entry
else
entries = @get 'content'
for e, i in entries
if e.get('name') is prevScoreName
@insertAt i+1, entry
fbClassRef = @get 'fbClassRef'
if not fbClassRef? then return
fbClassRef.on 'child_added', changedCallback
fbClassRef.on 'child_changed', changedCallback
).observes('fbClassRef')
updateReputation: (->
classRef = @get('fbClassRef')
return unless classRef?
userName = GG.userController.get 'user.codeNameWithLearnerId'
return unless (userName? && !~userName.indexOf("null"))
reputation = GG.userController.get 'user.reputation'
reputation += GG.townsController.get 'unlockedTownsCost'
# set with priority: -rep to order with highest scores at top
classRef.child(userName).setWithPriority(reputation, -reputation)
).observes('GG.userController.user.reputation')
GG.valueCounterController = Ember.Object.create
valueBinding: 'GG.tasksController.currentTask.reputation'
updateCounter: (->
value = @get 'value'
return if value < 0
if (value >= 100)
hundreds = Math.floor(value / 100) % 10
$('.value-counter .hundreds').show().animate({backgroundPosition: @getPosition(hundreds)}, 200)
else
$('.value-counter .hundreds').hide()
if (value >= 10)
tens = Math.floor(value / 10) % 10
$('.value-counter .tens').show().animate({backgroundPosition: @getPosition(tens)}, 200)
else
$('.value-counter .tens').hide()
ones = value % 10
$('.value-counter .ones').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('value')
getPosition: (num) ->
pos = num * 18
"(0px -" + pos + "px)"
GG.costCounterController = Ember.Object.create
value: (->
GG.reputationController.get('currentTaskReputation') * -1
).property('GG.reputationController.currentTaskReputation')
updateCounter: (->
value = @get 'value'
return if value < 0
if (value >= 100)
hundreds = Math.floor(value / 100) % 10
$('.cost-counter .hundreds').show().animate({backgroundPosition: @getPosition(hundreds)}, 200)
else
$('.cost-counter .hundreds').hide()
if (value >= 10)
tens = Math.floor(value / 10) % 10
$('.cost-counter .tens').show().animate({backgroundPosition: @getPosition(tens)}, 200)
else
$('.cost-counter .tens').hide()
ones = value % 10
$('.cost-counter .ones').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('value')
getPosition: (num) ->
pos = num * 18
"(0px -" + pos + "px)"
GG.tooltipController = Ember.Object.create
show: false
| 80596 | minispade.require 'genigames/controller-mixins'
## Static variables ##
GG.BREED_AUTOMATED = "automated"
GG.BREED_CONTROLLED = "controlled"
GG.userController = Ember.Object.create
learnerDataUrl: (->
lid = @get('learnerId')
if lid?
GG.PORTAL_URL + '/dataservice/bucket_loggers/learner/' + lid + '/bucket_contents.bundle'
else
null
).property('learnerId')
user: null
state: null
learnerId: null
classWord: null
loaded: false
groupInfoSaved: false
learnerChanged: (->
# TODO update learner data
console.log 'learner changed: ', @get('learnerId')
@set('loaded', false)
$.getJSON(@get('learnerDataUrl'), (data) =>
@set('state', data)
@get('user').restoreState()
@set('loaded', true)
if (@get('user.codeName') == null)
@get('user').set 'codeName', GG.codeNameGenerator.generate()
).error =>
@set('state', null)
@set('loaded', true)
).observes('learnerId')
addReputation: (amt) ->
user = @get 'user'
return unless user
user.set 'reputation', user.get('reputation') + amt
evt = if GG.reputationController.get('swapChangedEarned') then GG.Events.REPUTATION_EARNED else GG.Events.REPUTATION_CHANGED
GG.logController.logEvent evt, amount: amt, result: user.get('reputation')
loadState: (type, obj)->
allState = @get('state')
if allState? and allState[type]? and allState[type][obj.get('_id')]?
return allState[type][obj.get('_id')]
else
return {}
stateQueue: []
stateQueueProcessing: false
saveState: (type, obj)->
stateQueue = @get('stateQueue')
stateQueue.push({type: type, obj: obj})
@processStateQueue() unless @get('stateQueueProcessing')
processStateQueue: ->
@set('stateQueueProcessing', true)
queue = @get('stateQueue')
allState = @get('state') || {}
while queue.length > 0
item = queue.shift()
type = item.type
obj = item.obj
allState[type] ||= {}
allState[type][obj.get('_id')] = obj.serialize()
@set('state', allState)
@set('stateQueueProcessing', false)
Ember.run.once this, "persistSaveState"
persistSaveState: ->
if @get('learnerDataUrl')?
allState = @get('state') || {}
$.post @get('learnerDataUrl'), JSON.stringify(allState), (data) =>
console.log 'state saved'
GG.townsController = Ember.ArrayController.create
content : []
currentTown: null
townToBeUnlocked: null
addTown: (town) ->
@pushObject town
currentTownIndex: (->
@indexOf(@get('currentTown'))
).property('currentTown')
firstIncompleteTown: (->
towns = @get('content')
for i in [0...(towns.length)]
t = towns[i]
return t unless t.get('completed')
).property('content')
setCurrentTown: (town, force=false) ->
@completeTownsThrough @indexOf(town) - 1 if force
return false if town is @currentTown
if @indexOf(town) >= 0
@set 'currentTown', town
GG.tasksController.reset()
for ts in town.get 'realTasks'
GG.tasksController.addTask ts
GG.logController.logEvent GG.Events.ENTERED_TOWN, name: town.get('name')
return true
else
throw "GG.townsController.setCurrentTown: argument is not a known town"
# loads a town by name or number
loadTown: (townName) ->
if (not isNaN parseInt(townName))
town = @get('content')[townName-1]
else
town = (town for town in @get('content') when town.get('name') == townName)[0]
@setCurrentTown(town, true) if town?
nextTownsCost: (->
nextTown = @indexOf(@get 'townToBeUnlocked')
previousTown = @get('content')[nextTown-1] unless !nextTown
if not previousTown then return 0
previousTown.get('completionCost')
).property('townToBeUnlocked')
canPayForNextTown: (->
nextTown = @indexOf(@get 'townToBeUnlocked')
previousTown = @get('content')[nextTown-1] unless !nextTown
if not previousTown then return false
if (previousTown.get('locked')) then return false
return (GG.userController.get('user.reputation') >= previousTown.get('completionCost'))
).property('townToBeUnlocked', 'GG.userController.user.reputation')
unlockTown: ->
town = @get 'townToBeUnlocked'
if not town then return
town.set 'locked', false
GG.logController.logEvent GG.Events.UNLOCKED_TOWN, name: town.get('name')
completeCurrentTown: ->
town = @get('currentTown')
town.set('completed', true)
GG.logController.logEvent GG.Events.COMPLETED_TOWN, name: town.get('name')
# 'completeTownsThrough 2' will complete towns 0,1,2
completeTownsThrough: (n) ->
for town, i in @get('content') when i <= n
town.set('completed', true)
town.set('locked', false)
GG.tasksController.completeAllTasksForTown town
if town = @get("content.#{n+1}")
town.set('locked', false)
GG.logController.logEvent GG.Events.COMPLETED_TOWN, name: ("Towns through #" + n)
# the total cost of all towns unlocked so far
unlockedTownsCost: (->
cost = 0
for town, i in @get('content')
if (nextTown = @get("content.#{i+1}")) and not nextTown.get('locked')
cost += town.get 'completionCost'
cost
).property('currentTown', 'GG.userController.user')
GG.tasksController = Ember.ArrayController.create
content : []
currentTask: null
taskStartTime: 0
reset: ->
@set 'content', []
@set 'currentTask', null
addTask: (task) ->
@pushObject task
setCurrentTask: (task, muteLog = false) ->
return if task is @get 'currentTask'
if @indexOf(task) >= 0
if GG.baselineController.get 'isBaseline'
task.set 'cyclesRemaining', 0
else
task.set 'cyclesRemaining', task.get 'cycles'
@set 'currentTask', task
for femaleAlleles in task.initialDrakes.females
org = BioLogica.Organism.createLiveOrganism GG.DrakeSpecies, femaleAlleles, BioLogica.FEMALE
GG.parentController.pushObject GG.Drake.createFromBiologicaOrganism org
for maleAlleles in task.initialDrakes.males
org = BioLogica.Organism.createLiveOrganism GG.DrakeSpecies, maleAlleles, BioLogica.MALE
GG.parentController.pushObject GG.Drake.createFromBiologicaOrganism org
unless muteLog
GG.logController.logEvent GG.Events.STARTED_TASK, name: task.get('name')
@set('taskStartTime', new Date().getTime())
else
throw "GG.tasksController.setCurrentTask: argument is not a known task"
setNextAvailableTask: (taskIndex) ->
tasks = @get('content')
@completeTasksThrough taskIndex - 1 if taskIndex < tasks.length
clearCurrentTask: ->
@set 'currentTask', null
GG.parentController.reset()
awardTaskReputation: (success) ->
task = @get 'currentTask'
isCourse = GG.obstacleCourseController.get 'hasObstacleCourse'
if isCourse
reputation = GG.obstacleCourseController.get 'reputationEarned'
else
reputation = task.get('reputation')
event = if (isCourse and !success) then GG.Events.INCOMPLETE_COURSE else GG.Events.COMPLETED_TASK
GG.reputationController.addReputation(reputation, event)
GG.reputationController.finalizeReputationForTaskRun()
return GG.reputationController.finalizeReputation()
completeCurrentTask: ->
task = @get 'currentTask'
task.set 'completed', true
# If the current task is not complete, that means completion was forced.
# A task with an obstacle course will do this when breeds remaining hits 0, for example.
reputation = @awardTaskReputation(@get('isCurrentTaskComplete'))
GG.logController.logEvent GG.Events.COMPLETED_TASK,
name: task.get('name')
breedCounter: GG.cyclesController.get('cycles')
elapsedTimeMs: (new Date().getTime()) - @get('taskStartTime')
reputationEarned: reputation
restartCurrentTask: ->
task = @get 'currentTask'
GG.reputationController.resetCurrent()
GG.logController.logEvent GG.Events.RESTARTED_TASK, name: task.get('name')
@clearCurrentTask()
@setCurrentTask(task)
@taskAccepted task
completeTasksThrough: (n) ->
for task, i in @get('content') when i <= n
task.set('completed', true)
powerups = task.get('powerups')
if powerups && powerups.length > 0
powerup = powerups[0]
GG.powerUpController.unlockPowerup(powerup)
GG.logController.logEvent GG.Events.COMPLETED_TASK, name: ("Tasks through #" + n)
completeAllTasksForTown: (town) ->
for task, i in town.get('realTasks')
task.set('completed', true)
powerups = task.get('powerups')
if powerups && powerups.length > 0
powerup = powerups[0]
GG.powerUpController.unlockPowerup(powerup)
GG.logController.logEvent GG.Events.COMPLETED_TASK, name: ("Completed all tasks for #{town.get('name')}")
currentLevelId: (->
task = @get('currentTask')
id = ""
if GG.baselineController.get('isBaseline')
if task and task.get('baselineName')
id = ": " + task.get 'baselineName'
else
if task
id = ": " + task.get 'name'
id = id.replace("Task", "Drake")
return id
).property('currentTask')
currentTargetTraits: (->
target = @get 'currentTask.targetDrake'
if target
target = target.replace(/, ?/g,"</li><li>")
new Handlebars.SafeString "<ul><li>" + target + "</li></ul>"
else ""
).property('currentTask')
targetCountBinding: Ember.Binding.oneWay('currentTask.targetCount')
matchCountBinding: Ember.Binding.oneWay('currentTask.matchCount')
showTaskDescription: (task) ->
@setCurrentTask task
otherTask.set('showQuestionBubble', false) for otherTask in GG.tasksController.content
task.set 'showSpeechBubble', true
showTaskEndMessage: (task) ->
if task.get('npc.speech.completionText')?
task.set 'isShowingEndMessage', true
task.set 'showSpeechBubble', true
else
GG.statemanager.send 'done'
showTaskThanksMessage: (task) ->
task.set 'isShowingThanksMessage', true
task.set 'isShowingFailMessage', false
task.set 'isShowingEndMessage', false
task.set 'showSpeechBubble', true
showTaskFailMessage: (task) ->
task.set 'isShowingThanksMessage', false
task.set 'isShowingEndMessage', false
task.set 'isShowingFailMessage', true
task.set 'showSpeechBubble', true
showTaskCompletion: (success) ->
if GG.baselineController.get('isNotBaseline') and GG.lastShownDialog?
try
GG.tutorialMessageController.set('finishButtonTutorialShown', true)
GG.lastShownDialog.qtip('hide')
catch e
GG.lastShownDialog = null
GG.statemanager.transitionTo 'inTown', [@get('currentTask'), success]
showTaskNonCompletion: ->
msg = "That's not the %@ you're looking for!".fmt(Ember.I18n.t('drake'))
msg += " You're trying to "
msg += (
@get('currentTask.npc.speech.shortText').toLowerCase() ||
("breed a drake with " + @get('currentTask.targetDrake') + ".")
).replace('drake', Ember.I18n.t('drake'))
GG.showModalDialog msg
taskAccepted: (task) ->
task.set 'showSpeechBubble', false
GG.statemanager.transitionTo 'inTask'
isCurrentTaskComplete: ->
task = @get 'currentTask'
drake = GG.breedingController.get 'child'
if not task? or not drake?
return false
# parse required characteristics
parsedCharacteristics = task.get('targetDrake').split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
if drake.hasCharacteristics(parsedCharacteristics)
task.set 'matchCount', (task.get 'matchCount')+1
return true if task.get('matchCount') >= task.get('targetCount')
return false
powerupsBinding: Ember.Binding.oneWay('GG.userController.user.powerups')
meiosisControlEnabled: (->
GG.powerUpController.hasPowerup("meiosis control") || !!@get('currentTask.meiosisControl')
).property('currentTask.meiosisControl', 'powerups.@each')
hasHiddenGenes: (->
hidden = @get 'currentTask.hiddenGenes'
if hidden? and hidden.length > 0
return true
else
return false
).property('currentTask.hiddenGenes')
baselineTaskReputation: (->
rep = 0
if @get('currentTask')?
cyclesUsed = @get('currentTask.cyclesRemaining')
cyclesAllowed = @get('currentTask.cycles')
if cyclesUsed < (cyclesAllowed/2)
rep = 100
else if cyclesUsed > (cyclesAllowed*2)
rep = 0
else
allowed = (cyclesAllowed*2)-(cyclesAllowed/2)
used = cyclesUsed - (cyclesAllowed/2)
remaining = allowed - used
rep = Math.floor(100*(remaining/allowed))
return rep
).property('currentTask','currentTask.cyclesRemaining')
updateHeartFills: ->
task.propertyDidChange('reputationEarned') for task in @get('content')
GG.drakeController = Ember.Object.create
visibleGenesBinding: 'GG.tasksController.currentTask.visibleGenes'
hiddenGenesBinding: 'GG.tasksController.currentTask.hiddenGenes'
GG.parentController = Ember.ArrayController.create
content: []
maxMales: 40
maxFemales: 40
selectedMother: null
selectedFather: null
reset: ->
@set 'selectedMother', null
@set 'selectedFather', null
@clear()
females: (->
drake for drake in @get('content') when drake.sex is GG.FEMALE
).property('content.@each')
males: (->
drake for drake in @get('content') when drake.sex is GG.MALE
).property('content.@each')
hasRoom: (drake) ->
if drake.sex is GG.MALE
return @get('males').length < @get 'maxMales'
else
return @get('females').length < @get 'maxFemales'
whosSelected: (->
mother = @get('selectedMother')
father = @get('selectedFather')
if mother or father
return "mother" unless father
return "father" unless mother
return "both"
return "none"
).property('selectedMother', 'selectedFather')
GG.fatherPoolController = Ember.ArrayController.create
contentBinding: 'GG.parentController.males'
selectedBinding: 'GG.parentController.selectedFather'
hidden: true
GG.motherPoolController = Ember.ArrayController.create
contentBinding: 'GG.parentController.females'
selectedBinding: 'GG.parentController.selectedMother'
hidden: true
# Fixme: This needs to be rethrought now that we will always only
# have one offspring. Maybe it can just be replaced by breedingController.child
GG.offspringController = Ember.Object.create
content: null
hidden: false
selectedBinding: 'content'
GG.breedingController = Ember.Object.create
motherBinding: 'GG.parentController.selectedMother'
fatherBinding: 'GG.parentController.selectedFather'
isShowingBreeder: false
isShowingBreeder2: false # stupid stupid Ember...
isBreeding: false
breedType: GG.BREED_AUTOMATED
child: null
childSavedToParents: false
breedDrake: ->
if (@get('mother') && @get('father')) || GG.meiosisController.get('chosenAlleles')?
@set 'isBreeding', true
org = null
if GG.meiosisController.get('chosenAlleles')?
org = BioLogica.Organism.createOrganism(GG.DrakeSpecies, GG.meiosisController.get('chosenAlleles'), GG.meiosisController.get('chosenSex'))
else
org = BioLogica.breed @get('mother.biologicaOrganism'), @get('father.biologicaOrganism')
drake = GG.Drake.createFromBiologicaOrganism org
drake.set 'bred', true
if GG.meiosisController.get('chosenAlleles')?
revealed = GG.meiosisController.get('chosenRevealedAlleles')
for r in [0...revealed.length]
rev = revealed[r]
drake.markRevealed(rev.side, rev.allele)
GG.breedingController.set 'child', drake
GG.offspringController.set 'content', drake
Ember.run.next ->
GG.statemanager.send 'showOffspring'
@set 'isBreeding', false
GG.logController.logEvent GG.Events.BRED_DRAGON,
mother: @get('mother.biologicaOrganism.alleles')
father: @get('father.biologicaOrganism.alleles')
offspring: drake.get('biologicaOrganism.alleles')
offspringSex: drake.get('sex')
GG.cyclesController = Ember.Object.create
cyclesBinding: 'GG.tasksController.currentTask.cyclesRemaining'
increment: (amt=1) ->
@set 'cycles', @get('cycles')+amt
decrement: (amt=1) ->
cycles = @get 'cycles'
return if cycles <= 0
@set 'cycles', cycles-amt
reset: ->
setTimeout =>
@updateCounter()
, 1000
updateCounter: (->
cycles = @get 'cycles'
return if cycles < 0
hundreds = Math.floor(cycles / 100) % 10
$('#moveCounterHundreds').animate({backgroundPosition: @getPosition(hundreds)}, 200)
tens = Math.floor(cycles / 10) % 10
$('#moveCounterTens').animate({backgroundPosition: @getPosition(tens)}, 200)
ones = cycles % 10
$('#moveCounterOnes').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('cycles')
getPosition: (num) ->
pos = num * 26
"(0px -" + pos + "px)"
GG.logController = Ember.Object.create
learnerIdBinding: 'GG.userController.learnerId'
learnerLogUrl: (->
lid = @get('learnerId')
if lid?
GG.PORTAL_URL + '/dataservice/bucket_loggers/learner/' + lid + '/bucket_log_items.bundle'
else
null
).property('learnerId')
learnerLogUrlChanged: (->
if @get('learnerLogUrl')?
@processEventQueue()
).observes('learnerLogUrl')
syncTime: new SyncTime(GG.PORTAL_URL + '/time')
session: null
eventQueue: []
eventQueueInProgress: []
triedToEmptyEventQueue: false
startNewSession: ->
@set('session', @generateGUID())
@logEvent GG.Events.STARTED_SESSION
@startEventQueuePolling()
startEventQueuePolling: ->
setInterval =>
@processEventQueue() unless @eventQueueInProgress.length > 0
, 10000
processEventQueue: ->
if @get('triedToEmptyEventQueue') and @eventQueue.length is 0
# we had lost connection but now we have regained it
@set 'triedToEmptyEventQueue', false
GG.statemanager.send 'notifyConnectionRegained'
if @get('learnerLogUrl')? and @eventQueue.length > 0
# a previous save event failed, so we have events in our queue
if @get('triedToEmptyEventQueue')
# we already tried to empty event queue once and we didn't succeed
GG.statemanager.send 'notifyConnectionLost'
@set 'triedToEmptyEventQueue', true
@eventQueueInProgress = @eventQueue.slice(0)
@eventQueue = []
while @eventQueueInProgress.length > 0
evt = @eventQueueInProgress.shift()
@persistEvent(evt)
logEvent: (evt, params) ->
date = @syncTime.now()
logData =
session : @get('session')
time : date.getTime()
prettyTime : date.toString()
internetTime: date.toInternetTime(2)
timeDrift : @syncTime.drift
event : evt
parameters : params
@persistEvent logData
persistEvent: (evt)->
if @get('learnerLogUrl')?
$.post(@get('learnerLogUrl'), JSON.stringify(evt), (data)->
console.log 'log event saved'
).error =>
console.log 'log event save failed!'
@eventQueue.push evt
else
console.log 'log event generated (no save)', evt
@eventQueue.push evt
generateGUID: ->
S4 = -> (((1+Math.random())*0x10000)|0).toString(16).substring(1)
S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()
GG.sessionController = Ember.Object.create
checkTokenUrl: GG.PORTAL_URL + '/verify_cc_token'
loginUrl: GG.PORTAL_URL + '/remote_login'
logoutUrl: GG.PORTAL_URL + '/remote_logout'
userBinding: 'GG.userController.user'
loadedBinding: 'GG.userController.loaded'
error: false
loggingIn: false
firstTime: true
registrationError: false
registrationErrorMessage: null
preloadingComplete: false
waitingForPreload: false
registeredUsername: null
loggedIn: (->
@get('user') != null
).property('user')
classesWithLearners: (->
found = []
classes = @get('user.classes')
if classes? and classes.length > 0
for i in [0...(classes.length)]
cl = classes[i]
if cl? and cl.learner? and cl.learner > 0
cl.label = cl.name + " (" + cl.teacher + ")"
found.push(cl)
return found
).property('user')
checkCCAuthToken: ->
$.ajax
type: "GET"
url: @checkTokenUrl
xhrFields:
withCredentials: true
success: (data) =>
if data.error?
@set('error', true)
@set('loggingIn', false)
else
user = GG.User.create data
@set('user', user)
GG.statemanager.send 'successfulLogin'
error: =>
@set('loggingIn', false)
@set('error', true)
setTimeout ->
if username = GG.sessionController.get 'registeredUsername'
$('#username-field input').attr 'value', username
, 50
loginPortal: (username, password)->
@set('firstTime', false)
$.ajax
type: "POST"
url: @loginUrl
data: "login=#{username}&password=#{password}"
dataType: "application/x-www-form-urlencoded"
xhrFields:
withCredentials: true
success: (data) =>
@checkCCAuthToken()
error: =>
# unsure why we get 'error' even when request returns 200
@checkCCAuthToken()
logoutPortal: ->
@set('firstTime', true)
@set('user', null)
@set('loaded', false)
@set('loggingIn', false)
GG.userController.set('classWord', null)
GG.userController.set('learnerId', null)
GG.tasksController.set('content',[])
GG.townsController.set('content',[])
GG.leaderboardController.set('content',[])
$.ajax
type: "POST"
url: @logoutUrl
xhrFields:
withCredentials: true
complete: =>
GG.statemanager.transitionTo 'loggingIn'
GG.actionCostsController = Ember.Object.create
getCost: (action) ->
level = GG.townsController.get('currentTownIndex')
pts = [].concat @get('content.'+action)
if level >= pts.length
level = (pts.length - 1) # the final value is used for all remaining levels
pts[level] || 0
GG.meiosisController = Ember.Object.create
canBreedDuringAnimation: true
speedControlEnabled: (->
# enable on town 1 task 7
townId = 1 + GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = 1 + GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId*10 + taskId >= 17
).property('GG.townsController.currentTown', 'GG.tasksController.currentTask')
inAnimation: false
motherView: null
fatherView: null
firstView: null
secondView: null
motherGameteNumberBinding: 'motherView.randomGameteNumberOverride'
fatherGameteNumberBinding: 'fatherView.randomGameteNumberOverride'
chosenMotherAllelesBinding: 'motherView.chosenGameteAlleles'
chosenFatherAllelesBinding: 'fatherView.chosenGameteAlleles'
chosenMotherGameteBinding: 'motherView.chosenGamete'
chosenFatherGameteBinding: 'fatherView.chosenGamete'
chosenSexBinding: 'fatherView.chosenSex'
firstParent: null
secondParent: null
selectFirstParent: (parent, force) ->
return if @get('inAnimation') unless force
@set 'firstParent', parent
@set 'secondParent', (if parent is "mother" then "father" else "mother")
if !parent?
@set 'firstView', null
@set 'secondView', null
else if parent is "mother"
@set 'firstView', @get 'motherView'
@set 'secondView', @get 'fatherView'
else
@set 'firstView', @get 'fatherView'
@set 'secondView', @get 'motherView'
if @get 'waitingForParentSelection'
@animate()
chosenAlleles: (->
return @get('chosenMotherAlleles') + "," + @get('chosenFatherAlleles')
).property('chosenMotherAlleles','chosenFatherAlleles')
chosenRevealedAlleles: (->
femGam = @get 'chosenMotherGamete'
maleGam = @get 'chosenFatherGamete'
res = []
for own ch of maleGam
rev = maleGam[ch].revealed || []
for i in [0...rev.length]
res.push {allele: rev[i], side: 'b'}
for own ch of femGam
rev = femGam[ch].revealed || []
for i in [0...rev.length]
res.push {allele: rev[i], side: 'a'}
return res
).property('chosenMotherGamete','chosenFatherGamete')
animate: (callback)->
if @get('firstView')? and @get('secondView')?
@set 'waitingForParentSelection', false
@set('inAnimation', true)
$(".parent-select-target").removeClass("active")
GG.tutorialMessageController.showMeiosisTutorial @get('firstParent'), =>
@get('firstView').animate =>
@get('secondView').animate =>
GG.MeiosisAnimation.mergeChosenGametes("#" + @get('fatherView.elementId'), "#" + @get('motherView.elementId'), =>
@set('inAnimation', false)
if callback
callback()
else @get('delayedCallback')()
)
else
@set 'waitingForParentSelection', true
@set 'delayedCallback', callback
resetAnimation: ->
if @get('motherView')? and @get('fatherView')?
@selectFirstParent(null, true)
@get('motherView').resetAnimation()
@get('fatherView').resetAnimation()
@set('selectedChromosomes', { father: {}, mother: {}})
@set('chromosomeSelected', false)
@set('selectedCrossover', null)
@set('crossoverSelected', false)
@set('inAnimation', false)
@set('motherGameteNumber', -1)
@set('fatherGameteNumber', -1)
chromosomeSelected: false
selectedChromosomes: { father: {}, mother: {}}
deselectChromosome: (chromoView) ->
selected = @get('selectedChromosomes')
source = if chromoView.get('content.sex') == GG.MALE then "father" else "mother"
chromo = chromoView.get('chromo')
chromo = "XY" if chromo is "X" or chromo is "Y"
chromoView.set('selected', false)
selected[source][chromo] = null
# Refund the reputation that was charged to select this chromosome
GG.reputationController.addReputation(GG.actionCostsController.getCost('chromosomeSelected'), GG.Events.CHOSE_CHROMOSOME)
clearNum = true
for own chrom,view of selected[source]
clearNum = false if view?
if clearNum
gameteNumberProp = if source is "father" then 'fatherGameteNumber' else 'motherGameteNumber'
@set(gameteNumberProp, -1)
# TODO We should probably revert any cell num swaps that happened on selection, so the user can't
# cheat by selecting and then deselecting and having them move to the same gamete anyway
selectChromosome: (chromoView) ->
@set('chromosomeSelected', true)
selected = @get('selectedChromosomes')
source = if chromoView.get('content.sex') == GG.MALE then "father" else "mother"
chromo = chromoView.get('chromo')
chromo = "XY" if chromo is "X" or chromo is "Y"
if selected[source][chromo]?
selected[source][chromo].set('selected', false)
else
# There was no previously selected chromosome, so charge rep points
GG.reputationController.subtractReputation(GG.actionCostsController.getCost('chromosomeSelected'), GG.Events.CHOSE_CHROMOSOME)
selected[source][chromo] = chromoView
gameteNumberProp = if source is "father" then 'fatherGameteNumber' else 'motherGameteNumber'
destGameteNum = @get(gameteNumberProp)
sourceGameteNum = chromoView.get('cellNum')
if destGameteNum == -1
@set(gameteNumberProp, sourceGameteNum)
else
# if the selected chromosome is *not* in the to-be-selected gamete, move it into it
if sourceGameteNum != destGameteNum
Ember.run =>
# get the gametes
gametes = if source is "father" then @get('fatherView.gametes') else @get('motherView.gametes')
# swap the source chromo and the destination chromo
destChromo = gametes.cells[destGameteNum][chromo]
gametes.cells[destGameteNum][chromo] = gametes.cells[sourceGameteNum][chromo]
gametes.cells[sourceGameteNum][chromo] = destChromo
# swap the endCellInfo numbers
destRealSide = ''
sourceRealSide = ''
for own side,num of gametes.endCellInfo[chromo]
sourceRealSide = side if num == sourceGameteNum
destRealSide = side if num == destGameteNum
gametes.endCellInfo[chromo][sourceRealSide] = destGameteNum
gametes.endCellInfo[chromo][destRealSide] = sourceGameteNum
if source is "father"
@set('fatherView.gametes', $.extend(true, {}, gametes))
@get('fatherView').notifyPropertyChange('gametes')
else
@set('motherView.gametes', $.extend(true, {}, gametes))
@get('motherView').notifyPropertyChange('gametes')
visibility: (chromoView, allele)->
if chromoView.get('visibleAlleles').indexOf(allele) != -1
return 'visible'
if chromoView.get('hiddenAlleles').indexOf(allele) != -1
return 'hidden'
else
return 'invisible'
crossoverSelected: false
selectedCrossover: null
selectCrossover: (destCross)->
@set('crossoverSelected', true)
# get the gene for this allele
gene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, destCross.allele)
destCross.gene = gene
source = if destCross.chromoView.get('content.sex') == GG.MALE then "father" else "mother"
meiosisView = @get(source + 'View')
parentSelector = '#' + meiosisView.get('elementId')
# Highlight the valid second choices, by removing 'clickable' on invalid ones
leftRight = destCross.chromoView.get('right')
points = parentSelector + ' .crossoverPoint:not(.' + gene.name + ')'
points2 = parentSelector + ' .' + leftRight + ' .crossoverPoint.' + gene.name
$(points).removeClass('clickable').addClass('hidden')
$(points2).removeClass('clickable').addClass('hidden')
# mark this one as selected
$('#' + destCross.chromoView.get('elementId') + ' .crossoverPoint.' + gene.name).removeClass('hidden').addClass('selected')
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step1").addClass('hidden')
$(parentSelector + " .crossoverSelection .step2").removeClass('hidden')
if @get('selectedCrossover')?
sourceCross = @get('selectedCrossover')
if sourceCross.gene.name == destCross.gene.name and sourceCross.chromoView.get('side') != destCross.chromoView.get('side')
GG.reputationController.subtractReputation(GG.actionCostsController.getCost('crossoverMade'), GG.Events.MADE_CROSSOVER)
# cross these two
$('#' + destCross.chromoView.get('elementId') + ' .crossoverPoint.' + gene.name).removeClass('clickable').addClass('selected')
# get all genes after this one
genesToSwap = [gene]
allelesToSwap = [
{
gene: sourceCross.gene,
source: sourceCross.allele,
sourceVisibility: @visibility(sourceCross.chromoView, sourceCross.allele)
dest: destCross.allele
destVisibility: @visibility(destCross.chromoView, destCross.allele)
}
]
for allele in sourceCross.chromoView.get('alleles')
alGene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, allele.allele)
if alGene.start > sourceCross.gene.start
genesToSwap.push(alGene)
allelesToSwap.push
gene: alGene
source: allele.allele
sourceVisibility: @visibility(sourceCross.chromoView, allele.allele)
for allele in destCross.chromoView.get('alleles')
alGene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, allele.allele)
if alGene.start > sourceCross.gene.start
allelesToSwap.map (item)=>
if item.gene.name == alGene.name
item.dest = allele.allele
item.destVisibility = @visibility(destCross.chromoView, allele.allele)
return item
GG.logController.logEvent GG.Events.MADE_CROSSOVER,
sourceChromo:
drake: if sourceCross.chromoView.get('content.female') then "mother" else "father"
side: sourceCross.chromoView.get('side')
chromo: sourceCross.chromoView.get('chromo')
sister: sourceCross.chromoView.get('sister')
destinationChromo:
drake: if destCross.chromoView.get('content.female') then "mother" else "father"
side: destCross.chromoView.get('side')
chromo: destCross.chromoView.get('chromo')
sister: destCross.chromoView.get('sister')
allelesToSwap: allelesToSwap
# swap them visually
sourceCell = sourceCross.chromoView.get('cellNum')
destCell = destCross.chromoView.get('cellNum')
moves = {}
for swapGene in genesToSwap
moves[swapGene.name] ?= {}
moves[swapGene.name][sourceCell] = destCell
moves[swapGene.name][destCell] = sourceCell
meiosisView.animateMoves moves, =>
# swap them in the gametes.cells
gametes = meiosisView.get('gametes')
chromo = sourceCross.chromoView.get('chromo')
chromo = 'XY' if chromo is 'X'
for swapAlleles in allelesToSwap
alleles = gametes.cells[sourceCell][chromo].alleles.without(swapAlleles.source)
alleles.push(swapAlleles.dest)
gametes.cells[sourceCell][chromo].alleles = alleles
alleles = gametes.cells[destCell][chromo].alleles.without(swapAlleles.dest)
alleles.push(swapAlleles.source)
gametes.cells[destCell][chromo].alleles = alleles
# also swap revealed status
sourceRevealed = gametes.cells[sourceCell][chromo].revealed || []
destRevealed = gametes.cells[destCell][chromo].revealed || []
isSourceRevealed = sourceRevealed.indexOf(swapAlleles.source) != -1
isDestRevealed = destRevealed.indexOf(swapAlleles.dest) != -1
# remove them both first, then insert them second.
# this way we avoid problems if the alleles are the same.
if isSourceRevealed
sourceRevealed = sourceRevealed.without(swapAlleles.source)
if isDestRevealed
destRevealed = destRevealed.without(swapAlleles.dest)
if isSourceRevealed
destRevealed.push(swapAlleles.source)
if isDestRevealed
sourceRevealed.push(swapAlleles.dest)
if isSourceRevealed or isDestRevealed
gametes.cells[sourceCell][chromo].revealed = sourceRevealed
gametes.cells[destCell][chromo].revealed = destRevealed
meiosisView.set('gametes', $.extend(true, {}, gametes))
meiosisView.notifyPropertyChange('gametes')
# update the step-by-step directions
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step2").addClass('hidden')
$(parentSelector + " .crossoverSelection .step3").removeClass('hidden')
@clearCrossPoints(meiosisView)
else if sourceCross.chromoView == destCross.chromoView
# deselect this cross point
@clearCrossPoints(meiosisView)
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step2").addClass('hidden')
$(parentSelector + " .crossoverSelection .step1").removeClass('hidden')
else
console.log("invalid second cross point!")
else
@set('selectedCrossover', destCross)
clearCrossPoints: (meiosisView)->
# clear the saved cross point
@set('selectedCrossover', null)
Ember.run.next ->
parentSelector = '#' + meiosisView.get('elementId')
selector = parentSelector + ' .crossoverPoint'
$(selector).addClass('clickable')
$(selector).removeClass('hidden')
$(selector).removeClass('selected')
GG.OBSTACLE_COURSE_INTERNAL = "obstacle_course_internal"
GG.OBSTACLE_COURSE_EXTERNAL = "obstacle_course_external"
GG.obstacleCourseController = Ember.Object.create
courseBinding: 'GG.tasksController.currentTask.obstacleCourse'
obstaclesBinding: 'course.obstacles'
drakeBinding: 'GG.offspringController.content'
breedsLeftBinding: 'GG.cyclesController.cycles'
taskComplete: (->
GG.tasksController.isCurrentTaskComplete()
).property('drake')
obstaclesPassed: 0
dialogVisible: false
currentObstacleIndex: 0
currentObstacle: null
mode: GG.OBSTACLE_COURSE_INTERNAL
hasObstacleCourse: (->
@get('course')? && GG.baselineController.get('isNotBaseline')
).property('course')
setFirstObstacle: (->
@set 'currentObstacle', @get('obstacles')?[0]
).observes 'obstacles'
setCurrentObstacle: (->
index = @get 'currentObstacleIndex'
@set 'currentObstacle', @get('obstacles')?[index]
).observes 'currentObstacleIndex'
goToNextObstacle: ->
nextIndex = @get('currentObstacleIndex')+1
@set 'currentObstacleIndex', nextIndex
showInfoDialog: ->
if not GG.tasksController.isCurrentTaskComplete()
text = "Uh oh, you're out of breeds! You're going to have to send this Drake to
the obstacle course. Good luck!"
else
breedsLeft = @get 'breedsLeft'
num = "no, one, two, three, four, five, six, seven, eight, nine, ten".split(", ")[breedsLeft]
s = if breedsLeft is 1 then "" else "s"
text = "Great job, I think this Drake will do well in the obstacle course!
Because you had #{num} breed#{s} remaining, your Drake "
text +=
if breedsLeft then "will be trained #{num} time#{s} before the course,
which will make it even faster!"
else "won't be trained before the course."
GG.showModalDialog text, -> GG.statemanager.send "startCourse"
reputationEarned: (->
return 0 unless @get('course')?
taskRep = GG.tasksController.get 'currentTask.reputation'
if not taskRep? then return null
taskComplete = @get 'taskComplete'
if taskComplete
training = @get 'breedsLeft'
# earn 10 points per breed left
return taskRep + (training * GG.actionCostsController.getCost('cycleRemainingBonus'))
else
# earn 10% of repuation per obstacle passed
# this calculation is ugly...
if @get('obstacles') && @get('obstacles').length > 0
@set 'obstaclesPassed', 0
for obstacle in @get('obstacles')
@calculateTime(obstacle, false)
passed = @get 'obstaclesPassed'
return Math.round taskRep * passed * 0.1
else
# we have an obstacle course with no obstacles (aka the tournament)
# calculate the score based on the number of matching traits
task = GG.tasksController.get 'currentTask'
drake = GG.breedingController.get 'child'
if not task? or not drake?
return Math.round(taskRep * 0.5)
# parse required characteristics
parsedCharacteristics = task.get('targetDrake').split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
matchedChars = drake.hasHowManyCharacteristics(parsedCharacteristics)
modifiers = [0, 0.2, 0.4, 0.6, 0.7, 1.0]
if matchedChars >= modifiers.length
matchedChars = modifiers.length - 1
return Math.round taskRep * modifiers[matchedChars]
).property('drake', 'obstaclesPassed')
myTotalTime: (->
return 0 unless @get('course')? and @get('obstacles')?
total = 0
for obstacle in @get('obstacles')
total += @calculateTime(obstacle, false)
return total
).property('course','breedsLeft','obstacles', 'drake')
opponentTotalTime: (->
return 0 unless @get('course')? and @get('obstacles')?
total = 0
for obstacle in @get('obstacles')
total += @calculateTime(obstacle, true)
return Math.round total
).property('course','opponentBreedsLeft','obstacles')
didPassObstacle: (obstacle=@get('currentObstacle')) ->
drake = @get 'drake'
target = obstacle.target
parsedCharacteristics = target.split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
drake.hasCharacteristics(parsedCharacteristics)
calculateTime: (obstacle, opponent=false)->
obsTime = obstacle.time || 1
# opponent always goes 10% slower
if opponent then return obsTime * 1.1
drake = @get 'drake'
target = obstacle.target
return 0 unless drake
return 1 unless target
unless @didPassObstacle obstacle
# failure
return obsTime * 4
@set 'obstaclesPassed', @get('obstaclesPassed') + 1
training = @get 'breedsLeft'
speedup = Math.pow(0.9, training) # reduce speed by 10% for each training cycle
return Math.round obsTime * speedup
GG.baselineController = Ember.Object.create
isBaseline: false
isNotBaseline: Ember.computed.not('isBaseline')
GG.tutorialMessageController = Ember.Object.create
enabled: true
isFirstTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId+taskId is 0
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisDescriptionTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId is 0 and taskId is 1
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
# TODO There should be a better way to detect this other than hard-coding it...
isFirstMeiosisControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 4) or (GG.baselineController.get('isBaseline') and townId is 1 and taskId is 0)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisGenderControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 6)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisSpeedControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 6)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstBackcrossTask: (->
GG.tasksController.get("currentTask.powerups.0.name") is "backcrossing"
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
traitBarTutorialShown: false
showTraitBarTutorial: ->
if @get('isFirstTask') and !@get 'traitBarTutorialShown'
setTimeout =>
GG.statemanager.send 'waitForTraitSelection'
, 200
@set 'traitBarTutorialShown', true
GG.showInfoDialog $('#trait-selection-tutorial-target'),
"Use the Trait Tracker to remember the traits you need. Atheena has asked for
a %@1 with wings. To move ahead, click wings now.".fmt(Ember.I18n.t('drake')),
target: "bottomMiddle"
tooltip: "topMiddle"
hideButton: true
firstDrakeSelected: false
showFirstDrakeSelectionTutorial: (parent) ->
if @get('isFirstTask') and !@get 'firstDrakeSelected'
target = if parent is "mother" then "topMiddle" else "bottomMiddle"
tooltip = if parent is "mother" then "bottomMiddle" else "topMiddle"
@set 'firstDrakeSelected', true
GG.showInfoDialog $("##{parent}-chromosome"),
'These are the %@1\'s chromosomes. Here, the gene for Wings is shown: <span style="position: relative;">
<img src="../images/allele-bg.png" style="position: absolute; top: -6px; left: 3px">
<span style="position: absolute; top: 0; left: 6px; font-weight: bold;" class="dominant">
W1</span></span>'.fmt(Ember.I18n.t('drake')),
target: target
tooltip: tooltip
meiosisSelectionTutorialShown: false
showMeiosisSelectionTutorial: ->
if @get('isFirstTask') and !@get 'meiosisSelectionTutorialShown'
@set 'meiosisSelectionTutorialShown', true
GG.showInfoDialog $('.father .mainCell'),
"To start meiosis, click on the mother or the father, or click on the chromosomes",
target: "rightBottom"
tooltip: "leftTop"
hideTip: true
showMaleParentsTutorial: ->
GG.showInfoDialog $("#male-parents-tutorial-target"),
"Here are the male parent %@1s.
Choose one for breeding now.".fmt(Ember.I18n.t('drake')),
target: "rightMiddle"
tooltip: "leftMiddle"
hideButton: true
showFemaleParentsTutorial: ->
GG.showInfoDialog $("#female-parents-tutorial-target"),
"Here are the female parent %@1s.
Choose one for breeding now.".fmt(Ember.I18n.t('drake')),
target: "rightMiddle"
tooltip: "leftMiddle"
hideButton: true
breedButtonTutorialShown: false
speedTutorialShown: false
motherBinding: 'GG.parentController.selectedMother'
fatherBinding: 'GG.parentController.selectedFather'
bothParentsSelected: (->
@get('mother')? and @get('father')?
).property('mother','father')
showBreedButtonTutorial: ->
if @get('isFirstTask') and !@get('breedButtonTutorialShown') and @get 'bothParentsSelected'
@set 'breedButtonTutorialShown', true
GG.showInfoDialog $("#breed-button"),
"Good job! Notice that males have beards and females don't.
Next, hit the Breed button to create the child.",
target: "leftMiddle"
tooltip: "rightMiddle"
else if @get('isFirstMeiosisSpeedControlTask') and !@get('speedTutorialShown') and @get 'bothParentsSelected'
@set 'speedTutorialShown', true
GG.showInfoDialog $('#meiosis-speed-slider'),
"Use this to control the speed of meiosis.",
target: "leftMiddle"
tooltip: "rightMiddle"
meiosisTutorialShown: false
meiosisTutorial2Shown: false
showMeiosisTutorial: (parent, callback)->
GG.hideInfoDialogs()
if @get('isFirstMeiosisDescriptionTask') and !@get('meiosisTutorialShown')
@set 'meiosisTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.#{parent}"),
"This is meiosis, the method by which half of a parent's genes are passed to the offspring.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback() if callback?
meiosisGenderTutorialShown: false
showMeiosisGenderTutorial: ->
if @get('isFirstMeiosisGenderControlTask') and !@get('meiosisGenderTutorialShown')
@set 'meiosisGenderTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.father"),
"Hint: When you need to control the sex of the offspring drake, use the father's X and Y chromosomes.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
modal: false
meiosisGameteTutorialShown: false
showMeiosisGameteTutorial: (callback, parent) ->
if @get('isFirstMeiosisDescriptionTask') and !@get 'meiosisGameteTutorialShown'
@set 'meiosisGameteTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.#{parent}"),
"Meiosis produces four gamete cells. Each gamete has one chromosome from each pair.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback()
meiosisFertilizationTutorialShown: false
showMeiosisFertilizationTutorial: (callback) ->
if @get('isFirstMeiosisDescriptionTask') and !@get('meiosisFertilizationTutorialShown')
@set 'meiosisFertilizationTutorialShown', true
GG.showInfoDialog $("#meiosis-container"),
"Fertilization is when a sperm and egg cell fuse. The fertilized cell then divides many times to develop into an individual."
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback()
finishButtonTutorialShown: false
showFinishButtonTutorial: ->
if @get('isFirstTask') and !@get('finishButtonTutorialShown')
@set 'finishButtonTutorialShown', true
GG.showInfoDialog $("#offspring-buttons .offspring-buttons-use"),
"When you have a %@1 that matches the task, hit Ready to Sell to
end breeding and sell the %@1 to Athena.".fmt(Ember.I18n.t('drake'))
target: "leftMiddle"
tooltip: "rightMiddle"
backcrossButtonTutorialShown: false
showBackcrossButtonTutorial: ->
if @get('isFirstBackcrossTask') and !@get('backcrossButtonTutorialShown')
@set 'backcrossButtonTutorialShown', true
GG.showInfoDialog $("#offspring-buttons .offspring-buttons-save"),
"You can now Backcross using any %@1 you breed. Click this button to
put the current offspring %@1 into a parent pool, then go back and
select it to breed.".fmt(Ember.I18n.t('drake'))
target: "leftMiddle"
tooltip: "rightMiddle"
GG.powerUpController = Ember.Object.create
powerup: {}
unlockPowerup: (powerup) ->
user = GG.userController.get 'user'
return unless user
powerups = user.get 'powerups'
powerups.pushObject(powerup.name) unless powerups.indexOf(powerup.name) != -1
@set 'powerupChanged', @get('powerupChanged') + 1
hasPowerup: (name) ->
user = GG.userController.get 'user'
return user && user.get('powerups').indexOf(name) != -1
powerupChanged: 0
GG.QTipStyle =
width:
max: 350
padding: '14px',
border:
width: 1
radius: 5
color: '#4e8da6'
name: 'light'
GG.lastShownDialog = null
GG.showInfoDialog = ($elem, text, opts={}) ->
opts.target ?= "leftMiddle"
opts.tooltip ?= "rightMiddle"
opts.maxWidth ?= 350
opts.modal ?= false
opts.modalFade ?= false
opts.buttonText ?= 'OK'
style = Ember.copy GG.QTipStyle, true
style.tip = opts.tooltip
if opts.hideTip
style.tip = false
if opts.hideButton
opts.buttonText = false
style.width =
max: opts.maxWidth
config =
content:
title:
text: '',
button: opts.buttonText
text: text
position:
corner:
target: opts.target
tooltip: opts.tooltip
show:
ready: true
solo: true
when: false
hide: false
style: style
if opts.hideAction?
config.api =
onHide: opts.hideAction
if opts.modal
backdrop = if opts.modalFade then "#modal-backdrop-fade" else "#modal-backdrop-clear"
config.api ?= {}
config.api.beforeShow = ->
$(backdrop).fadeIn(@options.show.effect.length)
config.api.beforeHide = ->
$(backdrop).fadeOut(@options.show.effect.length)
GG.lastShownDialog = $elem
$elem.qtip config
$elem.bind 'hide', ->
$(this).qtip('hide')
GG.showChainedInfoDialog = ($elem, textArr, opts={}) ->
opts.finalCallback = opts.hideAction unless opts.finalCallback?
text = textArr[0]
textArr = textArr.splice(1)
if textArr.length
opts.hideAction = ->
GG.showChainedInfoDialog $elem, textArr, opts
GG.showInfoDialog $elem, text, opts
else
opts.hideAction = opts.finalCallback
GG.showInfoDialog $elem, text, opts
GG.showModalDialog = (text, hideAction) ->
body = $('body')
GG.lastShownDialog = body
body.qtip
content:
title:
text: '',
button: 'OK'
text: text
position:
target: $(document.body)
corner: 'center'
show:
ready: true
solo: true
when: false
hide: false
style: GG.QTipStyle
api:
onHide: hideAction
beforeShow: ->
$('#modal-backdrop-fade').fadeIn(@options.show.effect.length)
beforeHide: ->
$('#modal-backdrop-fade').fadeOut(@options.show.effect.length)
GG.hideInfoDialogs = ->
$('.qtip').qtip('hide')
GG.reputationController = Ember.Object.create
swapChangedEarned: false
showTotal: true
reset: (->
@set('bestTaskReputation', Number.NEGATIVE_INFINITY)
@set('bestTaskReputationReasons', {})
@resetCurrent()
)
resetCurrent: ->
@set('currentTaskReputation', 0)
@set('currentTaskReputationReasons', {})
bestTaskReputationBinding: 'GG.tasksController.currentTask.reputationEarned'
bestTaskReputationReasons: {}
bestTaskReputationDisplay: (->
best = @get('bestTaskReputation')
if best < 0 then 0 else best
).property('bestTaskReputation')
currentTaskReputation: 0
currentTaskReputationReasons: {}
addReputation: (rep, reason)->
reasons = @get 'currentTaskReputationReasons'
current_rep = @get 'currentTaskReputation'
reasons[reason] ||= 0
reasons[reason] += rep
current_rep += rep
@set('currentTaskReputationReasons', reasons)
@set('currentTaskReputation', current_rep)
subtractReputation: (rep, reason)->
@addReputation(-rep, reason)
# ensure "current" rep for task is valid
finalizeReputationForTaskRun: ->
current = @get 'currentTaskReputation'
@set 'currentTaskReputation', Math.max current, 0
# the task is complete
finalizeReputation: ->
best = @get 'bestTaskReputation'
if GG.baselineController.get 'isBaseline'
# calculate "reputation" based on breeds used
current = GG.tasksController.get 'baselineTaskReputation'
else
current = @get 'currentTaskReputation'
current = 0 if current == null
evt = if @get('swapChangedEarned') then GG.Events.REPUTATION_CHANGED else GG.Events.REPUTATION_EARNED
GG.logController.logEvent evt, {amount: current}
if best == null || current > best
Ember.run =>
@set('bestTaskReputation', current)
@set('bestTaskReputationReasons', @get('currentTaskReputationReasons'))
best = 0 if best == Number.NEGATIVE_INFINITY
GG.userController.addReputation(current - best)
return current
_repFor: (evt)->
reasons = @get('currentTaskReputationReasons')
reasons[evt] || 0
currentTaskBinding: 'GG.tasksController.currentTask'
reputationForTask: (->
@get 'currentTask.reputation'
).property('currentTask')
breedsLeftBinding: 'GG.cyclesController.cycles'
hasObstacleCourseBinding: 'GG.obstacleCourseController.hasObstacleCourse'
animatedReputation: 0
currentTaskReputationAssumingCompletion: (->
current = @get('currentTaskReputation')
current += @get('reputationForTask')
if @get('hasObstacleCourse')
current += (@get('breedsLeft') * GG.actionCostsController.getCost('cycleRemainingBonus'))
#current -= @_repFor GG.Events.INCOMPLETE_COURSE
#current -= @_repFor GG.Events.COMPLETED_TASK
if current < 0 then 0 else current
).property('currentTaskReputation','reputationForTask','breedsLeft','hasObstacleCourse')
animateOnReputationChange: (->
changeAnimatedReputation = =>
animated = @get('animatedReputation')
current = @get('currentTaskReputationAssumingCompletion')
if ((animated + 15) < current) or ((animated - 15) > current)
@set('animatedReputation', current) # jump ahead
$("#task-reputation-available").removeClass("drop").removeClass("gain")
return
else if animated < current
@set('animatedReputation', animated+1)
$("#task-reputation-available").addClass("gain")
else if animated > current
@set('animatedReputation', animated-1)
$("#task-reputation-available").addClass("drop")
if @get('animatedReputation') != @get('currentTaskReputationAssumingCompletion')
setTimeout(changeAnimatedReputation, 150)
else
$("#task-reputation-available").removeClass("drop").removeClass("gain")
changeAnimatedReputation()
).observes('currentTaskReputationAssumingCompletion')
extraBreedsRep: (->
@_repFor GG.Events.BRED_WITH_EXTRA_CYCLE
).property('currentTaskReputation')
meiosisControlRep: (->
enables = @_repFor GG.Events.ENABLED_MEIOSIS_CONTROL
chromos = @_repFor GG.Events.CHOSE_CHROMOSOME
crosses = @_repFor GG.Events.MADE_CROSSOVER
enables + chromos + crosses
).property('currentTaskReputation')
alleleRevealRep: (->
@_repFor GG.Events.REVEALED_ALLELE
).property('currentTaskReputation')
GG.groupsController = Ember.Object.create
groups: Ember.ArrayProxy.create
content: Ember.A([
GG.GroupMember.create(),
GG.GroupMember.create()
])
error: false
verifyContent: ->
groups = @get('groups')
found = groups.find (user)->
user.get('invalidName') or user.get('invalidSchoolID')
if found or groups.get('length') < 1
@set('error', true)
return
@set('error', false)
removeUser: (user)->
console.log("remove user called: ", user)
groups = @get('groups')
groups.removeObject(user)
console.log("remove user ended")
addUser: ->
console.log("add user called")
groups = @get('groups')
groups.pushObject(GG.GroupMember.create())
console.log("add user ended")
GG.optionsController = Ember.Object.create
projectedDisplay: false
GG.manualEventController = Ember.Object.create
password: ""
task: null
drakeAlleles: ""
drakeSexes: [ "Female", "Male" ]
drakeSex: null
breedsRemaining: 0
time: 120
reputation: ""
cancel: ->
GG.statemanager.send 'closeAdminPanel'
submit: ->
session = GG.logController.get 'session'
GG.logController.set 'session', "MANUAL-SUBMISSION"
task = @get 'task'
alleles = @get("drakeAlleles") || "MANUAL-SUBMISSION"
sex = if @get("drakeSex") is "Female" then 1 else 0
breedCounter = @get('breedsRemaining')
time = 1000 * @get 'time'
reputation = @get 'reputation'
GG.logController.logEvent GG.Events.COMPLETED_TASK,
name: task.name
breedCounter: breedCounter
elapsedTimeMs: time
reputationEarned: reputation
GG.logController.logEvent GG.Events.SUBMITTED_OFFSPRING,
alleles: alleles
sex: @get "drakeSex"
success: true # must be always true for flash app
GG.logController.set 'session', session
GG.statemanager.send 'closeAdminPanel'
GG.leaderboardController = Ember.ArrayController.create
content : []
fbClassRef: null
fbClassCreator: (->
classWord = GG.userController.get 'classWord'
learnerId = GG.userController.get 'learnerId'
userName = GG.userController.get 'user.codeNameWithLearnerId'
if (not (classWord? and learnerId? and userName?)) or ~userName.indexOf("null")
@set 'fbClassRef', null
return
GG.logController.logEvent "Trying to connect to FireBase"
fbRef = new Firebase 'https://genigames-leaderboard.firebaseio.com/'
# find existing class ref, or create one with some initial data
fbRef.child(classWord).once 'value', (snapshot) =>
reputation = GG.userController.get 'user.reputation'
if (snapshot.val() == null)
# create class ref, add add self and score (FB needs some non-null data)
userCreationObj = {}
userCreationObj[userName] = reputation
fbRef.child(classWord).set userCreationObj, (error) =>
if error
GG.logController.logEvent "Error creating FireBase child node #{classWord}"
console.log "Error creating FB child node #{classWord}"
else
GG.logController.logEvent "Created FireBase child node #{classWord}"
@set 'fbClassRef', fbRef.child(classWord)
else
GG.logController.logEvent "Using FireBase child node #{classWord}"
fbRef.child(classWord).child(userName).setWithPriority(reputation, -reputation)
@set 'fbClassRef', fbRef.child(classWord)
).observes('GG.userController.classWord', 'GG.userController.learnerId', 'GG.userController.user.codeNameWithLearnerId')
fbClassObserver: (->
changedCallback = (scoreSnapshot, prevScoreName) =>
name = scoreSnapshot.name()
score = scoreSnapshot.val()
entry = @find (e) -> e.get("name") is name
if entry?
entry.set 'score', score
@removeObject entry
else
entry = GG.LeaderboardEntry.create
name: <NAME>
score: score
if not prevScoreName?
@insertAt 0, entry
else
entries = @get 'content'
for e, i in entries
if e.get('name') is prevScoreName
@insertAt i+1, entry
fbClassRef = @get 'fbClassRef'
if not fbClassRef? then return
fbClassRef.on 'child_added', changedCallback
fbClassRef.on 'child_changed', changedCallback
).observes('fbClassRef')
updateReputation: (->
classRef = @get('fbClassRef')
return unless classRef?
userName = GG.userController.get 'user.codeNameWithLearnerId'
return unless (userName? && !~userName.indexOf("null"))
reputation = GG.userController.get 'user.reputation'
reputation += GG.townsController.get 'unlockedTownsCost'
# set with priority: -rep to order with highest scores at top
classRef.child(userName).setWithPriority(reputation, -reputation)
).observes('GG.userController.user.reputation')
GG.valueCounterController = Ember.Object.create
valueBinding: 'GG.tasksController.currentTask.reputation'
updateCounter: (->
value = @get 'value'
return if value < 0
if (value >= 100)
hundreds = Math.floor(value / 100) % 10
$('.value-counter .hundreds').show().animate({backgroundPosition: @getPosition(hundreds)}, 200)
else
$('.value-counter .hundreds').hide()
if (value >= 10)
tens = Math.floor(value / 10) % 10
$('.value-counter .tens').show().animate({backgroundPosition: @getPosition(tens)}, 200)
else
$('.value-counter .tens').hide()
ones = value % 10
$('.value-counter .ones').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('value')
getPosition: (num) ->
pos = num * 18
"(0px -" + pos + "px)"
GG.costCounterController = Ember.Object.create
value: (->
GG.reputationController.get('currentTaskReputation') * -1
).property('GG.reputationController.currentTaskReputation')
updateCounter: (->
value = @get 'value'
return if value < 0
if (value >= 100)
hundreds = Math.floor(value / 100) % 10
$('.cost-counter .hundreds').show().animate({backgroundPosition: @getPosition(hundreds)}, 200)
else
$('.cost-counter .hundreds').hide()
if (value >= 10)
tens = Math.floor(value / 10) % 10
$('.cost-counter .tens').show().animate({backgroundPosition: @getPosition(tens)}, 200)
else
$('.cost-counter .tens').hide()
ones = value % 10
$('.cost-counter .ones').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('value')
getPosition: (num) ->
pos = num * 18
"(0px -" + pos + "px)"
GG.tooltipController = Ember.Object.create
show: false
| true | minispade.require 'genigames/controller-mixins'
## Static variables ##
GG.BREED_AUTOMATED = "automated"
GG.BREED_CONTROLLED = "controlled"
GG.userController = Ember.Object.create
learnerDataUrl: (->
lid = @get('learnerId')
if lid?
GG.PORTAL_URL + '/dataservice/bucket_loggers/learner/' + lid + '/bucket_contents.bundle'
else
null
).property('learnerId')
user: null
state: null
learnerId: null
classWord: null
loaded: false
groupInfoSaved: false
learnerChanged: (->
# TODO update learner data
console.log 'learner changed: ', @get('learnerId')
@set('loaded', false)
$.getJSON(@get('learnerDataUrl'), (data) =>
@set('state', data)
@get('user').restoreState()
@set('loaded', true)
if (@get('user.codeName') == null)
@get('user').set 'codeName', GG.codeNameGenerator.generate()
).error =>
@set('state', null)
@set('loaded', true)
).observes('learnerId')
addReputation: (amt) ->
user = @get 'user'
return unless user
user.set 'reputation', user.get('reputation') + amt
evt = if GG.reputationController.get('swapChangedEarned') then GG.Events.REPUTATION_EARNED else GG.Events.REPUTATION_CHANGED
GG.logController.logEvent evt, amount: amt, result: user.get('reputation')
loadState: (type, obj)->
allState = @get('state')
if allState? and allState[type]? and allState[type][obj.get('_id')]?
return allState[type][obj.get('_id')]
else
return {}
stateQueue: []
stateQueueProcessing: false
saveState: (type, obj)->
stateQueue = @get('stateQueue')
stateQueue.push({type: type, obj: obj})
@processStateQueue() unless @get('stateQueueProcessing')
processStateQueue: ->
@set('stateQueueProcessing', true)
queue = @get('stateQueue')
allState = @get('state') || {}
while queue.length > 0
item = queue.shift()
type = item.type
obj = item.obj
allState[type] ||= {}
allState[type][obj.get('_id')] = obj.serialize()
@set('state', allState)
@set('stateQueueProcessing', false)
Ember.run.once this, "persistSaveState"
persistSaveState: ->
if @get('learnerDataUrl')?
allState = @get('state') || {}
$.post @get('learnerDataUrl'), JSON.stringify(allState), (data) =>
console.log 'state saved'
GG.townsController = Ember.ArrayController.create
content : []
currentTown: null
townToBeUnlocked: null
addTown: (town) ->
@pushObject town
currentTownIndex: (->
@indexOf(@get('currentTown'))
).property('currentTown')
firstIncompleteTown: (->
towns = @get('content')
for i in [0...(towns.length)]
t = towns[i]
return t unless t.get('completed')
).property('content')
setCurrentTown: (town, force=false) ->
@completeTownsThrough @indexOf(town) - 1 if force
return false if town is @currentTown
if @indexOf(town) >= 0
@set 'currentTown', town
GG.tasksController.reset()
for ts in town.get 'realTasks'
GG.tasksController.addTask ts
GG.logController.logEvent GG.Events.ENTERED_TOWN, name: town.get('name')
return true
else
throw "GG.townsController.setCurrentTown: argument is not a known town"
# loads a town by name or number
loadTown: (townName) ->
if (not isNaN parseInt(townName))
town = @get('content')[townName-1]
else
town = (town for town in @get('content') when town.get('name') == townName)[0]
@setCurrentTown(town, true) if town?
nextTownsCost: (->
nextTown = @indexOf(@get 'townToBeUnlocked')
previousTown = @get('content')[nextTown-1] unless !nextTown
if not previousTown then return 0
previousTown.get('completionCost')
).property('townToBeUnlocked')
canPayForNextTown: (->
nextTown = @indexOf(@get 'townToBeUnlocked')
previousTown = @get('content')[nextTown-1] unless !nextTown
if not previousTown then return false
if (previousTown.get('locked')) then return false
return (GG.userController.get('user.reputation') >= previousTown.get('completionCost'))
).property('townToBeUnlocked', 'GG.userController.user.reputation')
unlockTown: ->
town = @get 'townToBeUnlocked'
if not town then return
town.set 'locked', false
GG.logController.logEvent GG.Events.UNLOCKED_TOWN, name: town.get('name')
completeCurrentTown: ->
town = @get('currentTown')
town.set('completed', true)
GG.logController.logEvent GG.Events.COMPLETED_TOWN, name: town.get('name')
# 'completeTownsThrough 2' will complete towns 0,1,2
completeTownsThrough: (n) ->
for town, i in @get('content') when i <= n
town.set('completed', true)
town.set('locked', false)
GG.tasksController.completeAllTasksForTown town
if town = @get("content.#{n+1}")
town.set('locked', false)
GG.logController.logEvent GG.Events.COMPLETED_TOWN, name: ("Towns through #" + n)
# the total cost of all towns unlocked so far
unlockedTownsCost: (->
cost = 0
for town, i in @get('content')
if (nextTown = @get("content.#{i+1}")) and not nextTown.get('locked')
cost += town.get 'completionCost'
cost
).property('currentTown', 'GG.userController.user')
GG.tasksController = Ember.ArrayController.create
content : []
currentTask: null
taskStartTime: 0
reset: ->
@set 'content', []
@set 'currentTask', null
addTask: (task) ->
@pushObject task
setCurrentTask: (task, muteLog = false) ->
return if task is @get 'currentTask'
if @indexOf(task) >= 0
if GG.baselineController.get 'isBaseline'
task.set 'cyclesRemaining', 0
else
task.set 'cyclesRemaining', task.get 'cycles'
@set 'currentTask', task
for femaleAlleles in task.initialDrakes.females
org = BioLogica.Organism.createLiveOrganism GG.DrakeSpecies, femaleAlleles, BioLogica.FEMALE
GG.parentController.pushObject GG.Drake.createFromBiologicaOrganism org
for maleAlleles in task.initialDrakes.males
org = BioLogica.Organism.createLiveOrganism GG.DrakeSpecies, maleAlleles, BioLogica.MALE
GG.parentController.pushObject GG.Drake.createFromBiologicaOrganism org
unless muteLog
GG.logController.logEvent GG.Events.STARTED_TASK, name: task.get('name')
@set('taskStartTime', new Date().getTime())
else
throw "GG.tasksController.setCurrentTask: argument is not a known task"
setNextAvailableTask: (taskIndex) ->
tasks = @get('content')
@completeTasksThrough taskIndex - 1 if taskIndex < tasks.length
clearCurrentTask: ->
@set 'currentTask', null
GG.parentController.reset()
awardTaskReputation: (success) ->
task = @get 'currentTask'
isCourse = GG.obstacleCourseController.get 'hasObstacleCourse'
if isCourse
reputation = GG.obstacleCourseController.get 'reputationEarned'
else
reputation = task.get('reputation')
event = if (isCourse and !success) then GG.Events.INCOMPLETE_COURSE else GG.Events.COMPLETED_TASK
GG.reputationController.addReputation(reputation, event)
GG.reputationController.finalizeReputationForTaskRun()
return GG.reputationController.finalizeReputation()
completeCurrentTask: ->
task = @get 'currentTask'
task.set 'completed', true
# If the current task is not complete, that means completion was forced.
# A task with an obstacle course will do this when breeds remaining hits 0, for example.
reputation = @awardTaskReputation(@get('isCurrentTaskComplete'))
GG.logController.logEvent GG.Events.COMPLETED_TASK,
name: task.get('name')
breedCounter: GG.cyclesController.get('cycles')
elapsedTimeMs: (new Date().getTime()) - @get('taskStartTime')
reputationEarned: reputation
restartCurrentTask: ->
task = @get 'currentTask'
GG.reputationController.resetCurrent()
GG.logController.logEvent GG.Events.RESTARTED_TASK, name: task.get('name')
@clearCurrentTask()
@setCurrentTask(task)
@taskAccepted task
completeTasksThrough: (n) ->
for task, i in @get('content') when i <= n
task.set('completed', true)
powerups = task.get('powerups')
if powerups && powerups.length > 0
powerup = powerups[0]
GG.powerUpController.unlockPowerup(powerup)
GG.logController.logEvent GG.Events.COMPLETED_TASK, name: ("Tasks through #" + n)
completeAllTasksForTown: (town) ->
for task, i in town.get('realTasks')
task.set('completed', true)
powerups = task.get('powerups')
if powerups && powerups.length > 0
powerup = powerups[0]
GG.powerUpController.unlockPowerup(powerup)
GG.logController.logEvent GG.Events.COMPLETED_TASK, name: ("Completed all tasks for #{town.get('name')}")
currentLevelId: (->
task = @get('currentTask')
id = ""
if GG.baselineController.get('isBaseline')
if task and task.get('baselineName')
id = ": " + task.get 'baselineName'
else
if task
id = ": " + task.get 'name'
id = id.replace("Task", "Drake")
return id
).property('currentTask')
currentTargetTraits: (->
target = @get 'currentTask.targetDrake'
if target
target = target.replace(/, ?/g,"</li><li>")
new Handlebars.SafeString "<ul><li>" + target + "</li></ul>"
else ""
).property('currentTask')
targetCountBinding: Ember.Binding.oneWay('currentTask.targetCount')
matchCountBinding: Ember.Binding.oneWay('currentTask.matchCount')
showTaskDescription: (task) ->
@setCurrentTask task
otherTask.set('showQuestionBubble', false) for otherTask in GG.tasksController.content
task.set 'showSpeechBubble', true
showTaskEndMessage: (task) ->
if task.get('npc.speech.completionText')?
task.set 'isShowingEndMessage', true
task.set 'showSpeechBubble', true
else
GG.statemanager.send 'done'
showTaskThanksMessage: (task) ->
task.set 'isShowingThanksMessage', true
task.set 'isShowingFailMessage', false
task.set 'isShowingEndMessage', false
task.set 'showSpeechBubble', true
showTaskFailMessage: (task) ->
task.set 'isShowingThanksMessage', false
task.set 'isShowingEndMessage', false
task.set 'isShowingFailMessage', true
task.set 'showSpeechBubble', true
showTaskCompletion: (success) ->
if GG.baselineController.get('isNotBaseline') and GG.lastShownDialog?
try
GG.tutorialMessageController.set('finishButtonTutorialShown', true)
GG.lastShownDialog.qtip('hide')
catch e
GG.lastShownDialog = null
GG.statemanager.transitionTo 'inTown', [@get('currentTask'), success]
showTaskNonCompletion: ->
msg = "That's not the %@ you're looking for!".fmt(Ember.I18n.t('drake'))
msg += " You're trying to "
msg += (
@get('currentTask.npc.speech.shortText').toLowerCase() ||
("breed a drake with " + @get('currentTask.targetDrake') + ".")
).replace('drake', Ember.I18n.t('drake'))
GG.showModalDialog msg
taskAccepted: (task) ->
task.set 'showSpeechBubble', false
GG.statemanager.transitionTo 'inTask'
isCurrentTaskComplete: ->
task = @get 'currentTask'
drake = GG.breedingController.get 'child'
if not task? or not drake?
return false
# parse required characteristics
parsedCharacteristics = task.get('targetDrake').split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
if drake.hasCharacteristics(parsedCharacteristics)
task.set 'matchCount', (task.get 'matchCount')+1
return true if task.get('matchCount') >= task.get('targetCount')
return false
powerupsBinding: Ember.Binding.oneWay('GG.userController.user.powerups')
meiosisControlEnabled: (->
GG.powerUpController.hasPowerup("meiosis control") || !!@get('currentTask.meiosisControl')
).property('currentTask.meiosisControl', 'powerups.@each')
hasHiddenGenes: (->
hidden = @get 'currentTask.hiddenGenes'
if hidden? and hidden.length > 0
return true
else
return false
).property('currentTask.hiddenGenes')
baselineTaskReputation: (->
rep = 0
if @get('currentTask')?
cyclesUsed = @get('currentTask.cyclesRemaining')
cyclesAllowed = @get('currentTask.cycles')
if cyclesUsed < (cyclesAllowed/2)
rep = 100
else if cyclesUsed > (cyclesAllowed*2)
rep = 0
else
allowed = (cyclesAllowed*2)-(cyclesAllowed/2)
used = cyclesUsed - (cyclesAllowed/2)
remaining = allowed - used
rep = Math.floor(100*(remaining/allowed))
return rep
).property('currentTask','currentTask.cyclesRemaining')
updateHeartFills: ->
task.propertyDidChange('reputationEarned') for task in @get('content')
GG.drakeController = Ember.Object.create
visibleGenesBinding: 'GG.tasksController.currentTask.visibleGenes'
hiddenGenesBinding: 'GG.tasksController.currentTask.hiddenGenes'
GG.parentController = Ember.ArrayController.create
content: []
maxMales: 40
maxFemales: 40
selectedMother: null
selectedFather: null
reset: ->
@set 'selectedMother', null
@set 'selectedFather', null
@clear()
females: (->
drake for drake in @get('content') when drake.sex is GG.FEMALE
).property('content.@each')
males: (->
drake for drake in @get('content') when drake.sex is GG.MALE
).property('content.@each')
hasRoom: (drake) ->
if drake.sex is GG.MALE
return @get('males').length < @get 'maxMales'
else
return @get('females').length < @get 'maxFemales'
whosSelected: (->
mother = @get('selectedMother')
father = @get('selectedFather')
if mother or father
return "mother" unless father
return "father" unless mother
return "both"
return "none"
).property('selectedMother', 'selectedFather')
GG.fatherPoolController = Ember.ArrayController.create
contentBinding: 'GG.parentController.males'
selectedBinding: 'GG.parentController.selectedFather'
hidden: true
GG.motherPoolController = Ember.ArrayController.create
contentBinding: 'GG.parentController.females'
selectedBinding: 'GG.parentController.selectedMother'
hidden: true
# Fixme: This needs to be rethrought now that we will always only
# have one offspring. Maybe it can just be replaced by breedingController.child
GG.offspringController = Ember.Object.create
content: null
hidden: false
selectedBinding: 'content'
GG.breedingController = Ember.Object.create
motherBinding: 'GG.parentController.selectedMother'
fatherBinding: 'GG.parentController.selectedFather'
isShowingBreeder: false
isShowingBreeder2: false # stupid stupid Ember...
isBreeding: false
breedType: GG.BREED_AUTOMATED
child: null
childSavedToParents: false
breedDrake: ->
if (@get('mother') && @get('father')) || GG.meiosisController.get('chosenAlleles')?
@set 'isBreeding', true
org = null
if GG.meiosisController.get('chosenAlleles')?
org = BioLogica.Organism.createOrganism(GG.DrakeSpecies, GG.meiosisController.get('chosenAlleles'), GG.meiosisController.get('chosenSex'))
else
org = BioLogica.breed @get('mother.biologicaOrganism'), @get('father.biologicaOrganism')
drake = GG.Drake.createFromBiologicaOrganism org
drake.set 'bred', true
if GG.meiosisController.get('chosenAlleles')?
revealed = GG.meiosisController.get('chosenRevealedAlleles')
for r in [0...revealed.length]
rev = revealed[r]
drake.markRevealed(rev.side, rev.allele)
GG.breedingController.set 'child', drake
GG.offspringController.set 'content', drake
Ember.run.next ->
GG.statemanager.send 'showOffspring'
@set 'isBreeding', false
GG.logController.logEvent GG.Events.BRED_DRAGON,
mother: @get('mother.biologicaOrganism.alleles')
father: @get('father.biologicaOrganism.alleles')
offspring: drake.get('biologicaOrganism.alleles')
offspringSex: drake.get('sex')
GG.cyclesController = Ember.Object.create
cyclesBinding: 'GG.tasksController.currentTask.cyclesRemaining'
increment: (amt=1) ->
@set 'cycles', @get('cycles')+amt
decrement: (amt=1) ->
cycles = @get 'cycles'
return if cycles <= 0
@set 'cycles', cycles-amt
reset: ->
setTimeout =>
@updateCounter()
, 1000
updateCounter: (->
cycles = @get 'cycles'
return if cycles < 0
hundreds = Math.floor(cycles / 100) % 10
$('#moveCounterHundreds').animate({backgroundPosition: @getPosition(hundreds)}, 200)
tens = Math.floor(cycles / 10) % 10
$('#moveCounterTens').animate({backgroundPosition: @getPosition(tens)}, 200)
ones = cycles % 10
$('#moveCounterOnes').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('cycles')
getPosition: (num) ->
pos = num * 26
"(0px -" + pos + "px)"
GG.logController = Ember.Object.create
learnerIdBinding: 'GG.userController.learnerId'
learnerLogUrl: (->
lid = @get('learnerId')
if lid?
GG.PORTAL_URL + '/dataservice/bucket_loggers/learner/' + lid + '/bucket_log_items.bundle'
else
null
).property('learnerId')
learnerLogUrlChanged: (->
if @get('learnerLogUrl')?
@processEventQueue()
).observes('learnerLogUrl')
syncTime: new SyncTime(GG.PORTAL_URL + '/time')
session: null
eventQueue: []
eventQueueInProgress: []
triedToEmptyEventQueue: false
startNewSession: ->
@set('session', @generateGUID())
@logEvent GG.Events.STARTED_SESSION
@startEventQueuePolling()
startEventQueuePolling: ->
setInterval =>
@processEventQueue() unless @eventQueueInProgress.length > 0
, 10000
processEventQueue: ->
if @get('triedToEmptyEventQueue') and @eventQueue.length is 0
# we had lost connection but now we have regained it
@set 'triedToEmptyEventQueue', false
GG.statemanager.send 'notifyConnectionRegained'
if @get('learnerLogUrl')? and @eventQueue.length > 0
# a previous save event failed, so we have events in our queue
if @get('triedToEmptyEventQueue')
# we already tried to empty event queue once and we didn't succeed
GG.statemanager.send 'notifyConnectionLost'
@set 'triedToEmptyEventQueue', true
@eventQueueInProgress = @eventQueue.slice(0)
@eventQueue = []
while @eventQueueInProgress.length > 0
evt = @eventQueueInProgress.shift()
@persistEvent(evt)
logEvent: (evt, params) ->
date = @syncTime.now()
logData =
session : @get('session')
time : date.getTime()
prettyTime : date.toString()
internetTime: date.toInternetTime(2)
timeDrift : @syncTime.drift
event : evt
parameters : params
@persistEvent logData
persistEvent: (evt)->
if @get('learnerLogUrl')?
$.post(@get('learnerLogUrl'), JSON.stringify(evt), (data)->
console.log 'log event saved'
).error =>
console.log 'log event save failed!'
@eventQueue.push evt
else
console.log 'log event generated (no save)', evt
@eventQueue.push evt
generateGUID: ->
S4 = -> (((1+Math.random())*0x10000)|0).toString(16).substring(1)
S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()
GG.sessionController = Ember.Object.create
checkTokenUrl: GG.PORTAL_URL + '/verify_cc_token'
loginUrl: GG.PORTAL_URL + '/remote_login'
logoutUrl: GG.PORTAL_URL + '/remote_logout'
userBinding: 'GG.userController.user'
loadedBinding: 'GG.userController.loaded'
error: false
loggingIn: false
firstTime: true
registrationError: false
registrationErrorMessage: null
preloadingComplete: false
waitingForPreload: false
registeredUsername: null
loggedIn: (->
@get('user') != null
).property('user')
classesWithLearners: (->
found = []
classes = @get('user.classes')
if classes? and classes.length > 0
for i in [0...(classes.length)]
cl = classes[i]
if cl? and cl.learner? and cl.learner > 0
cl.label = cl.name + " (" + cl.teacher + ")"
found.push(cl)
return found
).property('user')
checkCCAuthToken: ->
$.ajax
type: "GET"
url: @checkTokenUrl
xhrFields:
withCredentials: true
success: (data) =>
if data.error?
@set('error', true)
@set('loggingIn', false)
else
user = GG.User.create data
@set('user', user)
GG.statemanager.send 'successfulLogin'
error: =>
@set('loggingIn', false)
@set('error', true)
setTimeout ->
if username = GG.sessionController.get 'registeredUsername'
$('#username-field input').attr 'value', username
, 50
loginPortal: (username, password)->
@set('firstTime', false)
$.ajax
type: "POST"
url: @loginUrl
data: "login=#{username}&password=#{password}"
dataType: "application/x-www-form-urlencoded"
xhrFields:
withCredentials: true
success: (data) =>
@checkCCAuthToken()
error: =>
# unsure why we get 'error' even when request returns 200
@checkCCAuthToken()
logoutPortal: ->
@set('firstTime', true)
@set('user', null)
@set('loaded', false)
@set('loggingIn', false)
GG.userController.set('classWord', null)
GG.userController.set('learnerId', null)
GG.tasksController.set('content',[])
GG.townsController.set('content',[])
GG.leaderboardController.set('content',[])
$.ajax
type: "POST"
url: @logoutUrl
xhrFields:
withCredentials: true
complete: =>
GG.statemanager.transitionTo 'loggingIn'
GG.actionCostsController = Ember.Object.create
getCost: (action) ->
level = GG.townsController.get('currentTownIndex')
pts = [].concat @get('content.'+action)
if level >= pts.length
level = (pts.length - 1) # the final value is used for all remaining levels
pts[level] || 0
GG.meiosisController = Ember.Object.create
canBreedDuringAnimation: true
speedControlEnabled: (->
# enable on town 1 task 7
townId = 1 + GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = 1 + GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId*10 + taskId >= 17
).property('GG.townsController.currentTown', 'GG.tasksController.currentTask')
inAnimation: false
motherView: null
fatherView: null
firstView: null
secondView: null
motherGameteNumberBinding: 'motherView.randomGameteNumberOverride'
fatherGameteNumberBinding: 'fatherView.randomGameteNumberOverride'
chosenMotherAllelesBinding: 'motherView.chosenGameteAlleles'
chosenFatherAllelesBinding: 'fatherView.chosenGameteAlleles'
chosenMotherGameteBinding: 'motherView.chosenGamete'
chosenFatherGameteBinding: 'fatherView.chosenGamete'
chosenSexBinding: 'fatherView.chosenSex'
firstParent: null
secondParent: null
selectFirstParent: (parent, force) ->
return if @get('inAnimation') unless force
@set 'firstParent', parent
@set 'secondParent', (if parent is "mother" then "father" else "mother")
if !parent?
@set 'firstView', null
@set 'secondView', null
else if parent is "mother"
@set 'firstView', @get 'motherView'
@set 'secondView', @get 'fatherView'
else
@set 'firstView', @get 'fatherView'
@set 'secondView', @get 'motherView'
if @get 'waitingForParentSelection'
@animate()
chosenAlleles: (->
return @get('chosenMotherAlleles') + "," + @get('chosenFatherAlleles')
).property('chosenMotherAlleles','chosenFatherAlleles')
chosenRevealedAlleles: (->
femGam = @get 'chosenMotherGamete'
maleGam = @get 'chosenFatherGamete'
res = []
for own ch of maleGam
rev = maleGam[ch].revealed || []
for i in [0...rev.length]
res.push {allele: rev[i], side: 'b'}
for own ch of femGam
rev = femGam[ch].revealed || []
for i in [0...rev.length]
res.push {allele: rev[i], side: 'a'}
return res
).property('chosenMotherGamete','chosenFatherGamete')
animate: (callback)->
if @get('firstView')? and @get('secondView')?
@set 'waitingForParentSelection', false
@set('inAnimation', true)
$(".parent-select-target").removeClass("active")
GG.tutorialMessageController.showMeiosisTutorial @get('firstParent'), =>
@get('firstView').animate =>
@get('secondView').animate =>
GG.MeiosisAnimation.mergeChosenGametes("#" + @get('fatherView.elementId'), "#" + @get('motherView.elementId'), =>
@set('inAnimation', false)
if callback
callback()
else @get('delayedCallback')()
)
else
@set 'waitingForParentSelection', true
@set 'delayedCallback', callback
resetAnimation: ->
if @get('motherView')? and @get('fatherView')?
@selectFirstParent(null, true)
@get('motherView').resetAnimation()
@get('fatherView').resetAnimation()
@set('selectedChromosomes', { father: {}, mother: {}})
@set('chromosomeSelected', false)
@set('selectedCrossover', null)
@set('crossoverSelected', false)
@set('inAnimation', false)
@set('motherGameteNumber', -1)
@set('fatherGameteNumber', -1)
chromosomeSelected: false
selectedChromosomes: { father: {}, mother: {}}
deselectChromosome: (chromoView) ->
selected = @get('selectedChromosomes')
source = if chromoView.get('content.sex') == GG.MALE then "father" else "mother"
chromo = chromoView.get('chromo')
chromo = "XY" if chromo is "X" or chromo is "Y"
chromoView.set('selected', false)
selected[source][chromo] = null
# Refund the reputation that was charged to select this chromosome
GG.reputationController.addReputation(GG.actionCostsController.getCost('chromosomeSelected'), GG.Events.CHOSE_CHROMOSOME)
clearNum = true
for own chrom,view of selected[source]
clearNum = false if view?
if clearNum
gameteNumberProp = if source is "father" then 'fatherGameteNumber' else 'motherGameteNumber'
@set(gameteNumberProp, -1)
# TODO We should probably revert any cell num swaps that happened on selection, so the user can't
# cheat by selecting and then deselecting and having them move to the same gamete anyway
selectChromosome: (chromoView) ->
@set('chromosomeSelected', true)
selected = @get('selectedChromosomes')
source = if chromoView.get('content.sex') == GG.MALE then "father" else "mother"
chromo = chromoView.get('chromo')
chromo = "XY" if chromo is "X" or chromo is "Y"
if selected[source][chromo]?
selected[source][chromo].set('selected', false)
else
# There was no previously selected chromosome, so charge rep points
GG.reputationController.subtractReputation(GG.actionCostsController.getCost('chromosomeSelected'), GG.Events.CHOSE_CHROMOSOME)
selected[source][chromo] = chromoView
gameteNumberProp = if source is "father" then 'fatherGameteNumber' else 'motherGameteNumber'
destGameteNum = @get(gameteNumberProp)
sourceGameteNum = chromoView.get('cellNum')
if destGameteNum == -1
@set(gameteNumberProp, sourceGameteNum)
else
# if the selected chromosome is *not* in the to-be-selected gamete, move it into it
if sourceGameteNum != destGameteNum
Ember.run =>
# get the gametes
gametes = if source is "father" then @get('fatherView.gametes') else @get('motherView.gametes')
# swap the source chromo and the destination chromo
destChromo = gametes.cells[destGameteNum][chromo]
gametes.cells[destGameteNum][chromo] = gametes.cells[sourceGameteNum][chromo]
gametes.cells[sourceGameteNum][chromo] = destChromo
# swap the endCellInfo numbers
destRealSide = ''
sourceRealSide = ''
for own side,num of gametes.endCellInfo[chromo]
sourceRealSide = side if num == sourceGameteNum
destRealSide = side if num == destGameteNum
gametes.endCellInfo[chromo][sourceRealSide] = destGameteNum
gametes.endCellInfo[chromo][destRealSide] = sourceGameteNum
if source is "father"
@set('fatherView.gametes', $.extend(true, {}, gametes))
@get('fatherView').notifyPropertyChange('gametes')
else
@set('motherView.gametes', $.extend(true, {}, gametes))
@get('motherView').notifyPropertyChange('gametes')
visibility: (chromoView, allele)->
if chromoView.get('visibleAlleles').indexOf(allele) != -1
return 'visible'
if chromoView.get('hiddenAlleles').indexOf(allele) != -1
return 'hidden'
else
return 'invisible'
crossoverSelected: false
selectedCrossover: null
selectCrossover: (destCross)->
@set('crossoverSelected', true)
# get the gene for this allele
gene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, destCross.allele)
destCross.gene = gene
source = if destCross.chromoView.get('content.sex') == GG.MALE then "father" else "mother"
meiosisView = @get(source + 'View')
parentSelector = '#' + meiosisView.get('elementId')
# Highlight the valid second choices, by removing 'clickable' on invalid ones
leftRight = destCross.chromoView.get('right')
points = parentSelector + ' .crossoverPoint:not(.' + gene.name + ')'
points2 = parentSelector + ' .' + leftRight + ' .crossoverPoint.' + gene.name
$(points).removeClass('clickable').addClass('hidden')
$(points2).removeClass('clickable').addClass('hidden')
# mark this one as selected
$('#' + destCross.chromoView.get('elementId') + ' .crossoverPoint.' + gene.name).removeClass('hidden').addClass('selected')
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step1").addClass('hidden')
$(parentSelector + " .crossoverSelection .step2").removeClass('hidden')
if @get('selectedCrossover')?
sourceCross = @get('selectedCrossover')
if sourceCross.gene.name == destCross.gene.name and sourceCross.chromoView.get('side') != destCross.chromoView.get('side')
GG.reputationController.subtractReputation(GG.actionCostsController.getCost('crossoverMade'), GG.Events.MADE_CROSSOVER)
# cross these two
$('#' + destCross.chromoView.get('elementId') + ' .crossoverPoint.' + gene.name).removeClass('clickable').addClass('selected')
# get all genes after this one
genesToSwap = [gene]
allelesToSwap = [
{
gene: sourceCross.gene,
source: sourceCross.allele,
sourceVisibility: @visibility(sourceCross.chromoView, sourceCross.allele)
dest: destCross.allele
destVisibility: @visibility(destCross.chromoView, destCross.allele)
}
]
for allele in sourceCross.chromoView.get('alleles')
alGene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, allele.allele)
if alGene.start > sourceCross.gene.start
genesToSwap.push(alGene)
allelesToSwap.push
gene: alGene
source: allele.allele
sourceVisibility: @visibility(sourceCross.chromoView, allele.allele)
for allele in destCross.chromoView.get('alleles')
alGene = BioLogica.Genetics.getGeneOfAllele(GG.DrakeSpecies, allele.allele)
if alGene.start > sourceCross.gene.start
allelesToSwap.map (item)=>
if item.gene.name == alGene.name
item.dest = allele.allele
item.destVisibility = @visibility(destCross.chromoView, allele.allele)
return item
GG.logController.logEvent GG.Events.MADE_CROSSOVER,
sourceChromo:
drake: if sourceCross.chromoView.get('content.female') then "mother" else "father"
side: sourceCross.chromoView.get('side')
chromo: sourceCross.chromoView.get('chromo')
sister: sourceCross.chromoView.get('sister')
destinationChromo:
drake: if destCross.chromoView.get('content.female') then "mother" else "father"
side: destCross.chromoView.get('side')
chromo: destCross.chromoView.get('chromo')
sister: destCross.chromoView.get('sister')
allelesToSwap: allelesToSwap
# swap them visually
sourceCell = sourceCross.chromoView.get('cellNum')
destCell = destCross.chromoView.get('cellNum')
moves = {}
for swapGene in genesToSwap
moves[swapGene.name] ?= {}
moves[swapGene.name][sourceCell] = destCell
moves[swapGene.name][destCell] = sourceCell
meiosisView.animateMoves moves, =>
# swap them in the gametes.cells
gametes = meiosisView.get('gametes')
chromo = sourceCross.chromoView.get('chromo')
chromo = 'XY' if chromo is 'X'
for swapAlleles in allelesToSwap
alleles = gametes.cells[sourceCell][chromo].alleles.without(swapAlleles.source)
alleles.push(swapAlleles.dest)
gametes.cells[sourceCell][chromo].alleles = alleles
alleles = gametes.cells[destCell][chromo].alleles.without(swapAlleles.dest)
alleles.push(swapAlleles.source)
gametes.cells[destCell][chromo].alleles = alleles
# also swap revealed status
sourceRevealed = gametes.cells[sourceCell][chromo].revealed || []
destRevealed = gametes.cells[destCell][chromo].revealed || []
isSourceRevealed = sourceRevealed.indexOf(swapAlleles.source) != -1
isDestRevealed = destRevealed.indexOf(swapAlleles.dest) != -1
# remove them both first, then insert them second.
# this way we avoid problems if the alleles are the same.
if isSourceRevealed
sourceRevealed = sourceRevealed.without(swapAlleles.source)
if isDestRevealed
destRevealed = destRevealed.without(swapAlleles.dest)
if isSourceRevealed
destRevealed.push(swapAlleles.source)
if isDestRevealed
sourceRevealed.push(swapAlleles.dest)
if isSourceRevealed or isDestRevealed
gametes.cells[sourceCell][chromo].revealed = sourceRevealed
gametes.cells[destCell][chromo].revealed = destRevealed
meiosisView.set('gametes', $.extend(true, {}, gametes))
meiosisView.notifyPropertyChange('gametes')
# update the step-by-step directions
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step2").addClass('hidden')
$(parentSelector + " .crossoverSelection .step3").removeClass('hidden')
@clearCrossPoints(meiosisView)
else if sourceCross.chromoView == destCross.chromoView
# deselect this cross point
@clearCrossPoints(meiosisView)
if $(parentSelector + " .crossoverSelection .step3").hasClass('hidden')
$(parentSelector + " .crossoverSelection .step2").addClass('hidden')
$(parentSelector + " .crossoverSelection .step1").removeClass('hidden')
else
console.log("invalid second cross point!")
else
@set('selectedCrossover', destCross)
clearCrossPoints: (meiosisView)->
# clear the saved cross point
@set('selectedCrossover', null)
Ember.run.next ->
parentSelector = '#' + meiosisView.get('elementId')
selector = parentSelector + ' .crossoverPoint'
$(selector).addClass('clickable')
$(selector).removeClass('hidden')
$(selector).removeClass('selected')
GG.OBSTACLE_COURSE_INTERNAL = "obstacle_course_internal"
GG.OBSTACLE_COURSE_EXTERNAL = "obstacle_course_external"
GG.obstacleCourseController = Ember.Object.create
courseBinding: 'GG.tasksController.currentTask.obstacleCourse'
obstaclesBinding: 'course.obstacles'
drakeBinding: 'GG.offspringController.content'
breedsLeftBinding: 'GG.cyclesController.cycles'
taskComplete: (->
GG.tasksController.isCurrentTaskComplete()
).property('drake')
obstaclesPassed: 0
dialogVisible: false
currentObstacleIndex: 0
currentObstacle: null
mode: GG.OBSTACLE_COURSE_INTERNAL
hasObstacleCourse: (->
@get('course')? && GG.baselineController.get('isNotBaseline')
).property('course')
setFirstObstacle: (->
@set 'currentObstacle', @get('obstacles')?[0]
).observes 'obstacles'
setCurrentObstacle: (->
index = @get 'currentObstacleIndex'
@set 'currentObstacle', @get('obstacles')?[index]
).observes 'currentObstacleIndex'
goToNextObstacle: ->
nextIndex = @get('currentObstacleIndex')+1
@set 'currentObstacleIndex', nextIndex
showInfoDialog: ->
if not GG.tasksController.isCurrentTaskComplete()
text = "Uh oh, you're out of breeds! You're going to have to send this Drake to
the obstacle course. Good luck!"
else
breedsLeft = @get 'breedsLeft'
num = "no, one, two, three, four, five, six, seven, eight, nine, ten".split(", ")[breedsLeft]
s = if breedsLeft is 1 then "" else "s"
text = "Great job, I think this Drake will do well in the obstacle course!
Because you had #{num} breed#{s} remaining, your Drake "
text +=
if breedsLeft then "will be trained #{num} time#{s} before the course,
which will make it even faster!"
else "won't be trained before the course."
GG.showModalDialog text, -> GG.statemanager.send "startCourse"
reputationEarned: (->
return 0 unless @get('course')?
taskRep = GG.tasksController.get 'currentTask.reputation'
if not taskRep? then return null
taskComplete = @get 'taskComplete'
if taskComplete
training = @get 'breedsLeft'
# earn 10 points per breed left
return taskRep + (training * GG.actionCostsController.getCost('cycleRemainingBonus'))
else
# earn 10% of repuation per obstacle passed
# this calculation is ugly...
if @get('obstacles') && @get('obstacles').length > 0
@set 'obstaclesPassed', 0
for obstacle in @get('obstacles')
@calculateTime(obstacle, false)
passed = @get 'obstaclesPassed'
return Math.round taskRep * passed * 0.1
else
# we have an obstacle course with no obstacles (aka the tournament)
# calculate the score based on the number of matching traits
task = GG.tasksController.get 'currentTask'
drake = GG.breedingController.get 'child'
if not task? or not drake?
return Math.round(taskRep * 0.5)
# parse required characteristics
parsedCharacteristics = task.get('targetDrake').split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
matchedChars = drake.hasHowManyCharacteristics(parsedCharacteristics)
modifiers = [0, 0.2, 0.4, 0.6, 0.7, 1.0]
if matchedChars >= modifiers.length
matchedChars = modifiers.length - 1
return Math.round taskRep * modifiers[matchedChars]
).property('drake', 'obstaclesPassed')
myTotalTime: (->
return 0 unless @get('course')? and @get('obstacles')?
total = 0
for obstacle in @get('obstacles')
total += @calculateTime(obstacle, false)
return total
).property('course','breedsLeft','obstacles', 'drake')
opponentTotalTime: (->
return 0 unless @get('course')? and @get('obstacles')?
total = 0
for obstacle in @get('obstacles')
total += @calculateTime(obstacle, true)
return Math.round total
).property('course','opponentBreedsLeft','obstacles')
didPassObstacle: (obstacle=@get('currentObstacle')) ->
drake = @get 'drake'
target = obstacle.target
parsedCharacteristics = target.split(/\s*,\s*/).map (ch, idx, arr)->
ch = ch.toLowerCase()
ch.charAt(0).toUpperCase() + ch.slice(1)
drake.hasCharacteristics(parsedCharacteristics)
calculateTime: (obstacle, opponent=false)->
obsTime = obstacle.time || 1
# opponent always goes 10% slower
if opponent then return obsTime * 1.1
drake = @get 'drake'
target = obstacle.target
return 0 unless drake
return 1 unless target
unless @didPassObstacle obstacle
# failure
return obsTime * 4
@set 'obstaclesPassed', @get('obstaclesPassed') + 1
training = @get 'breedsLeft'
speedup = Math.pow(0.9, training) # reduce speed by 10% for each training cycle
return Math.round obsTime * speedup
GG.baselineController = Ember.Object.create
isBaseline: false
isNotBaseline: Ember.computed.not('isBaseline')
GG.tutorialMessageController = Ember.Object.create
enabled: true
isFirstTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId+taskId is 0
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisDescriptionTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return townId is 0 and taskId is 1
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
# TODO There should be a better way to detect this other than hard-coding it...
isFirstMeiosisControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 4) or (GG.baselineController.get('isBaseline') and townId is 1 and taskId is 0)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisGenderControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 6)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstMeiosisSpeedControlTask: (->
unless @get('enabled')
return false
townId = GG.townsController.get("content").indexOf GG.townsController.get "currentTown"
taskId = GG.tasksController.get("content").indexOf GG.tasksController.get "currentTask"
return (townId is 0 and taskId is 6)
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
isFirstBackcrossTask: (->
GG.tasksController.get("currentTask.powerups.0.name") is "backcrossing"
).property('enabled', 'GG.townsController.currentTown', 'GG.tasksController.currentTask')
traitBarTutorialShown: false
showTraitBarTutorial: ->
if @get('isFirstTask') and !@get 'traitBarTutorialShown'
setTimeout =>
GG.statemanager.send 'waitForTraitSelection'
, 200
@set 'traitBarTutorialShown', true
GG.showInfoDialog $('#trait-selection-tutorial-target'),
"Use the Trait Tracker to remember the traits you need. Atheena has asked for
a %@1 with wings. To move ahead, click wings now.".fmt(Ember.I18n.t('drake')),
target: "bottomMiddle"
tooltip: "topMiddle"
hideButton: true
firstDrakeSelected: false
showFirstDrakeSelectionTutorial: (parent) ->
if @get('isFirstTask') and !@get 'firstDrakeSelected'
target = if parent is "mother" then "topMiddle" else "bottomMiddle"
tooltip = if parent is "mother" then "bottomMiddle" else "topMiddle"
@set 'firstDrakeSelected', true
GG.showInfoDialog $("##{parent}-chromosome"),
'These are the %@1\'s chromosomes. Here, the gene for Wings is shown: <span style="position: relative;">
<img src="../images/allele-bg.png" style="position: absolute; top: -6px; left: 3px">
<span style="position: absolute; top: 0; left: 6px; font-weight: bold;" class="dominant">
W1</span></span>'.fmt(Ember.I18n.t('drake')),
target: target
tooltip: tooltip
meiosisSelectionTutorialShown: false
showMeiosisSelectionTutorial: ->
if @get('isFirstTask') and !@get 'meiosisSelectionTutorialShown'
@set 'meiosisSelectionTutorialShown', true
GG.showInfoDialog $('.father .mainCell'),
"To start meiosis, click on the mother or the father, or click on the chromosomes",
target: "rightBottom"
tooltip: "leftTop"
hideTip: true
showMaleParentsTutorial: ->
GG.showInfoDialog $("#male-parents-tutorial-target"),
"Here are the male parent %@1s.
Choose one for breeding now.".fmt(Ember.I18n.t('drake')),
target: "rightMiddle"
tooltip: "leftMiddle"
hideButton: true
showFemaleParentsTutorial: ->
GG.showInfoDialog $("#female-parents-tutorial-target"),
"Here are the female parent %@1s.
Choose one for breeding now.".fmt(Ember.I18n.t('drake')),
target: "rightMiddle"
tooltip: "leftMiddle"
hideButton: true
breedButtonTutorialShown: false
speedTutorialShown: false
motherBinding: 'GG.parentController.selectedMother'
fatherBinding: 'GG.parentController.selectedFather'
bothParentsSelected: (->
@get('mother')? and @get('father')?
).property('mother','father')
showBreedButtonTutorial: ->
if @get('isFirstTask') and !@get('breedButtonTutorialShown') and @get 'bothParentsSelected'
@set 'breedButtonTutorialShown', true
GG.showInfoDialog $("#breed-button"),
"Good job! Notice that males have beards and females don't.
Next, hit the Breed button to create the child.",
target: "leftMiddle"
tooltip: "rightMiddle"
else if @get('isFirstMeiosisSpeedControlTask') and !@get('speedTutorialShown') and @get 'bothParentsSelected'
@set 'speedTutorialShown', true
GG.showInfoDialog $('#meiosis-speed-slider'),
"Use this to control the speed of meiosis.",
target: "leftMiddle"
tooltip: "rightMiddle"
meiosisTutorialShown: false
meiosisTutorial2Shown: false
showMeiosisTutorial: (parent, callback)->
GG.hideInfoDialogs()
if @get('isFirstMeiosisDescriptionTask') and !@get('meiosisTutorialShown')
@set 'meiosisTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.#{parent}"),
"This is meiosis, the method by which half of a parent's genes are passed to the offspring.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback() if callback?
meiosisGenderTutorialShown: false
showMeiosisGenderTutorial: ->
if @get('isFirstMeiosisGenderControlTask') and !@get('meiosisGenderTutorialShown')
@set 'meiosisGenderTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.father"),
"Hint: When you need to control the sex of the offspring drake, use the father's X and Y chromosomes.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
modal: false
meiosisGameteTutorialShown: false
showMeiosisGameteTutorial: (callback, parent) ->
if @get('isFirstMeiosisDescriptionTask') and !@get 'meiosisGameteTutorialShown'
@set 'meiosisGameteTutorialShown', true
GG.showInfoDialog $("#meiosis-container .meiosis.#{parent}"),
"Meiosis produces four gamete cells. Each gamete has one chromosome from each pair.",
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback()
meiosisFertilizationTutorialShown: false
showMeiosisFertilizationTutorial: (callback) ->
if @get('isFirstMeiosisDescriptionTask') and !@get('meiosisFertilizationTutorialShown')
@set 'meiosisFertilizationTutorialShown', true
GG.showInfoDialog $("#meiosis-container"),
"Fertilization is when a sperm and egg cell fuse. The fertilized cell then divides many times to develop into an individual."
target: "leftMiddle"
tooltip: "rightMiddle"
maxWidth: 280
hideAction: callback
modal: true
else
callback()
finishButtonTutorialShown: false
showFinishButtonTutorial: ->
if @get('isFirstTask') and !@get('finishButtonTutorialShown')
@set 'finishButtonTutorialShown', true
GG.showInfoDialog $("#offspring-buttons .offspring-buttons-use"),
"When you have a %@1 that matches the task, hit Ready to Sell to
end breeding and sell the %@1 to Athena.".fmt(Ember.I18n.t('drake'))
target: "leftMiddle"
tooltip: "rightMiddle"
backcrossButtonTutorialShown: false
showBackcrossButtonTutorial: ->
if @get('isFirstBackcrossTask') and !@get('backcrossButtonTutorialShown')
@set 'backcrossButtonTutorialShown', true
GG.showInfoDialog $("#offspring-buttons .offspring-buttons-save"),
"You can now Backcross using any %@1 you breed. Click this button to
put the current offspring %@1 into a parent pool, then go back and
select it to breed.".fmt(Ember.I18n.t('drake'))
target: "leftMiddle"
tooltip: "rightMiddle"
GG.powerUpController = Ember.Object.create
powerup: {}
unlockPowerup: (powerup) ->
user = GG.userController.get 'user'
return unless user
powerups = user.get 'powerups'
powerups.pushObject(powerup.name) unless powerups.indexOf(powerup.name) != -1
@set 'powerupChanged', @get('powerupChanged') + 1
hasPowerup: (name) ->
user = GG.userController.get 'user'
return user && user.get('powerups').indexOf(name) != -1
powerupChanged: 0
GG.QTipStyle =
width:
max: 350
padding: '14px',
border:
width: 1
radius: 5
color: '#4e8da6'
name: 'light'
GG.lastShownDialog = null
GG.showInfoDialog = ($elem, text, opts={}) ->
opts.target ?= "leftMiddle"
opts.tooltip ?= "rightMiddle"
opts.maxWidth ?= 350
opts.modal ?= false
opts.modalFade ?= false
opts.buttonText ?= 'OK'
style = Ember.copy GG.QTipStyle, true
style.tip = opts.tooltip
if opts.hideTip
style.tip = false
if opts.hideButton
opts.buttonText = false
style.width =
max: opts.maxWidth
config =
content:
title:
text: '',
button: opts.buttonText
text: text
position:
corner:
target: opts.target
tooltip: opts.tooltip
show:
ready: true
solo: true
when: false
hide: false
style: style
if opts.hideAction?
config.api =
onHide: opts.hideAction
if opts.modal
backdrop = if opts.modalFade then "#modal-backdrop-fade" else "#modal-backdrop-clear"
config.api ?= {}
config.api.beforeShow = ->
$(backdrop).fadeIn(@options.show.effect.length)
config.api.beforeHide = ->
$(backdrop).fadeOut(@options.show.effect.length)
GG.lastShownDialog = $elem
$elem.qtip config
$elem.bind 'hide', ->
$(this).qtip('hide')
GG.showChainedInfoDialog = ($elem, textArr, opts={}) ->
opts.finalCallback = opts.hideAction unless opts.finalCallback?
text = textArr[0]
textArr = textArr.splice(1)
if textArr.length
opts.hideAction = ->
GG.showChainedInfoDialog $elem, textArr, opts
GG.showInfoDialog $elem, text, opts
else
opts.hideAction = opts.finalCallback
GG.showInfoDialog $elem, text, opts
GG.showModalDialog = (text, hideAction) ->
body = $('body')
GG.lastShownDialog = body
body.qtip
content:
title:
text: '',
button: 'OK'
text: text
position:
target: $(document.body)
corner: 'center'
show:
ready: true
solo: true
when: false
hide: false
style: GG.QTipStyle
api:
onHide: hideAction
beforeShow: ->
$('#modal-backdrop-fade').fadeIn(@options.show.effect.length)
beforeHide: ->
$('#modal-backdrop-fade').fadeOut(@options.show.effect.length)
GG.hideInfoDialogs = ->
$('.qtip').qtip('hide')
GG.reputationController = Ember.Object.create
swapChangedEarned: false
showTotal: true
reset: (->
@set('bestTaskReputation', Number.NEGATIVE_INFINITY)
@set('bestTaskReputationReasons', {})
@resetCurrent()
)
resetCurrent: ->
@set('currentTaskReputation', 0)
@set('currentTaskReputationReasons', {})
bestTaskReputationBinding: 'GG.tasksController.currentTask.reputationEarned'
bestTaskReputationReasons: {}
bestTaskReputationDisplay: (->
best = @get('bestTaskReputation')
if best < 0 then 0 else best
).property('bestTaskReputation')
currentTaskReputation: 0
currentTaskReputationReasons: {}
addReputation: (rep, reason)->
reasons = @get 'currentTaskReputationReasons'
current_rep = @get 'currentTaskReputation'
reasons[reason] ||= 0
reasons[reason] += rep
current_rep += rep
@set('currentTaskReputationReasons', reasons)
@set('currentTaskReputation', current_rep)
subtractReputation: (rep, reason)->
@addReputation(-rep, reason)
# ensure "current" rep for task is valid
finalizeReputationForTaskRun: ->
current = @get 'currentTaskReputation'
@set 'currentTaskReputation', Math.max current, 0
# the task is complete
finalizeReputation: ->
best = @get 'bestTaskReputation'
if GG.baselineController.get 'isBaseline'
# calculate "reputation" based on breeds used
current = GG.tasksController.get 'baselineTaskReputation'
else
current = @get 'currentTaskReputation'
current = 0 if current == null
evt = if @get('swapChangedEarned') then GG.Events.REPUTATION_CHANGED else GG.Events.REPUTATION_EARNED
GG.logController.logEvent evt, {amount: current}
if best == null || current > best
Ember.run =>
@set('bestTaskReputation', current)
@set('bestTaskReputationReasons', @get('currentTaskReputationReasons'))
best = 0 if best == Number.NEGATIVE_INFINITY
GG.userController.addReputation(current - best)
return current
_repFor: (evt)->
reasons = @get('currentTaskReputationReasons')
reasons[evt] || 0
currentTaskBinding: 'GG.tasksController.currentTask'
reputationForTask: (->
@get 'currentTask.reputation'
).property('currentTask')
breedsLeftBinding: 'GG.cyclesController.cycles'
hasObstacleCourseBinding: 'GG.obstacleCourseController.hasObstacleCourse'
animatedReputation: 0
currentTaskReputationAssumingCompletion: (->
current = @get('currentTaskReputation')
current += @get('reputationForTask')
if @get('hasObstacleCourse')
current += (@get('breedsLeft') * GG.actionCostsController.getCost('cycleRemainingBonus'))
#current -= @_repFor GG.Events.INCOMPLETE_COURSE
#current -= @_repFor GG.Events.COMPLETED_TASK
if current < 0 then 0 else current
).property('currentTaskReputation','reputationForTask','breedsLeft','hasObstacleCourse')
animateOnReputationChange: (->
changeAnimatedReputation = =>
animated = @get('animatedReputation')
current = @get('currentTaskReputationAssumingCompletion')
if ((animated + 15) < current) or ((animated - 15) > current)
@set('animatedReputation', current) # jump ahead
$("#task-reputation-available").removeClass("drop").removeClass("gain")
return
else if animated < current
@set('animatedReputation', animated+1)
$("#task-reputation-available").addClass("gain")
else if animated > current
@set('animatedReputation', animated-1)
$("#task-reputation-available").addClass("drop")
if @get('animatedReputation') != @get('currentTaskReputationAssumingCompletion')
setTimeout(changeAnimatedReputation, 150)
else
$("#task-reputation-available").removeClass("drop").removeClass("gain")
changeAnimatedReputation()
).observes('currentTaskReputationAssumingCompletion')
extraBreedsRep: (->
@_repFor GG.Events.BRED_WITH_EXTRA_CYCLE
).property('currentTaskReputation')
meiosisControlRep: (->
enables = @_repFor GG.Events.ENABLED_MEIOSIS_CONTROL
chromos = @_repFor GG.Events.CHOSE_CHROMOSOME
crosses = @_repFor GG.Events.MADE_CROSSOVER
enables + chromos + crosses
).property('currentTaskReputation')
alleleRevealRep: (->
@_repFor GG.Events.REVEALED_ALLELE
).property('currentTaskReputation')
GG.groupsController = Ember.Object.create
groups: Ember.ArrayProxy.create
content: Ember.A([
GG.GroupMember.create(),
GG.GroupMember.create()
])
error: false
verifyContent: ->
groups = @get('groups')
found = groups.find (user)->
user.get('invalidName') or user.get('invalidSchoolID')
if found or groups.get('length') < 1
@set('error', true)
return
@set('error', false)
removeUser: (user)->
console.log("remove user called: ", user)
groups = @get('groups')
groups.removeObject(user)
console.log("remove user ended")
addUser: ->
console.log("add user called")
groups = @get('groups')
groups.pushObject(GG.GroupMember.create())
console.log("add user ended")
GG.optionsController = Ember.Object.create
projectedDisplay: false
GG.manualEventController = Ember.Object.create
password: ""
task: null
drakeAlleles: ""
drakeSexes: [ "Female", "Male" ]
drakeSex: null
breedsRemaining: 0
time: 120
reputation: ""
cancel: ->
GG.statemanager.send 'closeAdminPanel'
submit: ->
session = GG.logController.get 'session'
GG.logController.set 'session', "MANUAL-SUBMISSION"
task = @get 'task'
alleles = @get("drakeAlleles") || "MANUAL-SUBMISSION"
sex = if @get("drakeSex") is "Female" then 1 else 0
breedCounter = @get('breedsRemaining')
time = 1000 * @get 'time'
reputation = @get 'reputation'
GG.logController.logEvent GG.Events.COMPLETED_TASK,
name: task.name
breedCounter: breedCounter
elapsedTimeMs: time
reputationEarned: reputation
GG.logController.logEvent GG.Events.SUBMITTED_OFFSPRING,
alleles: alleles
sex: @get "drakeSex"
success: true # must be always true for flash app
GG.logController.set 'session', session
GG.statemanager.send 'closeAdminPanel'
GG.leaderboardController = Ember.ArrayController.create
content : []
fbClassRef: null
fbClassCreator: (->
classWord = GG.userController.get 'classWord'
learnerId = GG.userController.get 'learnerId'
userName = GG.userController.get 'user.codeNameWithLearnerId'
if (not (classWord? and learnerId? and userName?)) or ~userName.indexOf("null")
@set 'fbClassRef', null
return
GG.logController.logEvent "Trying to connect to FireBase"
fbRef = new Firebase 'https://genigames-leaderboard.firebaseio.com/'
# find existing class ref, or create one with some initial data
fbRef.child(classWord).once 'value', (snapshot) =>
reputation = GG.userController.get 'user.reputation'
if (snapshot.val() == null)
# create class ref, add add self and score (FB needs some non-null data)
userCreationObj = {}
userCreationObj[userName] = reputation
fbRef.child(classWord).set userCreationObj, (error) =>
if error
GG.logController.logEvent "Error creating FireBase child node #{classWord}"
console.log "Error creating FB child node #{classWord}"
else
GG.logController.logEvent "Created FireBase child node #{classWord}"
@set 'fbClassRef', fbRef.child(classWord)
else
GG.logController.logEvent "Using FireBase child node #{classWord}"
fbRef.child(classWord).child(userName).setWithPriority(reputation, -reputation)
@set 'fbClassRef', fbRef.child(classWord)
).observes('GG.userController.classWord', 'GG.userController.learnerId', 'GG.userController.user.codeNameWithLearnerId')
fbClassObserver: (->
changedCallback = (scoreSnapshot, prevScoreName) =>
name = scoreSnapshot.name()
score = scoreSnapshot.val()
entry = @find (e) -> e.get("name") is name
if entry?
entry.set 'score', score
@removeObject entry
else
entry = GG.LeaderboardEntry.create
name: PI:NAME:<NAME>END_PI
score: score
if not prevScoreName?
@insertAt 0, entry
else
entries = @get 'content'
for e, i in entries
if e.get('name') is prevScoreName
@insertAt i+1, entry
fbClassRef = @get 'fbClassRef'
if not fbClassRef? then return
fbClassRef.on 'child_added', changedCallback
fbClassRef.on 'child_changed', changedCallback
).observes('fbClassRef')
updateReputation: (->
classRef = @get('fbClassRef')
return unless classRef?
userName = GG.userController.get 'user.codeNameWithLearnerId'
return unless (userName? && !~userName.indexOf("null"))
reputation = GG.userController.get 'user.reputation'
reputation += GG.townsController.get 'unlockedTownsCost'
# set with priority: -rep to order with highest scores at top
classRef.child(userName).setWithPriority(reputation, -reputation)
).observes('GG.userController.user.reputation')
GG.valueCounterController = Ember.Object.create
valueBinding: 'GG.tasksController.currentTask.reputation'
updateCounter: (->
value = @get 'value'
return if value < 0
if (value >= 100)
hundreds = Math.floor(value / 100) % 10
$('.value-counter .hundreds').show().animate({backgroundPosition: @getPosition(hundreds)}, 200)
else
$('.value-counter .hundreds').hide()
if (value >= 10)
tens = Math.floor(value / 10) % 10
$('.value-counter .tens').show().animate({backgroundPosition: @getPosition(tens)}, 200)
else
$('.value-counter .tens').hide()
ones = value % 10
$('.value-counter .ones').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('value')
getPosition: (num) ->
pos = num * 18
"(0px -" + pos + "px)"
GG.costCounterController = Ember.Object.create
value: (->
GG.reputationController.get('currentTaskReputation') * -1
).property('GG.reputationController.currentTaskReputation')
updateCounter: (->
value = @get 'value'
return if value < 0
if (value >= 100)
hundreds = Math.floor(value / 100) % 10
$('.cost-counter .hundreds').show().animate({backgroundPosition: @getPosition(hundreds)}, 200)
else
$('.cost-counter .hundreds').hide()
if (value >= 10)
tens = Math.floor(value / 10) % 10
$('.cost-counter .tens').show().animate({backgroundPosition: @getPosition(tens)}, 200)
else
$('.cost-counter .tens').hide()
ones = value % 10
$('.cost-counter .ones').animate({backgroundPosition: @getPosition(ones)}, 200)
).observes('value')
getPosition: (num) ->
pos = num * 18
"(0px -" + pos + "px)"
GG.tooltipController = Ember.Object.create
show: false
|
[
{
"context": "# Copyright Joyent, Inc. and other Node contributors.\n#\n# Permission",
"end": 18,
"score": 0.9992333054542542,
"start": 12,
"tag": "NAME",
"value": "Joyent"
}
] | test/simple/test-child-process-stdio-inherit.coffee | lxe/io.coffee | 0 | # Copyright Joyent, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
grandparent = ->
child = spawn(process.execPath, [
__filename
"parent"
])
child.stderr.pipe process.stderr
output = ""
input = "asdfasdf"
child.stdout.on "data", (chunk) ->
output += chunk
return
child.stdout.setEncoding "utf8"
child.stdin.end input
child.on "close", (code, signal) ->
assert.equal code, 0
assert.equal signal, null
# cat on windows adds a \r\n at the end.
assert.equal output.trim(), input.trim()
return
return
parent = ->
# should not immediately exit.
child = common.spawnCat(stdio: "inherit")
return
common = require("../common")
assert = require("assert")
spawn = require("child_process").spawn
if process.argv[2] is "parent"
parent()
else
grandparent()
| 107146 | # Copyright <NAME>, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
grandparent = ->
child = spawn(process.execPath, [
__filename
"parent"
])
child.stderr.pipe process.stderr
output = ""
input = "asdfasdf"
child.stdout.on "data", (chunk) ->
output += chunk
return
child.stdout.setEncoding "utf8"
child.stdin.end input
child.on "close", (code, signal) ->
assert.equal code, 0
assert.equal signal, null
# cat on windows adds a \r\n at the end.
assert.equal output.trim(), input.trim()
return
return
parent = ->
# should not immediately exit.
child = common.spawnCat(stdio: "inherit")
return
common = require("../common")
assert = require("assert")
spawn = require("child_process").spawn
if process.argv[2] is "parent"
parent()
else
grandparent()
| true | # Copyright PI:NAME:<NAME>END_PI, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
grandparent = ->
child = spawn(process.execPath, [
__filename
"parent"
])
child.stderr.pipe process.stderr
output = ""
input = "asdfasdf"
child.stdout.on "data", (chunk) ->
output += chunk
return
child.stdout.setEncoding "utf8"
child.stdin.end input
child.on "close", (code, signal) ->
assert.equal code, 0
assert.equal signal, null
# cat on windows adds a \r\n at the end.
assert.equal output.trim(), input.trim()
return
return
parent = ->
# should not immediately exit.
child = common.spawnCat(stdio: "inherit")
return
common = require("../common")
assert = require("assert")
spawn = require("child_process").spawn
if process.argv[2] is "parent"
parent()
else
grandparent()
|
[
{
"context": "plit ',')\n continue\n\n if key in ['uniqueID', 'MD5']\n # MD5 filter will use strings ",
"end": 751,
"score": 0.864483118057251,
"start": 743,
"tag": "KEY",
"value": "uniqueID"
},
{
"context": " continue\n\n if key in ['uniqueID',... | src/Filtering/Filter.coffee | ihavenoface/4chan-x | 4 | Filter =
filters: {}
init: ->
return if !Conf['Filter']
for key of Config.filter
@filters[key] = []
for filter in Conf[key].split '\n'
continue if filter[0] is '#'
unless regexp = filter.match /\/(.+)\/(\w*)/
continue
# Don't mix up filter flags with the regular expression.
filter = filter.replace regexp[0], ''
# Do not add this filter to the list if it's not a global one
# and it's not specifically applicable to the current board.
# Defaults to global.
boards = filter.match(/boards:([^;]+)/)?[1].toLowerCase() or 'global'
if boards isnt 'global' and not (g.BOARD.ID in boards.split ',')
continue
if key in ['uniqueID', 'MD5']
# MD5 filter will use strings instead of regular expressions.
regexp = regexp[1]
else
try
# Please, don't write silly regular expressions.
regexp = RegExp regexp[1], regexp[2]
catch err
# I warned you, bro.
new Notice 'warning', err.message, 60
continue
# Filter OPs along with their threads, replies only, or both.
# Defaults to both.
op = filter.match(/[^t]op:(yes|no|only)/)?[1] or 'yes'
# Overrule the `Show Stubs` setting.
# Defaults to stub showing.
stub = switch filter.match(/stub:(yes|no)/)?[1]
when 'yes'
true
when 'no'
false
else
Conf['Stubs']
# Highlight the post, or hide it.
# If not specified, the highlight class will be filter-highlight.
# Defaults to post hiding.
if hl = /highlight/.test filter
hl = filter.match(/highlight:(\w+)/)?[1] or 'filter-highlight'
# Put highlighted OP's thread on top of the board page or not.
# Defaults to on top.
top = filter.match(/top:(yes|no)/)?[1] or 'yes'
top = top is 'yes' # Turn it into a boolean
@filters[key].push {
hide: !hl
op: op
stub: stub
class: hl
top: top
match: regexp
test: if typeof regexp is 'string'
Filter.stringTest # MD5 checking
else
Filter.regexpTest
}
# Only execute filter types that contain valid filters.
unless @filters[key].length
delete @filters[key]
return unless Object.keys(@filters).length
Post.callbacks.push
name: 'Filter'
cb: @node
node: ->
return if @isClone
for key of Filter.filters
value = Filter[key] @
# Continue if there's nothing to filter (no tripcode for example).
continue if value is false
for obj in Filter.filters[key]
unless Filter.test obj, value, @isReply
continue
# Hide
if obj.hide
continue unless @isReply or g.VIEW is 'index'
@hide "Hidden by filtering the #{key}: #{obj.match}", obj.stub
return
# Highlight
@highlight "Highlighted by filtering the #{key}: #{obj.match}", obj.class, obj.top
stringTest: (string, value) ->
string is value
regexpTest: (regexp, value) ->
regexp.test value
test: ({test, match, op}, value, isReply) ->
if isReply and op is 'only' or !isReply and op is 'no'
return false
unless test match, value
return false
true
name: (post) ->
if 'name' of post.info
return post.info.name
false
uniqueID: (post) ->
if 'uniqueID' of post.info
return post.info.uniqueID
false
tripcode: (post) ->
if 'tripcode' of post.info
return post.info.tripcode
false
capcode: (post) ->
if 'capcode' of post.info
return post.info.capcode
false
email: (post) ->
if 'email' of post.info
return post.info.email
false
subject: (post) ->
if 'subject' of post.info
return post.info.subject or false
false
comment: (post) ->
if 'comment' of post.info
return post.info.comment
false
flag: (post) ->
if 'flag' of post.info
return post.info.flag
false
filename: (post) ->
if post.file
return post.file.name
false
dimensions: (post) ->
{file} = post
if file and (file.isImage or file.isVideo)
return post.file.dimensions
false
filesize: (post) ->
if post.file
return post.file.size
false
MD5: (post) ->
if post.file
return post.file.MD5
false
menu:
init: ->
return if !Conf['Menu'] or !Conf['Filter']
div = $.el 'div',
textContent: 'Filter'
entry =
el: div
order: 50
open: (post) ->
Filter.menu.post = post
true
subEntries: []
for type in [
['Name', 'name']
['Unique ID', 'uniqueID']
['Tripcode', 'tripcode']
['Capcode', 'capcode']
['E-mail', 'email']
['Subject', 'subject']
['Comment', 'comment']
['Flag', 'flag']
['Filename', 'filename']
['Image dimensions', 'dimensions']
['Filesize', 'filesize']
['Image MD5', 'MD5']
]
# Add a sub entry for each filter type.
entry.subEntries.push Filter.menu.createSubEntry type[0], type[1]
Menu.menu.addEntry entry
createSubEntry: (text, type) ->
el = $.el 'a',
href: 'javascript:;'
textContent: text
el.dataset.type = type
$.on el, 'click', Filter.menu.makeFilter
return {
el: el
open: (post) ->
value = Filter[type] post
value isnt false
}
makeFilter: ->
{type} = @dataset
# Convert value -> regexp, unless type is MD5
value = Filter[type] Filter.menu.post
re = if type in ['uniqueID', 'MD5'] then value else value.replace ///
/
| \\
| \^
| \$
| \n
| \.
| \(
| \)
| \{
| \}
| \[
| \]
| \?
| \*
| \+
| \|
///g, (c) ->
if c is '\n'
'\\n'
else if c is '\\'
'\\\\'
else
"\\#{c}"
re = if type in ['uniqueID', 'MD5']
"/#{re}/;op:yes"
else
"/^#{re}$/;op:yes"
# Add a new line before the regexp unless the text is empty.
$.get type, Conf[type], (item) ->
save = item[type]
save =
if save
"#{save}\n#{re}"
else
re
$.set type, save
# Open the settings and display & focus the relevant filter textarea.
Settings.open 'Filter'
section = $ '.section-container'
select = $ 'select[name=filter]', section
select.value = type
Settings.selectFilter.call select
ta = $ 'textarea', section
tl = ta.textLength
ta.setSelectionRange tl, tl
ta.focus()
| 1525 | Filter =
filters: {}
init: ->
return if !Conf['Filter']
for key of Config.filter
@filters[key] = []
for filter in Conf[key].split '\n'
continue if filter[0] is '#'
unless regexp = filter.match /\/(.+)\/(\w*)/
continue
# Don't mix up filter flags with the regular expression.
filter = filter.replace regexp[0], ''
# Do not add this filter to the list if it's not a global one
# and it's not specifically applicable to the current board.
# Defaults to global.
boards = filter.match(/boards:([^;]+)/)?[1].toLowerCase() or 'global'
if boards isnt 'global' and not (g.BOARD.ID in boards.split ',')
continue
if key in ['<KEY>', '<KEY>']
# MD5 filter will use strings instead of regular expressions.
regexp = regexp[1]
else
try
# Please, don't write silly regular expressions.
regexp = RegExp regexp[1], regexp[2]
catch err
# I warned you, bro.
new Notice 'warning', err.message, 60
continue
# Filter OPs along with their threads, replies only, or both.
# Defaults to both.
op = filter.match(/[^t]op:(yes|no|only)/)?[1] or 'yes'
# Overrule the `Show Stubs` setting.
# Defaults to stub showing.
stub = switch filter.match(/stub:(yes|no)/)?[1]
when 'yes'
true
when 'no'
false
else
Conf['Stubs']
# Highlight the post, or hide it.
# If not specified, the highlight class will be filter-highlight.
# Defaults to post hiding.
if hl = /highlight/.test filter
hl = filter.match(/highlight:(\w+)/)?[1] or 'filter-highlight'
# Put highlighted OP's thread on top of the board page or not.
# Defaults to on top.
top = filter.match(/top:(yes|no)/)?[1] or 'yes'
top = top is 'yes' # Turn it into a boolean
@filters[key].push {
hide: !hl
op: op
stub: stub
class: hl
top: top
match: regexp
test: if typeof regexp is 'string'
Filter.stringTest # MD5 checking
else
Filter.regexpTest
}
# Only execute filter types that contain valid filters.
unless @filters[key].length
delete @filters[key]
return unless Object.keys(@filters).length
Post.callbacks.push
name: 'Filter'
cb: @node
node: ->
return if @isClone
for key of Filter.filters
value = Filter[key] @
# Continue if there's nothing to filter (no tripcode for example).
continue if value is false
for obj in Filter.filters[key]
unless Filter.test obj, value, @isReply
continue
# Hide
if obj.hide
continue unless @isReply or g.VIEW is 'index'
@hide "Hidden by filtering the #{key}: #{obj.match}", obj.stub
return
# Highlight
@highlight "Highlighted by filtering the #{key}: #{obj.match}", obj.class, obj.top
stringTest: (string, value) ->
string is value
regexpTest: (regexp, value) ->
regexp.test value
test: ({test, match, op}, value, isReply) ->
if isReply and op is 'only' or !isReply and op is 'no'
return false
unless test match, value
return false
true
name: (post) ->
if 'name' of post.info
return post.info.name
false
uniqueID: (post) ->
if 'uniqueID' of post.info
return post.info.uniqueID
false
tripcode: (post) ->
if 'tripcode' of post.info
return post.info.tripcode
false
capcode: (post) ->
if 'capcode' of post.info
return post.info.capcode
false
email: (post) ->
if 'email' of post.info
return post.info.email
false
subject: (post) ->
if 'subject' of post.info
return post.info.subject or false
false
comment: (post) ->
if 'comment' of post.info
return post.info.comment
false
flag: (post) ->
if 'flag' of post.info
return post.info.flag
false
filename: (post) ->
if post.file
return post.file.name
false
dimensions: (post) ->
{file} = post
if file and (file.isImage or file.isVideo)
return post.file.dimensions
false
filesize: (post) ->
if post.file
return post.file.size
false
MD5: (post) ->
if post.file
return post.file.MD5
false
menu:
init: ->
return if !Conf['Menu'] or !Conf['Filter']
div = $.el 'div',
textContent: 'Filter'
entry =
el: div
order: 50
open: (post) ->
Filter.menu.post = post
true
subEntries: []
for type in [
['Name', 'name']
['Unique ID', 'uniqueID']
['Tripcode', 'tripcode']
['Capcode', 'capcode']
['E-mail', 'email']
['Subject', 'subject']
['Comment', 'comment']
['Flag', 'flag']
['Filename', 'filename']
['Image dimensions', 'dimensions']
['Filesize', 'filesize']
['Image MD5', 'MD5']
]
# Add a sub entry for each filter type.
entry.subEntries.push Filter.menu.createSubEntry type[0], type[1]
Menu.menu.addEntry entry
createSubEntry: (text, type) ->
el = $.el 'a',
href: 'javascript:;'
textContent: text
el.dataset.type = type
$.on el, 'click', Filter.menu.makeFilter
return {
el: el
open: (post) ->
value = Filter[type] post
value isnt false
}
makeFilter: ->
{type} = @dataset
# Convert value -> regexp, unless type is MD5
value = Filter[type] Filter.menu.post
re = if type in ['uniqueID', 'MD5'] then value else value.replace ///
/
| \\
| \^
| \$
| \n
| \.
| \(
| \)
| \{
| \}
| \[
| \]
| \?
| \*
| \+
| \|
///g, (c) ->
if c is '\n'
'\\n'
else if c is '\\'
'\\\\'
else
"\\#{c}"
re = if type in ['uniqueID', 'MD5']
"/#{re}/;op:yes"
else
"/^#{re}$/;op:yes"
# Add a new line before the regexp unless the text is empty.
$.get type, Conf[type], (item) ->
save = item[type]
save =
if save
"#{save}\n#{re}"
else
re
$.set type, save
# Open the settings and display & focus the relevant filter textarea.
Settings.open 'Filter'
section = $ '.section-container'
select = $ 'select[name=filter]', section
select.value = type
Settings.selectFilter.call select
ta = $ 'textarea', section
tl = ta.textLength
ta.setSelectionRange tl, tl
ta.focus()
| true | Filter =
filters: {}
init: ->
return if !Conf['Filter']
for key of Config.filter
@filters[key] = []
for filter in Conf[key].split '\n'
continue if filter[0] is '#'
unless regexp = filter.match /\/(.+)\/(\w*)/
continue
# Don't mix up filter flags with the regular expression.
filter = filter.replace regexp[0], ''
# Do not add this filter to the list if it's not a global one
# and it's not specifically applicable to the current board.
# Defaults to global.
boards = filter.match(/boards:([^;]+)/)?[1].toLowerCase() or 'global'
if boards isnt 'global' and not (g.BOARD.ID in boards.split ',')
continue
if key in ['PI:KEY:<KEY>END_PI', 'PI:KEY:<KEY>END_PI']
# MD5 filter will use strings instead of regular expressions.
regexp = regexp[1]
else
try
# Please, don't write silly regular expressions.
regexp = RegExp regexp[1], regexp[2]
catch err
# I warned you, bro.
new Notice 'warning', err.message, 60
continue
# Filter OPs along with their threads, replies only, or both.
# Defaults to both.
op = filter.match(/[^t]op:(yes|no|only)/)?[1] or 'yes'
# Overrule the `Show Stubs` setting.
# Defaults to stub showing.
stub = switch filter.match(/stub:(yes|no)/)?[1]
when 'yes'
true
when 'no'
false
else
Conf['Stubs']
# Highlight the post, or hide it.
# If not specified, the highlight class will be filter-highlight.
# Defaults to post hiding.
if hl = /highlight/.test filter
hl = filter.match(/highlight:(\w+)/)?[1] or 'filter-highlight'
# Put highlighted OP's thread on top of the board page or not.
# Defaults to on top.
top = filter.match(/top:(yes|no)/)?[1] or 'yes'
top = top is 'yes' # Turn it into a boolean
@filters[key].push {
hide: !hl
op: op
stub: stub
class: hl
top: top
match: regexp
test: if typeof regexp is 'string'
Filter.stringTest # MD5 checking
else
Filter.regexpTest
}
# Only execute filter types that contain valid filters.
unless @filters[key].length
delete @filters[key]
return unless Object.keys(@filters).length
Post.callbacks.push
name: 'Filter'
cb: @node
node: ->
return if @isClone
for key of Filter.filters
value = Filter[key] @
# Continue if there's nothing to filter (no tripcode for example).
continue if value is false
for obj in Filter.filters[key]
unless Filter.test obj, value, @isReply
continue
# Hide
if obj.hide
continue unless @isReply or g.VIEW is 'index'
@hide "Hidden by filtering the #{key}: #{obj.match}", obj.stub
return
# Highlight
@highlight "Highlighted by filtering the #{key}: #{obj.match}", obj.class, obj.top
stringTest: (string, value) ->
string is value
regexpTest: (regexp, value) ->
regexp.test value
test: ({test, match, op}, value, isReply) ->
if isReply and op is 'only' or !isReply and op is 'no'
return false
unless test match, value
return false
true
name: (post) ->
if 'name' of post.info
return post.info.name
false
uniqueID: (post) ->
if 'uniqueID' of post.info
return post.info.uniqueID
false
tripcode: (post) ->
if 'tripcode' of post.info
return post.info.tripcode
false
capcode: (post) ->
if 'capcode' of post.info
return post.info.capcode
false
email: (post) ->
if 'email' of post.info
return post.info.email
false
subject: (post) ->
if 'subject' of post.info
return post.info.subject or false
false
comment: (post) ->
if 'comment' of post.info
return post.info.comment
false
flag: (post) ->
if 'flag' of post.info
return post.info.flag
false
filename: (post) ->
if post.file
return post.file.name
false
dimensions: (post) ->
{file} = post
if file and (file.isImage or file.isVideo)
return post.file.dimensions
false
filesize: (post) ->
if post.file
return post.file.size
false
MD5: (post) ->
if post.file
return post.file.MD5
false
menu:
init: ->
return if !Conf['Menu'] or !Conf['Filter']
div = $.el 'div',
textContent: 'Filter'
entry =
el: div
order: 50
open: (post) ->
Filter.menu.post = post
true
subEntries: []
for type in [
['Name', 'name']
['Unique ID', 'uniqueID']
['Tripcode', 'tripcode']
['Capcode', 'capcode']
['E-mail', 'email']
['Subject', 'subject']
['Comment', 'comment']
['Flag', 'flag']
['Filename', 'filename']
['Image dimensions', 'dimensions']
['Filesize', 'filesize']
['Image MD5', 'MD5']
]
# Add a sub entry for each filter type.
entry.subEntries.push Filter.menu.createSubEntry type[0], type[1]
Menu.menu.addEntry entry
createSubEntry: (text, type) ->
el = $.el 'a',
href: 'javascript:;'
textContent: text
el.dataset.type = type
$.on el, 'click', Filter.menu.makeFilter
return {
el: el
open: (post) ->
value = Filter[type] post
value isnt false
}
makeFilter: ->
{type} = @dataset
# Convert value -> regexp, unless type is MD5
value = Filter[type] Filter.menu.post
re = if type in ['uniqueID', 'MD5'] then value else value.replace ///
/
| \\
| \^
| \$
| \n
| \.
| \(
| \)
| \{
| \}
| \[
| \]
| \?
| \*
| \+
| \|
///g, (c) ->
if c is '\n'
'\\n'
else if c is '\\'
'\\\\'
else
"\\#{c}"
re = if type in ['uniqueID', 'MD5']
"/#{re}/;op:yes"
else
"/^#{re}$/;op:yes"
# Add a new line before the regexp unless the text is empty.
$.get type, Conf[type], (item) ->
save = item[type]
save =
if save
"#{save}\n#{re}"
else
re
$.set type, save
# Open the settings and display & focus the relevant filter textarea.
Settings.open 'Filter'
section = $ '.section-container'
select = $ 'select[name=filter]', section
select.value = type
Settings.selectFilter.call select
ta = $ 'textarea', section
tl = ta.textLength
ta.setSelectionRange tl, tl
ta.focus()
|
[
{
"context": ".js <%= pkg.version %> - Inline editing toolkit\nby Henri Bergius and contributors. Available under the MIT license",
"end": 107,
"score": 0.9998733401298523,
"start": 94,
"tag": "NAME",
"value": "Henri Bergius"
},
{
"context": " all:\n options:\n urls... | Gruntfile.coffee | uwej711/create | 1 | module.exports = ->
banner = """/* Create.js <%= pkg.version %> - Inline editing toolkit
by Henri Bergius and contributors. Available under the MIT license.
See http://createjs.org for more information
*/"""
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# Install dependencies
bower:
install: {}
# Build setup: concatenate source files
concat:
options:
stripBanners: true
banner: banner
full:
src: [
'src/*.js'
'src/**/*.js'
'locale/*.js'
]
dest: 'dist/create.js'
edit:
src: [
'src/jquery.Midgard.midgardEditable.js'
'src/jquery.Midgard.midgardStorage.js'
'src/collectionWidgets/*.js'
'src/editingWidgets/*.js'
]
dest: 'dist/create-editonly.js'
# JavaScript minification
uglify:
options:
banner: banner
report: 'min'
full:
files:
'dist/create.min.js': ['dist/create.js']
edit:
files:
'dist/create-editonly.min.js': ['dist/create-editonly.js']
# Coding standards verification
jshint:
all: ['src/*.js', 'src/**/*.js', 'locale/*.js']
# Unit tests
qunit:
all: ['test/*.html']
# Cross-browser testing
connect:
server:
options:
base: ''
port: 9999
'saucelabs-qunit':
all:
options:
urls: ['http://127.0.0.1:9999/test/index.html']
browsers: [
browserName: 'chrome'
,
browserName: 'safari'
platform: 'OS X 10.8'
version: '6'
,
browserName: 'opera'
,
browserName: 'internet explorer'
platform: 'WIN8'
version: '10'
]
build: process.env.TRAVIS_JOB_ID
testname: 'Create.js cross-browser tests'
tunnelTimeout: 5
concurrency: 3
detailedError: true
# Dependency installation
@loadNpmTasks 'grunt-bower-task'
# Build dependencies
@loadNpmTasks 'grunt-contrib-concat'
@loadNpmTasks 'grunt-contrib-uglify'
# Testing dependencies
@loadNpmTasks 'grunt-contrib-jshint'
@loadNpmTasks 'grunt-contrib-qunit'
# Cross-browser testing
@loadNpmTasks 'grunt-contrib-connect'
@loadNpmTasks 'grunt-saucelabs'
# Local tasks
@registerTask 'build', ['concat:full', 'uglify:full']
@registerTask 'editonly', ['concat:edit', 'uglify:edit']
@registerTask 'test', ['jshint', 'build', 'qunit']
@registerTask 'crossbrowser', ['test', 'connect', 'saucelabs-qunit']
| 191269 | module.exports = ->
banner = """/* Create.js <%= pkg.version %> - Inline editing toolkit
by <NAME> and contributors. Available under the MIT license.
See http://createjs.org for more information
*/"""
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# Install dependencies
bower:
install: {}
# Build setup: concatenate source files
concat:
options:
stripBanners: true
banner: banner
full:
src: [
'src/*.js'
'src/**/*.js'
'locale/*.js'
]
dest: 'dist/create.js'
edit:
src: [
'src/jquery.Midgard.midgardEditable.js'
'src/jquery.Midgard.midgardStorage.js'
'src/collectionWidgets/*.js'
'src/editingWidgets/*.js'
]
dest: 'dist/create-editonly.js'
# JavaScript minification
uglify:
options:
banner: banner
report: 'min'
full:
files:
'dist/create.min.js': ['dist/create.js']
edit:
files:
'dist/create-editonly.min.js': ['dist/create-editonly.js']
# Coding standards verification
jshint:
all: ['src/*.js', 'src/**/*.js', 'locale/*.js']
# Unit tests
qunit:
all: ['test/*.html']
# Cross-browser testing
connect:
server:
options:
base: ''
port: 9999
'saucelabs-qunit':
all:
options:
urls: ['http://127.0.0.1:9999/test/index.html']
browsers: [
browserName: 'chrome'
,
browserName: 'safari'
platform: 'OS X 10.8'
version: '6'
,
browserName: 'opera'
,
browserName: 'internet explorer'
platform: 'WIN8'
version: '10'
]
build: process.env.TRAVIS_JOB_ID
testname: 'Create.js cross-browser tests'
tunnelTimeout: 5
concurrency: 3
detailedError: true
# Dependency installation
@loadNpmTasks 'grunt-bower-task'
# Build dependencies
@loadNpmTasks 'grunt-contrib-concat'
@loadNpmTasks 'grunt-contrib-uglify'
# Testing dependencies
@loadNpmTasks 'grunt-contrib-jshint'
@loadNpmTasks 'grunt-contrib-qunit'
# Cross-browser testing
@loadNpmTasks 'grunt-contrib-connect'
@loadNpmTasks 'grunt-saucelabs'
# Local tasks
@registerTask 'build', ['concat:full', 'uglify:full']
@registerTask 'editonly', ['concat:edit', 'uglify:edit']
@registerTask 'test', ['jshint', 'build', 'qunit']
@registerTask 'crossbrowser', ['test', 'connect', 'saucelabs-qunit']
| true | module.exports = ->
banner = """/* Create.js <%= pkg.version %> - Inline editing toolkit
by PI:NAME:<NAME>END_PI and contributors. Available under the MIT license.
See http://createjs.org for more information
*/"""
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# Install dependencies
bower:
install: {}
# Build setup: concatenate source files
concat:
options:
stripBanners: true
banner: banner
full:
src: [
'src/*.js'
'src/**/*.js'
'locale/*.js'
]
dest: 'dist/create.js'
edit:
src: [
'src/jquery.Midgard.midgardEditable.js'
'src/jquery.Midgard.midgardStorage.js'
'src/collectionWidgets/*.js'
'src/editingWidgets/*.js'
]
dest: 'dist/create-editonly.js'
# JavaScript minification
uglify:
options:
banner: banner
report: 'min'
full:
files:
'dist/create.min.js': ['dist/create.js']
edit:
files:
'dist/create-editonly.min.js': ['dist/create-editonly.js']
# Coding standards verification
jshint:
all: ['src/*.js', 'src/**/*.js', 'locale/*.js']
# Unit tests
qunit:
all: ['test/*.html']
# Cross-browser testing
connect:
server:
options:
base: ''
port: 9999
'saucelabs-qunit':
all:
options:
urls: ['http://127.0.0.1:9999/test/index.html']
browsers: [
browserName: 'chrome'
,
browserName: 'safari'
platform: 'OS X 10.8'
version: '6'
,
browserName: 'opera'
,
browserName: 'internet explorer'
platform: 'WIN8'
version: '10'
]
build: process.env.TRAVIS_JOB_ID
testname: 'Create.js cross-browser tests'
tunnelTimeout: 5
concurrency: 3
detailedError: true
# Dependency installation
@loadNpmTasks 'grunt-bower-task'
# Build dependencies
@loadNpmTasks 'grunt-contrib-concat'
@loadNpmTasks 'grunt-contrib-uglify'
# Testing dependencies
@loadNpmTasks 'grunt-contrib-jshint'
@loadNpmTasks 'grunt-contrib-qunit'
# Cross-browser testing
@loadNpmTasks 'grunt-contrib-connect'
@loadNpmTasks 'grunt-saucelabs'
# Local tasks
@registerTask 'build', ['concat:full', 'uglify:full']
@registerTask 'editonly', ['concat:edit', 'uglify:edit']
@registerTask 'test', ['jshint', 'build', 'qunit']
@registerTask 'crossbrowser', ['test', 'connect', 'saucelabs-qunit']
|
[
{
"context": "RRule\n\nclass CalendarEvent\n\tconstructor : (@name=\"fu!\", start, end=null, @description=\"\", @uuid=gen_uu",
"end": 230,
"score": 0.5805699229240417,
"start": 228,
"tag": "USERNAME",
"value": "fu"
},
{
"context": "l_user\n\t\t\t\t@opts = {\n\t\t\t\t\t'auth' : {\n\t\... | calendar.coffee | netz39/dobby | 0 | ical = require('ical')
should = require('should')
util = require('util')
moment = require('moment')
moment().format()
gen_uuid = require('node-uuid').v4
RRule = require('rrule').RRule
class CalendarEvent
constructor : (@name="fu!", start, end=null, @description="", @uuid=gen_uuid()) ->
@start = moment(start)
@name.should.be.ok
@start.should.be.a.Date
@end = moment(end) if end?
toString : () ->
str = @start.toLocaleString()
str = str + @end.toLocaleString() if end?
str = str + " : " + @name + "\n"
str = str + @description
addReoccuringEvent = (event, events) ->
dates = []
event.rrule.origOptions.dtstart = event.start
event.rrule = event.rrule.clone()
dates = event.rrule.between(moment().toDate(), moment().add('years', 1).toDate())
util.puts event.rrule.toText()
util.puts event.rrule.toString()
util.puts event.start
util.puts util.inspect(dates)
for i,d of dates
events.push new CalendarEvent(event.summary, d, null, event.description)
events = events.sort (a,b) ->
return a.start.diff(b.start)
fetch_entrys = (ical_url, opts, events, raw, cb) ->
util.puts "fetching entries from #{ical_url}"
ical.fromURL ical_url , opts , (err, data) ->
util.puts "ok" if data?
raw.push util.inspect(data, { depth : 5 })
util.puts err if err?
for key, event of data when event.start? and event.summary?
if event.rrule?
addReoccuringEvent(event, events)
else
events.push(new CalendarEvent(event.summary, event.start, event.end, event.description))
events = events.sort (a,b) ->
return a.start.diff(b.start)
cb(events, data) if cb?
class Calendar
constructor : (@ical_url, @ical_user=null, @ical_password="", @entrys=[], cb) ->
@raw = []
if @ical_url
@opts = {}
if @ical_user
@opts = {
'auth' : {
'user': @ical_user,
'pass': @ical_password,
'sendImmediately': true
}
}
fetch_entrys @ical_url, @opts, @entrys, @raw, (entrys, data) ->
cb() if cb?
sortEntrys : () ->
@entrys = @entrys.sort (a,b) ->
return a.start.diff(b.start)
addEvent : (entry) ->
entry.should.be.ok
@entrys.push(entry)
@sortEntrys()
getNames : () ->
return (entry.name for entry in @entrys)
toString : () ->
return (entry.toString() for entry in @entrys).join("\n\n")
getRange : (start, end) ->
_result = []
for entry in @entrys
if not entry.start?
util.puts entry
if entry.start.isAfter(start) and entry.start.isBefore(end)
_result.push entry
_result = _result.sort (a,b) ->
return a.start.diff(b.start)
return _result
exports.Calendar = Calendar
exports.CalendarEvent = CalendarEvent
| 55071 | ical = require('ical')
should = require('should')
util = require('util')
moment = require('moment')
moment().format()
gen_uuid = require('node-uuid').v4
RRule = require('rrule').RRule
class CalendarEvent
constructor : (@name="fu!", start, end=null, @description="", @uuid=gen_uuid()) ->
@start = moment(start)
@name.should.be.ok
@start.should.be.a.Date
@end = moment(end) if end?
toString : () ->
str = @start.toLocaleString()
str = str + @end.toLocaleString() if end?
str = str + " : " + @name + "\n"
str = str + @description
addReoccuringEvent = (event, events) ->
dates = []
event.rrule.origOptions.dtstart = event.start
event.rrule = event.rrule.clone()
dates = event.rrule.between(moment().toDate(), moment().add('years', 1).toDate())
util.puts event.rrule.toText()
util.puts event.rrule.toString()
util.puts event.start
util.puts util.inspect(dates)
for i,d of dates
events.push new CalendarEvent(event.summary, d, null, event.description)
events = events.sort (a,b) ->
return a.start.diff(b.start)
fetch_entrys = (ical_url, opts, events, raw, cb) ->
util.puts "fetching entries from #{ical_url}"
ical.fromURL ical_url , opts , (err, data) ->
util.puts "ok" if data?
raw.push util.inspect(data, { depth : 5 })
util.puts err if err?
for key, event of data when event.start? and event.summary?
if event.rrule?
addReoccuringEvent(event, events)
else
events.push(new CalendarEvent(event.summary, event.start, event.end, event.description))
events = events.sort (a,b) ->
return a.start.diff(b.start)
cb(events, data) if cb?
class Calendar
constructor : (@ical_url, @ical_user=null, @ical_password="", @entrys=[], cb) ->
@raw = []
if @ical_url
@opts = {}
if @ical_user
@opts = {
'auth' : {
'user': @ical_user,
'pass': <PASSWORD>,
'sendImmediately': true
}
}
fetch_entrys @ical_url, @opts, @entrys, @raw, (entrys, data) ->
cb() if cb?
sortEntrys : () ->
@entrys = @entrys.sort (a,b) ->
return a.start.diff(b.start)
addEvent : (entry) ->
entry.should.be.ok
@entrys.push(entry)
@sortEntrys()
getNames : () ->
return (entry.name for entry in @entrys)
toString : () ->
return (entry.toString() for entry in @entrys).join("\n\n")
getRange : (start, end) ->
_result = []
for entry in @entrys
if not entry.start?
util.puts entry
if entry.start.isAfter(start) and entry.start.isBefore(end)
_result.push entry
_result = _result.sort (a,b) ->
return a.start.diff(b.start)
return _result
exports.Calendar = Calendar
exports.CalendarEvent = CalendarEvent
| true | ical = require('ical')
should = require('should')
util = require('util')
moment = require('moment')
moment().format()
gen_uuid = require('node-uuid').v4
RRule = require('rrule').RRule
class CalendarEvent
constructor : (@name="fu!", start, end=null, @description="", @uuid=gen_uuid()) ->
@start = moment(start)
@name.should.be.ok
@start.should.be.a.Date
@end = moment(end) if end?
toString : () ->
str = @start.toLocaleString()
str = str + @end.toLocaleString() if end?
str = str + " : " + @name + "\n"
str = str + @description
addReoccuringEvent = (event, events) ->
dates = []
event.rrule.origOptions.dtstart = event.start
event.rrule = event.rrule.clone()
dates = event.rrule.between(moment().toDate(), moment().add('years', 1).toDate())
util.puts event.rrule.toText()
util.puts event.rrule.toString()
util.puts event.start
util.puts util.inspect(dates)
for i,d of dates
events.push new CalendarEvent(event.summary, d, null, event.description)
events = events.sort (a,b) ->
return a.start.diff(b.start)
fetch_entrys = (ical_url, opts, events, raw, cb) ->
util.puts "fetching entries from #{ical_url}"
ical.fromURL ical_url , opts , (err, data) ->
util.puts "ok" if data?
raw.push util.inspect(data, { depth : 5 })
util.puts err if err?
for key, event of data when event.start? and event.summary?
if event.rrule?
addReoccuringEvent(event, events)
else
events.push(new CalendarEvent(event.summary, event.start, event.end, event.description))
events = events.sort (a,b) ->
return a.start.diff(b.start)
cb(events, data) if cb?
class Calendar
constructor : (@ical_url, @ical_user=null, @ical_password="", @entrys=[], cb) ->
@raw = []
if @ical_url
@opts = {}
if @ical_user
@opts = {
'auth' : {
'user': @ical_user,
'pass': PI:PASSWORD:<PASSWORD>END_PI,
'sendImmediately': true
}
}
fetch_entrys @ical_url, @opts, @entrys, @raw, (entrys, data) ->
cb() if cb?
sortEntrys : () ->
@entrys = @entrys.sort (a,b) ->
return a.start.diff(b.start)
addEvent : (entry) ->
entry.should.be.ok
@entrys.push(entry)
@sortEntrys()
getNames : () ->
return (entry.name for entry in @entrys)
toString : () ->
return (entry.toString() for entry in @entrys).join("\n\n")
getRange : (start, end) ->
_result = []
for entry in @entrys
if not entry.start?
util.puts entry
if entry.start.isAfter(start) and entry.start.isBefore(end)
_result.push entry
_result = _result.sort (a,b) ->
return a.start.diff(b.start)
return _result
exports.Calendar = Calendar
exports.CalendarEvent = CalendarEvent
|
[
{
"context": "ation\n headers:\n \"X-CSRF-Token\": \"abc\"\n \"X-Auth-Token\": -> @get(\"authToken\")\n ",
"end": 388,
"score": 0.7616326808929443,
"start": 385,
"tag": "KEY",
"value": "abc"
},
{
"context": "uthToken\")\n app = new Application(authToken:... | spec/application_spec/ajax_spec.coffee | mateusmaso/hipbone | 0 | module.exports = ->
describe "ajax", ->
it "should prepend host url", ->
class Application extends Hipbone.Application
host: "/api/v1"
app = new Application
chai.expect(app.ajaxUrl("/ping")).to.be.equal("/api/v1/ping")
it "should add http headers", ->
class Application extends Hipbone.Application
headers:
"X-CSRF-Token": "abc"
"X-Auth-Token": -> @get("authToken")
app = new Application(authToken: 123)
chai.expect(app.ajaxHeaders()).to.be.deep.equal("X-Auth-Token": 123, "X-CSRF-Token": "abc")
| 100253 | module.exports = ->
describe "ajax", ->
it "should prepend host url", ->
class Application extends Hipbone.Application
host: "/api/v1"
app = new Application
chai.expect(app.ajaxUrl("/ping")).to.be.equal("/api/v1/ping")
it "should add http headers", ->
class Application extends Hipbone.Application
headers:
"X-CSRF-Token": "<KEY>"
"X-Auth-Token": -> @get("authToken")
app = new Application(authToken: <PASSWORD>)
chai.expect(app.ajaxHeaders()).to.be.deep.equal("X-Auth-Token": 123, "X-CSRF-Token": "abc")
| true | module.exports = ->
describe "ajax", ->
it "should prepend host url", ->
class Application extends Hipbone.Application
host: "/api/v1"
app = new Application
chai.expect(app.ajaxUrl("/ping")).to.be.equal("/api/v1/ping")
it "should add http headers", ->
class Application extends Hipbone.Application
headers:
"X-CSRF-Token": "PI:KEY:<KEY>END_PI"
"X-Auth-Token": -> @get("authToken")
app = new Application(authToken: PI:PASSWORD:<PASSWORD>END_PI)
chai.expect(app.ajaxHeaders()).to.be.deep.equal("X-Auth-Token": 123, "X-CSRF-Token": "abc")
|
[
{
"context": "# Copyright Joyent, Inc. and other Node contributors.\n#\n# Permission",
"end": 18,
"score": 0.9994714856147766,
"start": 12,
"tag": "NAME",
"value": "Joyent"
}
] | test/simple/test-child-process-exec-cwd.coffee | lxe/io.coffee | 0 | # Copyright Joyent, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
require "../common"
assert = require("assert")
exec = require("child_process").exec
success_count = 0
error_count = 0
pwdcommand = undefined
dir = undefined
if process.platform is "win32"
pwdcommand = "echo %cd%"
dir = "c:\\windows"
else
pwdcommand = "pwd"
dir = "/dev"
child = exec(pwdcommand,
cwd: dir
, (err, stdout, stderr) ->
if err
error_count++
console.log "error!: " + err.code
console.log "stdout: " + JSON.stringify(stdout)
console.log "stderr: " + JSON.stringify(stderr)
assert.equal false, err.killed
else
success_count++
console.log stdout
assert.ok stdout.indexOf(dir) is 0
return
)
process.on "exit", ->
assert.equal 1, success_count
assert.equal 0, error_count
return
| 71395 | # Copyright <NAME>, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
require "../common"
assert = require("assert")
exec = require("child_process").exec
success_count = 0
error_count = 0
pwdcommand = undefined
dir = undefined
if process.platform is "win32"
pwdcommand = "echo %cd%"
dir = "c:\\windows"
else
pwdcommand = "pwd"
dir = "/dev"
child = exec(pwdcommand,
cwd: dir
, (err, stdout, stderr) ->
if err
error_count++
console.log "error!: " + err.code
console.log "stdout: " + JSON.stringify(stdout)
console.log "stderr: " + JSON.stringify(stderr)
assert.equal false, err.killed
else
success_count++
console.log stdout
assert.ok stdout.indexOf(dir) is 0
return
)
process.on "exit", ->
assert.equal 1, success_count
assert.equal 0, error_count
return
| true | # Copyright PI:NAME:<NAME>END_PI, Inc. and other Node contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
require "../common"
assert = require("assert")
exec = require("child_process").exec
success_count = 0
error_count = 0
pwdcommand = undefined
dir = undefined
if process.platform is "win32"
pwdcommand = "echo %cd%"
dir = "c:\\windows"
else
pwdcommand = "pwd"
dir = "/dev"
child = exec(pwdcommand,
cwd: dir
, (err, stdout, stderr) ->
if err
error_count++
console.log "error!: " + err.code
console.log "stdout: " + JSON.stringify(stdout)
console.log "stderr: " + JSON.stringify(stderr)
assert.equal false, err.killed
else
success_count++
console.log stdout
assert.ok stdout.indexOf(dir) is 0
return
)
process.on "exit", ->
assert.equal 1, success_count
assert.equal 0, error_count
return
|
[
{
"context": "/a> & <a href='https://web.library.yale.edu/arts'>Robert B. Haas Family Arts Library</a>\n </div>\n ",
"end": 698,
"score": 0.9992537498474121,
"start": 684,
"tag": "NAME",
"value": "Robert B. Haas"
}
] | app/assets/javascripts/partials/yale-footer.cjsx | jakekara/ensemble-at-yale | 5 | React = require 'react'
Footer = React.createClass
displayName: 'Footer'
render: ->
<div>
{ if @props.display == 1
<div className='footer-container'>
<div className='footer-content'>
<div className='footer-left'>
<a href='http://web.library.yale.edu/'>
<img src={'/assets/dh-wordmark-white.png'} />
</a>
</div>
<div className='footer-right-container'>
<div className='footer-right'>
A collaboration of the <a href='http://dhlab.yale.edu'>Yale Digital Humanities Laboratory</a> & <a href='https://web.library.yale.edu/arts'>Robert B. Haas Family Arts Library</a>
</div>
</div>
</div>
</div>
else
<div />
}
</div>
module.exports = Footer | 106989 | React = require 'react'
Footer = React.createClass
displayName: 'Footer'
render: ->
<div>
{ if @props.display == 1
<div className='footer-container'>
<div className='footer-content'>
<div className='footer-left'>
<a href='http://web.library.yale.edu/'>
<img src={'/assets/dh-wordmark-white.png'} />
</a>
</div>
<div className='footer-right-container'>
<div className='footer-right'>
A collaboration of the <a href='http://dhlab.yale.edu'>Yale Digital Humanities Laboratory</a> & <a href='https://web.library.yale.edu/arts'><NAME> Family Arts Library</a>
</div>
</div>
</div>
</div>
else
<div />
}
</div>
module.exports = Footer | true | React = require 'react'
Footer = React.createClass
displayName: 'Footer'
render: ->
<div>
{ if @props.display == 1
<div className='footer-container'>
<div className='footer-content'>
<div className='footer-left'>
<a href='http://web.library.yale.edu/'>
<img src={'/assets/dh-wordmark-white.png'} />
</a>
</div>
<div className='footer-right-container'>
<div className='footer-right'>
A collaboration of the <a href='http://dhlab.yale.edu'>Yale Digital Humanities Laboratory</a> & <a href='https://web.library.yale.edu/arts'>PI:NAME:<NAME>END_PI Family Arts Library</a>
</div>
</div>
</div>
</div>
else
<div />
}
</div>
module.exports = Footer |
[
{
"context": "nd retrieves profiles', (done) ->\n password = \"test_password123\"\n profile = \"test_secure_store_profile1\"\n p",
"end": 251,
"score": 0.9994009137153625,
"start": 235,
"tag": "PASSWORD",
"value": "test_password123"
},
{
"context": "th incorrect password', (... | test/secure_store/secure_store.test.coffee | obi1kenobi/jester | 2 | expect = require('chai').expect
secureStore = require('../../src/js/lib/secure_store')
describe 'Secure store', () ->
beforeEach () ->
localStorage.clear()
it 'stores and retrieves profiles', (done) ->
password = "test_password123"
profile = "test_secure_store_profile1"
publicData =
a: 123
b: "456"
secretData =
xyz: "abc"
t: 0
expect(secureStore.getProfileNames()).to.eql([])
secureStore.setProfile profile, password, publicData, secretData, (err, res) ->
expect(err).to.not.exist
expect(secureStore.getPublic(profile)).to.eql(publicData)
secureStore.getSecret profile, password, (err, res) ->
expect(err).to.not.exist
expect(res).to.eql(secretData)
done()
it 'refuses to decrypt profiles with incorrect password', (done) ->
password = "test_password123"
profile = "test_secure_store_profile2"
publicData =
a: 123
b: "456"
secretData =
xyz: "abc"
t: 0
secureStore.setProfile profile, password, publicData, secretData, (err, res) ->
expect(err).to.not.exist
secureStore.getSecret profile, password + "456", (err, res) ->
expect(err).to.exist
expect(res).to.not.exist
done()
it 'stores and retrieves config', (done) ->
password = "test_password123"
config =
abc: 12
de: "1234"
expect(secureStore.configExists()).to.eql(false)
secureStore.setConfig password, config, (err) ->
expect(err).to.not.exist
expect(secureStore.configExists()).to.eql(true)
secureStore.getConfig password, (err, res) ->
expect(err).to.not.exist
expect(res).to.eql(config)
done()
it 'refuses to decrypt config with incorrect password', (done) ->
password = "test_password123"
config =
ab: 123
def: "124"
secureStore.setConfig password, config, (err) ->
expect(err).to.not.exist
secureStore.getConfig password + "1", (err, res) ->
expect(err).to.exist
expect(res).to.not.exist
done()
| 7734 | expect = require('chai').expect
secureStore = require('../../src/js/lib/secure_store')
describe 'Secure store', () ->
beforeEach () ->
localStorage.clear()
it 'stores and retrieves profiles', (done) ->
password = "<PASSWORD>"
profile = "test_secure_store_profile1"
publicData =
a: 123
b: "456"
secretData =
xyz: "abc"
t: 0
expect(secureStore.getProfileNames()).to.eql([])
secureStore.setProfile profile, password, publicData, secretData, (err, res) ->
expect(err).to.not.exist
expect(secureStore.getPublic(profile)).to.eql(publicData)
secureStore.getSecret profile, password, (err, res) ->
expect(err).to.not.exist
expect(res).to.eql(secretData)
done()
it 'refuses to decrypt profiles with incorrect password', (done) ->
password = "<PASSWORD>"
profile = "test_secure_store_profile2"
publicData =
a: 123
b: "456"
secretData =
xyz: "abc"
t: 0
secureStore.setProfile profile, password, publicData, secretData, (err, res) ->
expect(err).to.not.exist
secureStore.getSecret profile, password + "<PASSWORD>", (err, res) ->
expect(err).to.exist
expect(res).to.not.exist
done()
it 'stores and retrieves config', (done) ->
password = "<PASSWORD>"
config =
abc: 12
de: "1234"
expect(secureStore.configExists()).to.eql(false)
secureStore.setConfig password, config, (err) ->
expect(err).to.not.exist
expect(secureStore.configExists()).to.eql(true)
secureStore.getConfig password, (err, res) ->
expect(err).to.not.exist
expect(res).to.eql(config)
done()
it 'refuses to decrypt config with incorrect password', (done) ->
password = "<PASSWORD>"
config =
ab: 123
def: "124"
secureStore.setConfig password, config, (err) ->
expect(err).to.not.exist
secureStore.getConfig password + "1", (err, res) ->
expect(err).to.exist
expect(res).to.not.exist
done()
| true | expect = require('chai').expect
secureStore = require('../../src/js/lib/secure_store')
describe 'Secure store', () ->
beforeEach () ->
localStorage.clear()
it 'stores and retrieves profiles', (done) ->
password = "PI:PASSWORD:<PASSWORD>END_PI"
profile = "test_secure_store_profile1"
publicData =
a: 123
b: "456"
secretData =
xyz: "abc"
t: 0
expect(secureStore.getProfileNames()).to.eql([])
secureStore.setProfile profile, password, publicData, secretData, (err, res) ->
expect(err).to.not.exist
expect(secureStore.getPublic(profile)).to.eql(publicData)
secureStore.getSecret profile, password, (err, res) ->
expect(err).to.not.exist
expect(res).to.eql(secretData)
done()
it 'refuses to decrypt profiles with incorrect password', (done) ->
password = "PI:PASSWORD:<PASSWORD>END_PI"
profile = "test_secure_store_profile2"
publicData =
a: 123
b: "456"
secretData =
xyz: "abc"
t: 0
secureStore.setProfile profile, password, publicData, secretData, (err, res) ->
expect(err).to.not.exist
secureStore.getSecret profile, password + "PI:PASSWORD:<PASSWORD>END_PI", (err, res) ->
expect(err).to.exist
expect(res).to.not.exist
done()
it 'stores and retrieves config', (done) ->
password = "PI:PASSWORD:<PASSWORD>END_PI"
config =
abc: 12
de: "1234"
expect(secureStore.configExists()).to.eql(false)
secureStore.setConfig password, config, (err) ->
expect(err).to.not.exist
expect(secureStore.configExists()).to.eql(true)
secureStore.getConfig password, (err, res) ->
expect(err).to.not.exist
expect(res).to.eql(config)
done()
it 'refuses to decrypt config with incorrect password', (done) ->
password = "PI:PASSWORD:<PASSWORD>END_PI"
config =
ab: 123
def: "124"
secureStore.setConfig password, config, (err) ->
expect(err).to.not.exist
secureStore.getConfig password + "1", (err, res) ->
expect(err).to.exist
expect(res).to.not.exist
done()
|
[
{
"context": "a view off a given set of data.\n#\n# Note: Based on John Resig's microtemplating function(s).\n#\nclass Wraith.Tem",
"end": 212,
"score": 0.9910979270935059,
"start": 202,
"tag": "NAME",
"value": "John Resig"
},
{
"context": " JavaScript templating a-la **ERB**, pilfer... | src/template.coffee | ShaunSpringer/Wraith | 2 | #
# The Wraith Template object is responsible for storing a template string,
# generating a template function and interpolating the data to generate
# a view off a given set of data.
#
# Note: Based on John Resig's microtemplating function(s).
#
class Wraith.Template
#
# Borrowed from Underscores templates
#
# @param [String] string The string to escape
#
@escapeRegExp: (string) -> string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1')
#
# A set of template settings used by {Wraith.Template}
#
@settings:
start: '{{'
end: '}}'
interpolate: /{{(.+?)}}/g
checked: /data-checked=[\'\"](.+?)[\'\"]/gi
classes: /data-class=[\'\"](.+?)[\'\"]/gi
classesMerge: /class="([^"]+?)"([^<^>]*)class="([^"]+?)"/gi
dotNotation: '[a-z0-9_()][\\.a-z0-9_()]*'
#
# Constructor
#
# @param [String] template The template string to apply the data to on render.
#
constructor: (@template) -> @
#
# Compiles a template with a ERB style markup.
# Note: Override this if you want to use a different
# template system.
#
# NOTE:
# JavaScript templating a-la **ERB**, pilfered from John Resig's
# *Secrets of the JavaScript Ninja*, page 83.
# Single-quote fix from Rick Strahl.
# With alterations for arbitrary delimiters, and to preserve whitespace.
#
# @param [String] template The template to compile
#
compile: (data) ->
return @template_fn(data) if @template_fn
c = Wraith.Template.settings
template = @template
endMatch = new RegExp("'(?=[^" + c.end.substr(0, 1) + "]*" + Wraith.Template.escapeRegExp(c.end) + ")", "g")
str = 'var p=[],print=function(){p.push.apply(p,arguments);};' +
'p[p.length] = \'' +
template.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
.replace(endMatch, "✄")
.split("'").join("\\'")
.split("✄").join("'")
.replace(c.interpolate, "' + Wraith.Template.interpolate(obj, \'$1\') + '")
.replace(c.checked, "' + ((Wraith.Template.interpolate(obj, \'$1\') === true) ? 'checked=\"checked\"' : \'\') + '")
.replace(c.classes, "class=\"' + Wraith.Template.interpolateClass(obj, \'$1\') + '\"")
.replace(c.classesMerge, "class=\"$1 $3\"' + ((\'$2\').length > 0 ? \'$2\' : '') + '")
.split(c.start).join("');")
.split(c.end).join("p.push('") +
"'; return p.join('');"
@template_fn = new Function 'obj', str
@template_fn(data)
#
# Takes a given token array
# and seeks out its value in the given model. It currently
# assumes that a model is a Wraith.Model object.
#
# @param [Wraith.Model] model The model to search for the given token array
# @param [String] tokens The string of tokens to be used when searching the model (dot notation)
# @returns [Object|String|Boolean] The results of the token search
#
@interpolate: (model, tokens) =>
count = 0
results = false
tokens = tokens.split('.')
for token in tokens
target = if count is 0 then model else results
if target.hasOwnProperty(token)
results = target[token]
else if target.hasOwnProperty('get')
results = target.get(token)
else
results = false
break
results = results() if Wraith.isFunction(results)
count++
results
#
# Takes a given token array
# and seeks out its value in the given model. It currently
# assumes that a model is a Wraith.Model object.
#
# @param [Wraith.Model] model The model to search for the given token array
# @param [String] tokens The string of tokens to be used when searching the model (dot notation)
# @returns [Object|String|Boolean] The results of the token search
#
@interpolateClass: (model, tokens) =>
klasses = []
for klassMap in tokens.split(' ')
binding = klassMap.split(':')
continue if binding.length isnt 2
klass = binding[0]
tokens = binding[1]
invert = tokens[0] is '!'
tokens = tokens.slice(1) if invert
# @TODO: Refactor this and ViewModel.render
results = Wraith.Template.interpolate(model, tokens)
# If we get a string back, we should check for length
results = results.length > 0 if typeof results is 'string'
# Invert the results if necessary
results = !results if invert
# If results is true then we want to
# render this class
klasses.push klass if results is true
return klasses.join(' ')
| 148196 | #
# The Wraith Template object is responsible for storing a template string,
# generating a template function and interpolating the data to generate
# a view off a given set of data.
#
# Note: Based on <NAME>'s microtemplating function(s).
#
class Wraith.Template
#
# Borrowed from Underscores templates
#
# @param [String] string The string to escape
#
@escapeRegExp: (string) -> string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1')
#
# A set of template settings used by {Wraith.Template}
#
@settings:
start: '{{'
end: '}}'
interpolate: /{{(.+?)}}/g
checked: /data-checked=[\'\"](.+?)[\'\"]/gi
classes: /data-class=[\'\"](.+?)[\'\"]/gi
classesMerge: /class="([^"]+?)"([^<^>]*)class="([^"]+?)"/gi
dotNotation: '[a-z0-9_()][\\.a-z0-9_()]*'
#
# Constructor
#
# @param [String] template The template string to apply the data to on render.
#
constructor: (@template) -> @
#
# Compiles a template with a ERB style markup.
# Note: Override this if you want to use a different
# template system.
#
# NOTE:
# JavaScript templating a-la **ERB**, pilfered from <NAME>'s
# *Secrets of the JavaScript Ninja*, page 83.
# Single-quote fix from <NAME>.
# With alterations for arbitrary delimiters, and to preserve whitespace.
#
# @param [String] template The template to compile
#
compile: (data) ->
return @template_fn(data) if @template_fn
c = Wraith.Template.settings
template = @template
endMatch = new RegExp("'(?=[^" + c.end.substr(0, 1) + "]*" + Wraith.Template.escapeRegExp(c.end) + ")", "g")
str = 'var p=[],print=function(){p.push.apply(p,arguments);};' +
'p[p.length] = \'' +
template.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
.replace(endMatch, "✄")
.split("'").join("\\'")
.split("✄").join("'")
.replace(c.interpolate, "' + Wraith.Template.interpolate(obj, \'$1\') + '")
.replace(c.checked, "' + ((Wraith.Template.interpolate(obj, \'$1\') === true) ? 'checked=\"checked\"' : \'\') + '")
.replace(c.classes, "class=\"' + Wraith.Template.interpolateClass(obj, \'$1\') + '\"")
.replace(c.classesMerge, "class=\"$1 $3\"' + ((\'$2\').length > 0 ? \'$2\' : '') + '")
.split(c.start).join("');")
.split(c.end).join("p.push('") +
"'; return p.join('');"
@template_fn = new Function 'obj', str
@template_fn(data)
#
# Takes a given token array
# and seeks out its value in the given model. It currently
# assumes that a model is a Wraith.Model object.
#
# @param [Wraith.Model] model The model to search for the given token array
# @param [String] tokens The string of tokens to be used when searching the model (dot notation)
# @returns [Object|String|Boolean] The results of the token search
#
@interpolate: (model, tokens) =>
count = 0
results = false
tokens = tokens.split('.')
for token in tokens
target = if count is 0 then model else results
if target.hasOwnProperty(token)
results = target[token]
else if target.hasOwnProperty('get')
results = target.get(token)
else
results = false
break
results = results() if Wraith.isFunction(results)
count++
results
#
# Takes a given token array
# and seeks out its value in the given model. It currently
# assumes that a model is a Wraith.Model object.
#
# @param [Wraith.Model] model The model to search for the given token array
# @param [String] tokens The string of tokens to be used when searching the model (dot notation)
# @returns [Object|String|Boolean] The results of the token search
#
@interpolateClass: (model, tokens) =>
klasses = []
for klassMap in tokens.split(' ')
binding = klassMap.split(':')
continue if binding.length isnt 2
klass = binding[0]
tokens = binding[1]
invert = tokens[0] is '!'
tokens = tokens.slice(1) if invert
# @TODO: Refactor this and ViewModel.render
results = Wraith.Template.interpolate(model, tokens)
# If we get a string back, we should check for length
results = results.length > 0 if typeof results is 'string'
# Invert the results if necessary
results = !results if invert
# If results is true then we want to
# render this class
klasses.push klass if results is true
return klasses.join(' ')
| true | #
# The Wraith Template object is responsible for storing a template string,
# generating a template function and interpolating the data to generate
# a view off a given set of data.
#
# Note: Based on PI:NAME:<NAME>END_PI's microtemplating function(s).
#
class Wraith.Template
#
# Borrowed from Underscores templates
#
# @param [String] string The string to escape
#
@escapeRegExp: (string) -> string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1')
#
# A set of template settings used by {Wraith.Template}
#
@settings:
start: '{{'
end: '}}'
interpolate: /{{(.+?)}}/g
checked: /data-checked=[\'\"](.+?)[\'\"]/gi
classes: /data-class=[\'\"](.+?)[\'\"]/gi
classesMerge: /class="([^"]+?)"([^<^>]*)class="([^"]+?)"/gi
dotNotation: '[a-z0-9_()][\\.a-z0-9_()]*'
#
# Constructor
#
# @param [String] template The template string to apply the data to on render.
#
constructor: (@template) -> @
#
# Compiles a template with a ERB style markup.
# Note: Override this if you want to use a different
# template system.
#
# NOTE:
# JavaScript templating a-la **ERB**, pilfered from PI:NAME:<NAME>END_PI's
# *Secrets of the JavaScript Ninja*, page 83.
# Single-quote fix from PI:NAME:<NAME>END_PI.
# With alterations for arbitrary delimiters, and to preserve whitespace.
#
# @param [String] template The template to compile
#
compile: (data) ->
return @template_fn(data) if @template_fn
c = Wraith.Template.settings
template = @template
endMatch = new RegExp("'(?=[^" + c.end.substr(0, 1) + "]*" + Wraith.Template.escapeRegExp(c.end) + ")", "g")
str = 'var p=[],print=function(){p.push.apply(p,arguments);};' +
'p[p.length] = \'' +
template.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
.replace(endMatch, "✄")
.split("'").join("\\'")
.split("✄").join("'")
.replace(c.interpolate, "' + Wraith.Template.interpolate(obj, \'$1\') + '")
.replace(c.checked, "' + ((Wraith.Template.interpolate(obj, \'$1\') === true) ? 'checked=\"checked\"' : \'\') + '")
.replace(c.classes, "class=\"' + Wraith.Template.interpolateClass(obj, \'$1\') + '\"")
.replace(c.classesMerge, "class=\"$1 $3\"' + ((\'$2\').length > 0 ? \'$2\' : '') + '")
.split(c.start).join("');")
.split(c.end).join("p.push('") +
"'; return p.join('');"
@template_fn = new Function 'obj', str
@template_fn(data)
#
# Takes a given token array
# and seeks out its value in the given model. It currently
# assumes that a model is a Wraith.Model object.
#
# @param [Wraith.Model] model The model to search for the given token array
# @param [String] tokens The string of tokens to be used when searching the model (dot notation)
# @returns [Object|String|Boolean] The results of the token search
#
@interpolate: (model, tokens) =>
count = 0
results = false
tokens = tokens.split('.')
for token in tokens
target = if count is 0 then model else results
if target.hasOwnProperty(token)
results = target[token]
else if target.hasOwnProperty('get')
results = target.get(token)
else
results = false
break
results = results() if Wraith.isFunction(results)
count++
results
#
# Takes a given token array
# and seeks out its value in the given model. It currently
# assumes that a model is a Wraith.Model object.
#
# @param [Wraith.Model] model The model to search for the given token array
# @param [String] tokens The string of tokens to be used when searching the model (dot notation)
# @returns [Object|String|Boolean] The results of the token search
#
@interpolateClass: (model, tokens) =>
klasses = []
for klassMap in tokens.split(' ')
binding = klassMap.split(':')
continue if binding.length isnt 2
klass = binding[0]
tokens = binding[1]
invert = tokens[0] is '!'
tokens = tokens.slice(1) if invert
# @TODO: Refactor this and ViewModel.render
results = Wraith.Template.interpolate(model, tokens)
# If we get a string back, we should check for length
results = results.length > 0 if typeof results is 'string'
# Invert the results if necessary
results = !results if invert
# If results is true then we want to
# render this class
klasses.push klass if results is true
return klasses.join(' ')
|
[
{
"context": " values\", ->\n book = Book.Create({ 'title': \"Moby Dick\" })\n expect(book.title).toEqual(\"Moby Dick\")",
"end": 2141,
"score": 0.9992331266403198,
"start": 2132,
"tag": "NAME",
"value": "Moby Dick"
},
{
"context": " \"Moby Dick\" })\n expect(book.titl... | test/basic-spec.coffee | panta/angular-rest-orm | 21 | describe "ORM basic functionality:", ->
$rootScope = undefined
$httpBackend = undefined
$q = undefined
Resource = undefined
Book = undefined
beforeEach module("restOrm")
beforeEach inject(($injector) ->
$rootScope = $injector.get("$rootScope")
$httpBackend = $injector.get("$httpBackend")
$q = $injector.get("$q")
Resource = $injector.get("Resource")
class Book extends Resource
@urlEndpoint: '/api/v1/books/'
@defaults:
title: ""
subtitle: ""
author: null
tags: []
$initialize: ->
@abc = 42
#return
)
describe "Resource constructor", ->
it "creates new instance", ->
book = new Book()
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
return
it "calls instance $initialize", ->
spyOn(Book.prototype, '$initialize').andCallThrough()
book = new Book()
expect(Book.prototype.$initialize).toHaveBeenCalled()
expect(book.abc).toBeDefined()
expect(book.abc).toEqual(42)
return
return
it "should return a properfly formed instance", ->
book = new Book()
expect(book.$meta).toBeDefined()
expect(book.$meta.persisted).toBeFalsy()
expect(book.$promise.then).toBeDefined()
expect(book.$id).toBeDefined()
expect(book.$id).toEqual(null)
return
it "should have defaults", ->
book = new Book()
expect(book.title).toEqual("")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
return
describe "Resource.Create()", ->
it "returns new instance", ->
book = Book.Create()
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
return
it "returns new instance with defaults", ->
book = Book.Create()
expect(book.title).toEqual("")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "returns new instance with passed values", ->
book = Book.Create({ 'title': "Moby Dick" })
expect(book.title).toEqual("Moby Dick")
return
it "returns new instance with defaults when incomplete values are given", ->
book = Book.Create({ 'title': "Moby Dick" })
expect(book.title).toEqual("Moby Dick")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "uses correct REST endpoint", ->
book = Book.Create({ 'title': "Moby Dick" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
return
it "fulfills instance $promiseDirect", ->
book = Book.Create({ 'title': "Moby Dick" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills instance $promise", ->
book = Book.Create({ 'title': "Moby Dick" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "creates an instance with an id", ->
book = Book.Create({ 'title': "Moby Dick" })
expect(book.$id).toEqual(null)
expect(book.$meta.persisted).toBeFalsy()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$meta.persisted).toBeTruthy()
expect(book.$id).toEqual(1)
return
it "instance $promise result is the instance itself", ->
book = Book.Create({ 'title': "Moby Dick" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
result = handler.mostRecentCall.args[0]
expect(result).toBe(book)
return
it "should handle params", ->
$httpBackend.expect('POST', '/api/v1/books/?mode=full').respond(200, { id: 1, title: "Moby Dick" })
book = Book.Create { 'title': "Moby Dick" },
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("Moby Dick")
return
return
describe "Resource.Get()", ->
it "should return a proper model instance", ->
book = Book.Get(1)
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
expect(book.$meta).toBeDefined()
expect(book.$promise.then).toBeDefined()
expect(book.$promiseDirect.then).toBeDefined()
return
it "uses correct REST endpoint", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "" })
book = Book.Get(1)
$httpBackend.flush()
return
it "fulfills instance $promiseDirect", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
book = Book.Get(1)
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills instance $promise", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "returns an instance with an id", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$id).toEqual(1)
return
it "returns instance with values from server", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
book = Book.Get(1)
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.id).toBeDefined()
expect(book.id).toEqual(1)
expect(book.title).toEqual("The Jungle")
return
it "returns instance with defaults where not provided by server", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.subtitle).toBeDefined()
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "should handle params", ->
$httpBackend.expect('GET', '/api/v1/books/1?mode=full', (data) ->
return (data == "{}")
).respond(200, { id: 1, title: "The Jungle" })
book = Book.Get 1,
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
it "should handle data", ->
$httpBackend.expect('GET', '/api/v1/books/1', (data) ->
return false if not (data and angular.isString(data))
data = JSON.parse(data)
return data and data.mode? and (data.mode == "full")
).respond(200, { id: 1, title: "The Jungle" })
book = Book.Get 1,
data: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
return
describe "Resource.All()", ->
it "should return a proper collection", ->
collection = Book.All()
expect(collection).toBeDefined()
expect(angular.isArray(collection)).toBeTruthy()
expect(collection.$meta).toBeDefined()
expect(collection.$promise.then).toBeDefined()
expect(collection.$promiseDirect.then).toBeDefined()
return
it "uses correct REST endpoint", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [])
$httpBackend.flush()
return
it "fulfills collection $promiseDirect", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "Robinson Crusoe" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills collection $promise", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "Robinson Crusoe" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "collection $promise result is the collection itself", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "Robinson Crusoe" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promise.then handler
$rootScope.$digest()
result = handler.mostRecentCall.args[0]
expect(result).toBe(collection)
return
it "fulfills every instance $promiseDirect", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "Robinson Crusoe" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
for instance in collection
handler = jasmine.createSpy('success')
instance.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills every instance $promise", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "Robinson Crusoe" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
for instance in collection
handler = jasmine.createSpy('success')
instance.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "should return a collection of instances", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "Robinson Crusoe" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(2)
expect(collection[0] instanceof Book).toBeTruthy()
expect(collection[0].id).toEqual(1)
expect(collection[0].$id).toBeDefined()
expect(collection[0].$id).toEqual(1)
expect(collection[0].title).toEqual("The Jungle")
expect(collection[1] instanceof Book).toBeTruthy()
expect(collection[1].id).toEqual(2)
expect(collection[1].$id).toBeDefined()
expect(collection[1].$id).toEqual(2)
expect(collection[1].title).toEqual("Robinson Crusoe")
return
it "should handle params", ->
$httpBackend.expect('GET', '/api/v1/books/?title=Robinson+Crusoe', (data) ->
return (data == "{}")
).respond(200, [ { id: 2, title: "Robinson Crusoe" } ])
collection = Book.All
params: {title: "Robinson Crusoe"}
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(1)
return
it "should handle data", ->
$httpBackend.expect('GET', '/api/v1/books/', (data) ->
return false if not (data and angular.isString(data))
data = JSON.parse(data)
return data and data.title? and (data.title == "Robinson Crusoe")
).respond(200, [ { id: 2, title: "Robinson Crusoe" } ])
collection = Book.All
data: {title: "Robinson Crusoe"}
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(1)
return
return
describe "instance .$save()", ->
it "should return the instance itself", ->
book = new Book()
result = book.$save()
expect(result).toBeDefined()
expect(result instanceof Book).toBeTruthy()
expect(result).toBe(book)
return
it "uses correct REST endpoint for fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.flush()
return
it "uses correct REST endpoint for existing instance", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
book = Book.Get(1)
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
$httpBackend.expect('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.flush()
return
it "fulfills $promiseDirect for fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promise for fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promiseDirect for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promiseDirect.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promise for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills new $promiseDirect", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills new $promise", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "provides an id to a fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$id).toBeDefined()
expect(book.$id).toEqual(1)
return
it "saves fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.id).toBeDefined()
expect(book.id).toEqual(1)
expect(book.title).toEqual("The Jungle")
return
it "saves changed values of existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle 2.0")
return
it "should handle params for fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/?mode=full').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
it "should handle params for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
$httpBackend.expect('PUT', '/api/v1/books/1?mode=full').respond(200, { id: 1, title: "The Jungle 2.0" })
book.title = "The Jungle 2.0"
book.$save
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle 2.0")
return
return
return
| 188080 | describe "ORM basic functionality:", ->
$rootScope = undefined
$httpBackend = undefined
$q = undefined
Resource = undefined
Book = undefined
beforeEach module("restOrm")
beforeEach inject(($injector) ->
$rootScope = $injector.get("$rootScope")
$httpBackend = $injector.get("$httpBackend")
$q = $injector.get("$q")
Resource = $injector.get("Resource")
class Book extends Resource
@urlEndpoint: '/api/v1/books/'
@defaults:
title: ""
subtitle: ""
author: null
tags: []
$initialize: ->
@abc = 42
#return
)
describe "Resource constructor", ->
it "creates new instance", ->
book = new Book()
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
return
it "calls instance $initialize", ->
spyOn(Book.prototype, '$initialize').andCallThrough()
book = new Book()
expect(Book.prototype.$initialize).toHaveBeenCalled()
expect(book.abc).toBeDefined()
expect(book.abc).toEqual(42)
return
return
it "should return a properfly formed instance", ->
book = new Book()
expect(book.$meta).toBeDefined()
expect(book.$meta.persisted).toBeFalsy()
expect(book.$promise.then).toBeDefined()
expect(book.$id).toBeDefined()
expect(book.$id).toEqual(null)
return
it "should have defaults", ->
book = new Book()
expect(book.title).toEqual("")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
return
describe "Resource.Create()", ->
it "returns new instance", ->
book = Book.Create()
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
return
it "returns new instance with defaults", ->
book = Book.Create()
expect(book.title).toEqual("")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "returns new instance with passed values", ->
book = Book.Create({ 'title': "<NAME>" })
expect(book.title).toEqual("<NAME>")
return
it "returns new instance with defaults when incomplete values are given", ->
book = Book.Create({ 'title': "<NAME>" })
expect(book.title).toEqual("<NAME>")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "uses correct REST endpoint", ->
book = Book.Create({ 'title': "<NAME>" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
return
it "fulfills instance $promiseDirect", ->
book = Book.Create({ 'title': "<NAME>" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills instance $promise", ->
book = Book.Create({ 'title': "<NAME>" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "creates an instance with an id", ->
book = Book.Create({ 'title': "<NAME>" })
expect(book.$id).toEqual(null)
expect(book.$meta.persisted).toBeFalsy()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$meta.persisted).toBeTruthy()
expect(book.$id).toEqual(1)
return
it "instance $promise result is the instance itself", ->
book = Book.Create({ 'title': "<NAME>" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
result = handler.mostRecentCall.args[0]
expect(result).toBe(book)
return
it "should handle params", ->
$httpBackend.expect('POST', '/api/v1/books/?mode=full').respond(200, { id: 1, title: "<NAME>" })
book = Book.Create { 'title': "<NAME>" },
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("<NAME>")
return
return
describe "Resource.Get()", ->
it "should return a proper model instance", ->
book = Book.Get(1)
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
expect(book.$meta).toBeDefined()
expect(book.$promise.then).toBeDefined()
expect(book.$promiseDirect.then).toBeDefined()
return
it "uses correct REST endpoint", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "" })
book = Book.Get(1)
$httpBackend.flush()
return
it "fulfills instance $promiseDirect", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
book = Book.Get(1)
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills instance $promise", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "returns an instance with an id", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$id).toEqual(1)
return
it "returns instance with values from server", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
book = Book.Get(1)
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.id).toBeDefined()
expect(book.id).toEqual(1)
expect(book.title).toEqual("The Jungle")
return
it "returns instance with defaults where not provided by server", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.subtitle).toBeDefined()
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "should handle params", ->
$httpBackend.expect('GET', '/api/v1/books/1?mode=full', (data) ->
return (data == "{}")
).respond(200, { id: 1, title: "The Jungle" })
book = Book.Get 1,
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
it "should handle data", ->
$httpBackend.expect('GET', '/api/v1/books/1', (data) ->
return false if not (data and angular.isString(data))
data = JSON.parse(data)
return data and data.mode? and (data.mode == "full")
).respond(200, { id: 1, title: "The Jungle" })
book = Book.Get 1,
data: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
return
describe "Resource.All()", ->
it "should return a proper collection", ->
collection = Book.All()
expect(collection).toBeDefined()
expect(angular.isArray(collection)).toBeTruthy()
expect(collection.$meta).toBeDefined()
expect(collection.$promise.then).toBeDefined()
expect(collection.$promiseDirect.then).toBeDefined()
return
it "uses correct REST endpoint", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [])
$httpBackend.flush()
return
it "fulfills collection $promiseDirect", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "<NAME>" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills collection $promise", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "<NAME>" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "collection $promise result is the collection itself", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "<NAME>" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promise.then handler
$rootScope.$digest()
result = handler.mostRecentCall.args[0]
expect(result).toBe(collection)
return
it "fulfills every instance $promiseDirect", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "<NAME>" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
for instance in collection
handler = jasmine.createSpy('success')
instance.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills every instance $promise", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "<NAME>" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
for instance in collection
handler = jasmine.createSpy('success')
instance.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "should return a collection of instances", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "<NAME>" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(2)
expect(collection[0] instanceof Book).toBeTruthy()
expect(collection[0].id).toEqual(1)
expect(collection[0].$id).toBeDefined()
expect(collection[0].$id).toEqual(1)
expect(collection[0].title).toEqual("The Jungle")
expect(collection[1] instanceof Book).toBeTruthy()
expect(collection[1].id).toEqual(2)
expect(collection[1].$id).toBeDefined()
expect(collection[1].$id).toEqual(2)
expect(collection[1].title).toEqual("<NAME>")
return
it "should handle params", ->
$httpBackend.expect('GET', '/api/v1/books/?title=<NAME>', (data) ->
return (data == "{}")
).respond(200, [ { id: 2, title: "<NAME>" } ])
collection = Book.All
params: {title: "<NAME>"}
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(1)
return
it "should handle data", ->
$httpBackend.expect('GET', '/api/v1/books/', (data) ->
return false if not (data and angular.isString(data))
data = JSON.parse(data)
return data and data.title? and (data.title == "<NAME>")
).respond(200, [ { id: 2, title: "<NAME>" } ])
collection = Book.All
data: {title: "<NAME>"}
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(1)
return
return
describe "instance .$save()", ->
it "should return the instance itself", ->
book = new Book()
result = book.$save()
expect(result).toBeDefined()
expect(result instanceof Book).toBeTruthy()
expect(result).toBe(book)
return
it "uses correct REST endpoint for fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.flush()
return
it "uses correct REST endpoint for existing instance", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
book = Book.Get(1)
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
$httpBackend.expect('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.flush()
return
it "fulfills $promiseDirect for fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promise for fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promiseDirect for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promiseDirect.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promise for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills new $promiseDirect", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills new $promise", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "provides an id to a fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$id).toBeDefined()
expect(book.$id).toEqual(1)
return
it "saves fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.id).toBeDefined()
expect(book.id).toEqual(1)
expect(book.title).toEqual("The Jungle")
return
it "saves changed values of existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle 2.0")
return
it "should handle params for fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/?mode=full').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
it "should handle params for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
$httpBackend.expect('PUT', '/api/v1/books/1?mode=full').respond(200, { id: 1, title: "The Jungle 2.0" })
book.title = "The Jungle 2.0"
book.$save
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle 2.0")
return
return
return
| true | describe "ORM basic functionality:", ->
$rootScope = undefined
$httpBackend = undefined
$q = undefined
Resource = undefined
Book = undefined
beforeEach module("restOrm")
beforeEach inject(($injector) ->
$rootScope = $injector.get("$rootScope")
$httpBackend = $injector.get("$httpBackend")
$q = $injector.get("$q")
Resource = $injector.get("Resource")
class Book extends Resource
@urlEndpoint: '/api/v1/books/'
@defaults:
title: ""
subtitle: ""
author: null
tags: []
$initialize: ->
@abc = 42
#return
)
describe "Resource constructor", ->
it "creates new instance", ->
book = new Book()
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
return
it "calls instance $initialize", ->
spyOn(Book.prototype, '$initialize').andCallThrough()
book = new Book()
expect(Book.prototype.$initialize).toHaveBeenCalled()
expect(book.abc).toBeDefined()
expect(book.abc).toEqual(42)
return
return
it "should return a properfly formed instance", ->
book = new Book()
expect(book.$meta).toBeDefined()
expect(book.$meta.persisted).toBeFalsy()
expect(book.$promise.then).toBeDefined()
expect(book.$id).toBeDefined()
expect(book.$id).toEqual(null)
return
it "should have defaults", ->
book = new Book()
expect(book.title).toEqual("")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
return
describe "Resource.Create()", ->
it "returns new instance", ->
book = Book.Create()
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
return
it "returns new instance with defaults", ->
book = Book.Create()
expect(book.title).toEqual("")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "returns new instance with passed values", ->
book = Book.Create({ 'title': "PI:NAME:<NAME>END_PI" })
expect(book.title).toEqual("PI:NAME:<NAME>END_PI")
return
it "returns new instance with defaults when incomplete values are given", ->
book = Book.Create({ 'title': "PI:NAME:<NAME>END_PI" })
expect(book.title).toEqual("PI:NAME:<NAME>END_PI")
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "uses correct REST endpoint", ->
book = Book.Create({ 'title': "PI:NAME:<NAME>END_PI" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
return
it "fulfills instance $promiseDirect", ->
book = Book.Create({ 'title': "PI:NAME:<NAME>END_PI" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills instance $promise", ->
book = Book.Create({ 'title': "PI:NAME:<NAME>END_PI" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "creates an instance with an id", ->
book = Book.Create({ 'title': "PI:NAME:<NAME>END_PI" })
expect(book.$id).toEqual(null)
expect(book.$meta.persisted).toBeFalsy()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$meta.persisted).toBeTruthy()
expect(book.$id).toEqual(1)
return
it "instance $promise result is the instance itself", ->
book = Book.Create({ 'title': "PI:NAME:<NAME>END_PI" })
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
result = handler.mostRecentCall.args[0]
expect(result).toBe(book)
return
it "should handle params", ->
$httpBackend.expect('POST', '/api/v1/books/?mode=full').respond(200, { id: 1, title: "PI:NAME:<NAME>END_PI" })
book = Book.Create { 'title': "PI:NAME:<NAME>END_PI" },
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("PI:NAME:<NAME>END_PI")
return
return
describe "Resource.Get()", ->
it "should return a proper model instance", ->
book = Book.Get(1)
expect(book).toBeDefined()
expect(book instanceof Book).toBeTruthy()
expect(book.$meta).toBeDefined()
expect(book.$promise.then).toBeDefined()
expect(book.$promiseDirect.then).toBeDefined()
return
it "uses correct REST endpoint", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "" })
book = Book.Get(1)
$httpBackend.flush()
return
it "fulfills instance $promiseDirect", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
book = Book.Get(1)
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills instance $promise", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle", subtitle: "", author: null, tags: [] } )
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "returns an instance with an id", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$id).toEqual(1)
return
it "returns instance with values from server", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
book = Book.Get(1)
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.id).toBeDefined()
expect(book.id).toEqual(1)
expect(book.title).toEqual("The Jungle")
return
it "returns instance with defaults where not provided by server", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.subtitle).toBeDefined()
expect(book.subtitle).toEqual("")
expect(book.author).toEqual(null)
expect(book.tags).toEqual([])
return
it "should handle params", ->
$httpBackend.expect('GET', '/api/v1/books/1?mode=full', (data) ->
return (data == "{}")
).respond(200, { id: 1, title: "The Jungle" })
book = Book.Get 1,
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
it "should handle data", ->
$httpBackend.expect('GET', '/api/v1/books/1', (data) ->
return false if not (data and angular.isString(data))
data = JSON.parse(data)
return data and data.mode? and (data.mode == "full")
).respond(200, { id: 1, title: "The Jungle" })
book = Book.Get 1,
data: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
return
describe "Resource.All()", ->
it "should return a proper collection", ->
collection = Book.All()
expect(collection).toBeDefined()
expect(angular.isArray(collection)).toBeTruthy()
expect(collection.$meta).toBeDefined()
expect(collection.$promise.then).toBeDefined()
expect(collection.$promiseDirect.then).toBeDefined()
return
it "uses correct REST endpoint", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [])
$httpBackend.flush()
return
it "fulfills collection $promiseDirect", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "PI:NAME:<NAME>END_PI" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills collection $promise", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "PI:NAME:<NAME>END_PI" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "collection $promise result is the collection itself", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "PI:NAME:<NAME>END_PI" } ])
$httpBackend.flush()
handler = jasmine.createSpy('success')
collection.$promise.then handler
$rootScope.$digest()
result = handler.mostRecentCall.args[0]
expect(result).toBe(collection)
return
it "fulfills every instance $promiseDirect", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "PI:NAME:<NAME>END_PI" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
for instance in collection
handler = jasmine.createSpy('success')
instance.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills every instance $promise", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "PI:NAME:<NAME>END_PI" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
for instance in collection
handler = jasmine.createSpy('success')
instance.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "should return a collection of instances", ->
collection = Book.All()
$httpBackend.when('GET', '/api/v1/books/').respond(200, [ { id: 1, title: "The Jungle", subtitle: "" }, { id: 2, title: "PI:NAME:<NAME>END_PI" } ])
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(2)
expect(collection[0] instanceof Book).toBeTruthy()
expect(collection[0].id).toEqual(1)
expect(collection[0].$id).toBeDefined()
expect(collection[0].$id).toEqual(1)
expect(collection[0].title).toEqual("The Jungle")
expect(collection[1] instanceof Book).toBeTruthy()
expect(collection[1].id).toEqual(2)
expect(collection[1].$id).toBeDefined()
expect(collection[1].$id).toEqual(2)
expect(collection[1].title).toEqual("PI:NAME:<NAME>END_PI")
return
it "should handle params", ->
$httpBackend.expect('GET', '/api/v1/books/?title=PI:NAME:<NAME>END_PI', (data) ->
return (data == "{}")
).respond(200, [ { id: 2, title: "PI:NAME:<NAME>END_PI" } ])
collection = Book.All
params: {title: "PI:NAME:<NAME>END_PI"}
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(1)
return
it "should handle data", ->
$httpBackend.expect('GET', '/api/v1/books/', (data) ->
return false if not (data and angular.isString(data))
data = JSON.parse(data)
return data and data.title? and (data.title == "PI:NAME:<NAME>END_PI")
).respond(200, [ { id: 2, title: "PI:NAME:<NAME>END_PI" } ])
collection = Book.All
data: {title: "PI:NAME:<NAME>END_PI"}
$httpBackend.flush()
collection.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(collection.length).toEqual(1)
return
return
describe "instance .$save()", ->
it "should return the instance itself", ->
book = new Book()
result = book.$save()
expect(result).toBeDefined()
expect(result instanceof Book).toBeTruthy()
expect(result).toBe(book)
return
it "uses correct REST endpoint for fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.flush()
return
it "uses correct REST endpoint for existing instance", ->
$httpBackend.expect('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
book = Book.Get(1)
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
$httpBackend.expect('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.flush()
return
it "fulfills $promiseDirect for fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promise for fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promiseDirect for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promiseDirect.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills $promise for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills new $promiseDirect", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promiseDirect.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "fulfills new $promise", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
handler = jasmine.createSpy('success')
book.$promise.then handler
$rootScope.$digest()
expect(handler).toHaveBeenCalled()
return
it "provides an id to a fresh instance", ->
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.when('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.$id).toBeDefined()
expect(book.$id).toEqual(1)
return
it "saves fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save()
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.id).toBeDefined()
expect(book.id).toEqual(1)
expect(book.title).toEqual("The Jungle")
return
it "saves changed values of existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
book.title = "The Jungle 2.0"
book.$save()
$httpBackend.when('PUT', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle 2.0" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle 2.0")
return
it "should handle params for fresh instance", ->
$httpBackend.expect('POST', '/api/v1/books/?mode=full').respond(200, { id: 1, title: "The Jungle" })
book = new Book({ title: "The Jungle" })
book.$save
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle")
return
it "should handle params for existing instance", ->
book = Book.Get(1)
$httpBackend.when('GET', '/api/v1/books/1').respond(200, { id: 1, title: "The Jungle" })
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
$httpBackend.expect('PUT', '/api/v1/books/1?mode=full').respond(200, { id: 1, title: "The Jungle 2.0" })
book.title = "The Jungle 2.0"
book.$save
params: {mode: "full"}
$httpBackend.flush()
book.$promise.then jasmine.createSpy('success')
$rootScope.$digest()
expect(book.title).toEqual("The Jungle 2.0")
return
return
return
|
[
{
"context": "# **Author:** Peter Urbak<br/>\n# **Version:** 2013-01-29\n\nroot = exports ? ",
"end": 25,
"score": 0.9998607635498047,
"start": 14,
"tag": "NAME",
"value": "Peter Urbak"
}
] | client_src/geometry.coffee | dragonwasrobot/gesture-recognition | 2 | # **Author:** Peter Urbak<br/>
# **Version:** 2013-01-29
root = exports ? window
# ## Classes
# The `Vector` encapsulates a vector's magnitude and direction.
class App.Vector
constructor: (@x, @y) ->
# The `Position` encapsulates a point.
class App.Position
constructor: (@x, @y) ->
# The `Direction` encapsulates a direction having a start- and endpoint.
class App.Direction
constructor: (@positionStart, @positionStop, @vector) ->
# ## Functions
# ### Vectors
# Creates a vector from a start- and endpoint
#
# - **start:** The start position
# - **end:** The stop position
App.vectorFromPositions = (start, end) ->
v = new App.Vector((start.x - end.x) * 100, (start.y - end.y) * 100)
# Creates a vector from a degree value
#
# - **degrees:** The degrees
App.vectorFromDegrees = (degrees) ->
v = new App.Vector(Math.cos(degrees), Math.sin(degrees))
# Returns the angle between two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorAngle = (v1, v2) ->
App.radiansToDegrees(
Math.acos App.vectorDotProduct(App.vectorNormalize(v1),
App.vectorNormalize(v2)))
# Adds two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorAddition = (v1, v2) ->
v = new App.Vector(v1.x + v2.x, v1.y + v2.y)
# Returns the length of a vector
#
# - **v:** The vector whose length should be calculated
App.vectorLength = (v) -> Math.sqrt(v.x * v.x + v.y * v.y)
# Returns the dot product of two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorDotProduct = (v1, v2) -> v1.x * v2.x + v1.y * v2.y
# Returns the normalized version of the specified vector
#
# - **v:** The vector to be normalized.
App.vectorNormalize = (v) ->
length = App.vectorLength v
normalized = new App.Vector(v.x / length, v.y / length)
# ### Metrics
# Checks if two angles have approximately the same direction.
#
# - **a1:** The first angle
# - **a2:** The second angle
App.sameDirection = (a1, a2) ->
diffAngle = Math.abs(a1 - a2)
return 0 <= diffAngle and diffAngle <= 30
# Checks if two angles have approximately the opposite directions.
#
# - **a1:** The first angle
# - **a2:** The second angle
App.oppositeDirection = (a1, a2) ->
diffAngle = Math.abs(a1 - a2)
return 150 <= diffAngle and diffAngle <= 210
# Converts a radian value to degrees
#
# - **radians:** The radian value
App.radiansToDegrees = (radians) -> radians * (180 / Math.PI)
# Calculates the Euclidean distance between two position.
#
# - **q:** The first position
# - **p:** The second position
App.euclideanDistance = (q, p) ->
Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2))
# Calculates the difference between two points in time
#
# - **start:** The start value
# - **stop:** The stop value
App.measureTime = (start, stop) -> Math.abs(stop - start)
| 115521 | # **Author:** <NAME><br/>
# **Version:** 2013-01-29
root = exports ? window
# ## Classes
# The `Vector` encapsulates a vector's magnitude and direction.
class App.Vector
constructor: (@x, @y) ->
# The `Position` encapsulates a point.
class App.Position
constructor: (@x, @y) ->
# The `Direction` encapsulates a direction having a start- and endpoint.
class App.Direction
constructor: (@positionStart, @positionStop, @vector) ->
# ## Functions
# ### Vectors
# Creates a vector from a start- and endpoint
#
# - **start:** The start position
# - **end:** The stop position
App.vectorFromPositions = (start, end) ->
v = new App.Vector((start.x - end.x) * 100, (start.y - end.y) * 100)
# Creates a vector from a degree value
#
# - **degrees:** The degrees
App.vectorFromDegrees = (degrees) ->
v = new App.Vector(Math.cos(degrees), Math.sin(degrees))
# Returns the angle between two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorAngle = (v1, v2) ->
App.radiansToDegrees(
Math.acos App.vectorDotProduct(App.vectorNormalize(v1),
App.vectorNormalize(v2)))
# Adds two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorAddition = (v1, v2) ->
v = new App.Vector(v1.x + v2.x, v1.y + v2.y)
# Returns the length of a vector
#
# - **v:** The vector whose length should be calculated
App.vectorLength = (v) -> Math.sqrt(v.x * v.x + v.y * v.y)
# Returns the dot product of two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorDotProduct = (v1, v2) -> v1.x * v2.x + v1.y * v2.y
# Returns the normalized version of the specified vector
#
# - **v:** The vector to be normalized.
App.vectorNormalize = (v) ->
length = App.vectorLength v
normalized = new App.Vector(v.x / length, v.y / length)
# ### Metrics
# Checks if two angles have approximately the same direction.
#
# - **a1:** The first angle
# - **a2:** The second angle
App.sameDirection = (a1, a2) ->
diffAngle = Math.abs(a1 - a2)
return 0 <= diffAngle and diffAngle <= 30
# Checks if two angles have approximately the opposite directions.
#
# - **a1:** The first angle
# - **a2:** The second angle
App.oppositeDirection = (a1, a2) ->
diffAngle = Math.abs(a1 - a2)
return 150 <= diffAngle and diffAngle <= 210
# Converts a radian value to degrees
#
# - **radians:** The radian value
App.radiansToDegrees = (radians) -> radians * (180 / Math.PI)
# Calculates the Euclidean distance between two position.
#
# - **q:** The first position
# - **p:** The second position
App.euclideanDistance = (q, p) ->
Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2))
# Calculates the difference between two points in time
#
# - **start:** The start value
# - **stop:** The stop value
App.measureTime = (start, stop) -> Math.abs(stop - start)
| true | # **Author:** PI:NAME:<NAME>END_PI<br/>
# **Version:** 2013-01-29
root = exports ? window
# ## Classes
# The `Vector` encapsulates a vector's magnitude and direction.
class App.Vector
constructor: (@x, @y) ->
# The `Position` encapsulates a point.
class App.Position
constructor: (@x, @y) ->
# The `Direction` encapsulates a direction having a start- and endpoint.
class App.Direction
constructor: (@positionStart, @positionStop, @vector) ->
# ## Functions
# ### Vectors
# Creates a vector from a start- and endpoint
#
# - **start:** The start position
# - **end:** The stop position
App.vectorFromPositions = (start, end) ->
v = new App.Vector((start.x - end.x) * 100, (start.y - end.y) * 100)
# Creates a vector from a degree value
#
# - **degrees:** The degrees
App.vectorFromDegrees = (degrees) ->
v = new App.Vector(Math.cos(degrees), Math.sin(degrees))
# Returns the angle between two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorAngle = (v1, v2) ->
App.radiansToDegrees(
Math.acos App.vectorDotProduct(App.vectorNormalize(v1),
App.vectorNormalize(v2)))
# Adds two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorAddition = (v1, v2) ->
v = new App.Vector(v1.x + v2.x, v1.y + v2.y)
# Returns the length of a vector
#
# - **v:** The vector whose length should be calculated
App.vectorLength = (v) -> Math.sqrt(v.x * v.x + v.y * v.y)
# Returns the dot product of two vectors
#
# - **v1:** The first vector
# - **v2:** The second vector
App.vectorDotProduct = (v1, v2) -> v1.x * v2.x + v1.y * v2.y
# Returns the normalized version of the specified vector
#
# - **v:** The vector to be normalized.
App.vectorNormalize = (v) ->
length = App.vectorLength v
normalized = new App.Vector(v.x / length, v.y / length)
# ### Metrics
# Checks if two angles have approximately the same direction.
#
# - **a1:** The first angle
# - **a2:** The second angle
App.sameDirection = (a1, a2) ->
diffAngle = Math.abs(a1 - a2)
return 0 <= diffAngle and diffAngle <= 30
# Checks if two angles have approximately the opposite directions.
#
# - **a1:** The first angle
# - **a2:** The second angle
App.oppositeDirection = (a1, a2) ->
diffAngle = Math.abs(a1 - a2)
return 150 <= diffAngle and diffAngle <= 210
# Converts a radian value to degrees
#
# - **radians:** The radian value
App.radiansToDegrees = (radians) -> radians * (180 / Math.PI)
# Calculates the Euclidean distance between two position.
#
# - **q:** The first position
# - **p:** The second position
App.euclideanDistance = (q, p) ->
Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2))
# Calculates the difference between two points in time
#
# - **start:** The start value
# - **stop:** The stop value
App.measureTime = (start, stop) -> Math.abs(stop - start)
|
[
{
"context": "tains raw output from the PHPUnit command\n\n@author Roelof Roos (https://github.com/roelofr)\n###\n\nHideableView = ",
"end": 89,
"score": 0.9998802542686462,
"start": 78,
"tag": "NAME",
"value": "Roelof Roos"
},
{
"context": " command\n\n@author Roelof Roos (https://g... | lib/views/terminal.coffee | roelofr/php-report | 0 | ###
PHP Report
Terminal
Contains raw output from the PHPUnit command
@author Roelof Roos (https://github.com/roelofr)
###
HideableView = require './hideable-view'
module.exports =
class Terminal extends HideableView
@content: ->
@div class: 'php-report__terminal', =>
@div class: 'inset-panel', =>
@div class: 'panel-heading', outlet: 'header', 'Console output'
@div class: 'panel-body php-report__terminal-panel', outlet: 'panel', =>
@pre class: 'php-report__terminal-inner', outlet: 'terminal'
termContainer: null
initialize: (phpReport) ->
phpReport.on 'log', (line) => @append line
phpReport.on 'clean', => @clear()
@panel.addClass('hidden')
@header.on 'click', => @panel.toggleClass('hidden')
clear: ->
@terminal.text ''
@panel.scrollTop 0
append: (text) ->
if not text or typeof text != 'string' then return
text = String(text).replace /(\r\n|\n\r|\r|\n)/g, '<br />$1'
# Append text and scroll to end
@terminal.append text
@terminal.scrollTop @terminal.get(0).scrollHeight;
| 52703 | ###
PHP Report
Terminal
Contains raw output from the PHPUnit command
@author <NAME> (https://github.com/roelofr)
###
HideableView = require './hideable-view'
module.exports =
class Terminal extends HideableView
@content: ->
@div class: 'php-report__terminal', =>
@div class: 'inset-panel', =>
@div class: 'panel-heading', outlet: 'header', 'Console output'
@div class: 'panel-body php-report__terminal-panel', outlet: 'panel', =>
@pre class: 'php-report__terminal-inner', outlet: 'terminal'
termContainer: null
initialize: (phpReport) ->
phpReport.on 'log', (line) => @append line
phpReport.on 'clean', => @clear()
@panel.addClass('hidden')
@header.on 'click', => @panel.toggleClass('hidden')
clear: ->
@terminal.text ''
@panel.scrollTop 0
append: (text) ->
if not text or typeof text != 'string' then return
text = String(text).replace /(\r\n|\n\r|\r|\n)/g, '<br />$1'
# Append text and scroll to end
@terminal.append text
@terminal.scrollTop @terminal.get(0).scrollHeight;
| true | ###
PHP Report
Terminal
Contains raw output from the PHPUnit command
@author PI:NAME:<NAME>END_PI (https://github.com/roelofr)
###
HideableView = require './hideable-view'
module.exports =
class Terminal extends HideableView
@content: ->
@div class: 'php-report__terminal', =>
@div class: 'inset-panel', =>
@div class: 'panel-heading', outlet: 'header', 'Console output'
@div class: 'panel-body php-report__terminal-panel', outlet: 'panel', =>
@pre class: 'php-report__terminal-inner', outlet: 'terminal'
termContainer: null
initialize: (phpReport) ->
phpReport.on 'log', (line) => @append line
phpReport.on 'clean', => @clear()
@panel.addClass('hidden')
@header.on 'click', => @panel.toggleClass('hidden')
clear: ->
@terminal.text ''
@panel.scrollTop 0
append: (text) ->
if not text or typeof text != 'string' then return
text = String(text).replace /(\r\n|\n\r|\r|\n)/g, '<br />$1'
# Append text and scroll to end
@terminal.append text
@terminal.scrollTop @terminal.get(0).scrollHeight;
|
[
{
"context": "itesse de traitement de vos demandes par l\\'équipe Theodo ?'\n type: 'radio'\n items: [\n label: '5",
"end": 243,
"score": 0.7887037992477417,
"start": 237,
"tag": "NAME",
"value": "Theodo"
}
] | client/src/organization/states/settings/controller.coffee | MollardMichael/scrumble | 27 | angular.module 'Scrumble.organization'
.controller 'OrganizationCtrl', (
$scope
$stateParams
Organization
) ->
formSkeleton = [
label: 'Quelle est votre appréciation sur la vitesse de traitement de vos demandes par l\'équipe Theodo ?'
type: 'radio'
items: [
label: '5 - Excellente'
value: 5
,
label: '4 - Très bonne'
value: 4
,
label: '3 - Bonne'
value: 3
,
label: '2 - Moyenne'
value: 2
,
label: '1 - Insuffisante'
value: 1
,
label: '0 - Très insuffisante'
value: 0
]
,
label: 'Quelle est votre appréciation sur la qualité de l\'accompagnement Theodo ?'
type: 'radio'
items: [
label: '5 - Excellente'
value: 5
,
label: '4 - Très bonne'
value: 4
,
label: '3 - Bonne'
value: 3
,
label: '2 - Moyenne'
value: 2
,
label: '1 - Insuffisante'
value: 1
,
label: '0 - Très insuffisante'
value: 0
]
,
label: 'Quel changement/amélioration prioritaire pourrait vous amener à améliorer votre appréciation ?'
type: 'textarea'
,
label: 'Si vous aviez une baguette magique, quelle est \"la\" chose que vous changeriez chez Theodo ?'
type: 'textarea'
,
label: 'Seriez vous prêt à recommander Theodo'
type: 'radio'
items: [
label: 'Oui bien sûr'
value: 'yes-of-course'
,
label: 'Oui'
value: 'yes'
,
label: 'Pas vraiment'
value: 'not-really'
,
label: 'Pas du tout'
value: 'not-at-all'
]
,
label: 'Souhaitez-vous faire un point commercial avec Theodo dans la semaine à venir ?'
type: 'radio'
items: [
label: 'Oui'
value: 'yes'
,
label: 'Non, ce n’est pas nécessaire pour l’instant'
value: 'no'
]
]
Organization.get(organizationId: $stateParams.organizationId)
.then (organization) ->
organization.satisfactionSurvey = _.defaultsDeep organization.satisfactionSurvey, formSkeleton
$scope.organization = organization
$scope.save = (organization) ->
Organization.update organization
| 11200 | angular.module 'Scrumble.organization'
.controller 'OrganizationCtrl', (
$scope
$stateParams
Organization
) ->
formSkeleton = [
label: 'Quelle est votre appréciation sur la vitesse de traitement de vos demandes par l\'équipe <NAME> ?'
type: 'radio'
items: [
label: '5 - Excellente'
value: 5
,
label: '4 - Très bonne'
value: 4
,
label: '3 - Bonne'
value: 3
,
label: '2 - Moyenne'
value: 2
,
label: '1 - Insuffisante'
value: 1
,
label: '0 - Très insuffisante'
value: 0
]
,
label: 'Quelle est votre appréciation sur la qualité de l\'accompagnement Theodo ?'
type: 'radio'
items: [
label: '5 - Excellente'
value: 5
,
label: '4 - Très bonne'
value: 4
,
label: '3 - Bonne'
value: 3
,
label: '2 - Moyenne'
value: 2
,
label: '1 - Insuffisante'
value: 1
,
label: '0 - Très insuffisante'
value: 0
]
,
label: 'Quel changement/amélioration prioritaire pourrait vous amener à améliorer votre appréciation ?'
type: 'textarea'
,
label: 'Si vous aviez une baguette magique, quelle est \"la\" chose que vous changeriez chez Theodo ?'
type: 'textarea'
,
label: 'Seriez vous prêt à recommander Theodo'
type: 'radio'
items: [
label: 'Oui bien sûr'
value: 'yes-of-course'
,
label: 'Oui'
value: 'yes'
,
label: 'Pas vraiment'
value: 'not-really'
,
label: 'Pas du tout'
value: 'not-at-all'
]
,
label: 'Souhaitez-vous faire un point commercial avec Theodo dans la semaine à venir ?'
type: 'radio'
items: [
label: 'Oui'
value: 'yes'
,
label: 'Non, ce n’est pas nécessaire pour l’instant'
value: 'no'
]
]
Organization.get(organizationId: $stateParams.organizationId)
.then (organization) ->
organization.satisfactionSurvey = _.defaultsDeep organization.satisfactionSurvey, formSkeleton
$scope.organization = organization
$scope.save = (organization) ->
Organization.update organization
| true | angular.module 'Scrumble.organization'
.controller 'OrganizationCtrl', (
$scope
$stateParams
Organization
) ->
formSkeleton = [
label: 'Quelle est votre appréciation sur la vitesse de traitement de vos demandes par l\'équipe PI:NAME:<NAME>END_PI ?'
type: 'radio'
items: [
label: '5 - Excellente'
value: 5
,
label: '4 - Très bonne'
value: 4
,
label: '3 - Bonne'
value: 3
,
label: '2 - Moyenne'
value: 2
,
label: '1 - Insuffisante'
value: 1
,
label: '0 - Très insuffisante'
value: 0
]
,
label: 'Quelle est votre appréciation sur la qualité de l\'accompagnement Theodo ?'
type: 'radio'
items: [
label: '5 - Excellente'
value: 5
,
label: '4 - Très bonne'
value: 4
,
label: '3 - Bonne'
value: 3
,
label: '2 - Moyenne'
value: 2
,
label: '1 - Insuffisante'
value: 1
,
label: '0 - Très insuffisante'
value: 0
]
,
label: 'Quel changement/amélioration prioritaire pourrait vous amener à améliorer votre appréciation ?'
type: 'textarea'
,
label: 'Si vous aviez une baguette magique, quelle est \"la\" chose que vous changeriez chez Theodo ?'
type: 'textarea'
,
label: 'Seriez vous prêt à recommander Theodo'
type: 'radio'
items: [
label: 'Oui bien sûr'
value: 'yes-of-course'
,
label: 'Oui'
value: 'yes'
,
label: 'Pas vraiment'
value: 'not-really'
,
label: 'Pas du tout'
value: 'not-at-all'
]
,
label: 'Souhaitez-vous faire un point commercial avec Theodo dans la semaine à venir ?'
type: 'radio'
items: [
label: 'Oui'
value: 'yes'
,
label: 'Non, ce n’est pas nécessaire pour l’instant'
value: 'no'
]
]
Organization.get(organizationId: $stateParams.organizationId)
.then (organization) ->
organization.satisfactionSurvey = _.defaultsDeep organization.satisfactionSurvey, formSkeleton
$scope.organization = organization
$scope.save = (organization) ->
Organization.update organization
|
[
{
"context": "\n increment: (collectionName, docId) ->\n key = collectionName + ':' + docId.valueOf()\n if !@heap[key]\n @heap[key] = 0\n @heap",
"end": 184,
"score": 0.995822548866272,
"start": 146,
"tag": "KEY",
"value": "collectionName + ':' + docId.valueOf()"
},
{
... | publish_helper.coffee | maximalmeteor/server-transform | 44 | class @DocumentRefCounter
constructor: (observer) ->
@heap = {}
@observer = observer
increment: (collectionName, docId) ->
key = collectionName + ':' + docId.valueOf()
if !@heap[key]
@heap[key] = 0
@heap[key]++
decrement: (collectionName, docId) ->
key = collectionName + ':' + docId.valueOf()
if @heap[key]
@heap[key]--
@observer.onChange collectionName, docId, @heap[key]
class @PublishHelper
constructor: (meteorSub) ->
@meteorSub = meteorSub
@docHash = {}
@refCounter = new DocumentRefCounter
onChange: (collectionName, docId, refCount) =>
ServerTransform.log ['Subscription.refCounter.onChange', collectionName + ':' + docId.valueOf() + ' ' + refCount]
return unless refCount <= 0
meteorSub.removed collectionName, docId
@_removeDocHash collectionName, docId
onStop: (callback) ->
@meteorSub.onStop callback
added: (collectionName, docId, doc) ->
@refCounter.increment collectionName, docId
return unless @_hasDocChanged(collectionName, docId, doc)
ServerTransform.log ['Subscription.added', collectionName + ':' + docId]
@meteorSub.added collectionName, docId, doc
@_addDocHash collectionName, _.clone doc
changed: (collectionName, id, doc) ->
return unless @_isDocPublished(collectionName, id)
changes = @_computeChanges collectionName, id, doc
return if _.isEmpty changes
ServerTransform.log ['Subscription.changed', collectionName + ':' + id]
@meteorSub.changed collectionName, id, changes
@_updateDocHash collectionName, id, changes
removed: (collectionName, id) ->
ServerTransform.log ['Subscription.removed', collectionName + ':' + id.valueOf()]
@refCounter.decrement collectionName, id
_computeChanges: (collectionName, id, doc) ->
existingDoc = @docHash[@_buildHashKey(collectionName, id)]
return doc unless existingDoc
changes = {}
for i of doc when doc.hasOwnProperty(i) and !_.isEqual(doc[i], existingDoc[i])
changes[i] = doc[i]
return changes
_addDocHash: (collectionName, doc) ->
@docHash[@_buildHashKey(collectionName, doc._id)] = doc
_updateDocHash: (collectionName, id, changes) ->
key = @_buildHashKey(collectionName, id)
existingDoc = @docHash[key] or {}
@docHash[key] = _.extend(existingDoc, changes)
_isDocPublished: (collectionName, id) ->
key = @_buildHashKey(collectionName, id)
!!@docHash[key]
_hasDocChanged: (collectionName, id, doc) ->
existingDoc = @docHash[@_buildHashKey(collectionName, id)]
return true unless existingDoc
for i of doc
return true if doc.hasOwnProperty(i) and !_.isEqual(doc[i], existingDoc[i])
return false
_removeDocHash: (collectionName, id) ->
key = @_buildHashKey(collectionName, id)
delete @docHash[key]
_buildHashKey: (collectionName, id) ->
collectionName + '::' + id.valueOf()
| 166571 | class @DocumentRefCounter
constructor: (observer) ->
@heap = {}
@observer = observer
increment: (collectionName, docId) ->
key = <KEY>
if !@heap[key]
@heap[key] = 0
@heap[key]++
decrement: (collectionName, docId) ->
key = <KEY>
if @heap[key]
@heap[key]--
@observer.onChange collectionName, docId, @heap[key]
class @PublishHelper
constructor: (meteorSub) ->
@meteorSub = meteorSub
@docHash = {}
@refCounter = new DocumentRefCounter
onChange: (collectionName, docId, refCount) =>
ServerTransform.log ['Subscription.refCounter.onChange', collectionName + ':' + docId.valueOf() + ' ' + refCount]
return unless refCount <= 0
meteorSub.removed collectionName, docId
@_removeDocHash collectionName, docId
onStop: (callback) ->
@meteorSub.onStop callback
added: (collectionName, docId, doc) ->
@refCounter.increment collectionName, docId
return unless @_hasDocChanged(collectionName, docId, doc)
ServerTransform.log ['Subscription.added', collectionName + ':' + docId]
@meteorSub.added collectionName, docId, doc
@_addDocHash collectionName, _.clone doc
changed: (collectionName, id, doc) ->
return unless @_isDocPublished(collectionName, id)
changes = @_computeChanges collectionName, id, doc
return if _.isEmpty changes
ServerTransform.log ['Subscription.changed', collectionName + ':' + id]
@meteorSub.changed collectionName, id, changes
@_updateDocHash collectionName, id, changes
removed: (collectionName, id) ->
ServerTransform.log ['Subscription.removed', collectionName + ':' + id.valueOf()]
@refCounter.decrement collectionName, id
_computeChanges: (collectionName, id, doc) ->
existingDoc = @docHash[@_buildHashKey(collectionName, id)]
return doc unless existingDoc
changes = {}
for i of doc when doc.hasOwnProperty(i) and !_.isEqual(doc[i], existingDoc[i])
changes[i] = doc[i]
return changes
_addDocHash: (collectionName, doc) ->
@docHash[@_buildHashKey(collectionName, doc._id)] = doc
_updateDocHash: (collectionName, id, changes) ->
key = <KEY>(collection<KEY>, id)
existingDoc = @docHash[key] or {}
@docHash[key] = _.extend(existingDoc, changes)
_isDocPublished: (collectionName, id) ->
key = <KEY>)
!!@docHash[key]
_hasDocChanged: (collectionName, id, doc) ->
existingDoc = @docHash[@_buildHashKey(collectionName, id)]
return true unless existingDoc
for i of doc
return true if doc.hasOwnProperty(i) and !_.isEqual(doc[i], existingDoc[i])
return false
_removeDocHash: (collectionName, id) ->
key = <KEY>
delete @docHash[key]
_buildHashKey: (collectionName, id) ->
collectionName + '::' + id.valueOf()
| true | class @DocumentRefCounter
constructor: (observer) ->
@heap = {}
@observer = observer
increment: (collectionName, docId) ->
key = PI:KEY:<KEY>END_PI
if !@heap[key]
@heap[key] = 0
@heap[key]++
decrement: (collectionName, docId) ->
key = PI:KEY:<KEY>END_PI
if @heap[key]
@heap[key]--
@observer.onChange collectionName, docId, @heap[key]
class @PublishHelper
constructor: (meteorSub) ->
@meteorSub = meteorSub
@docHash = {}
@refCounter = new DocumentRefCounter
onChange: (collectionName, docId, refCount) =>
ServerTransform.log ['Subscription.refCounter.onChange', collectionName + ':' + docId.valueOf() + ' ' + refCount]
return unless refCount <= 0
meteorSub.removed collectionName, docId
@_removeDocHash collectionName, docId
onStop: (callback) ->
@meteorSub.onStop callback
added: (collectionName, docId, doc) ->
@refCounter.increment collectionName, docId
return unless @_hasDocChanged(collectionName, docId, doc)
ServerTransform.log ['Subscription.added', collectionName + ':' + docId]
@meteorSub.added collectionName, docId, doc
@_addDocHash collectionName, _.clone doc
changed: (collectionName, id, doc) ->
return unless @_isDocPublished(collectionName, id)
changes = @_computeChanges collectionName, id, doc
return if _.isEmpty changes
ServerTransform.log ['Subscription.changed', collectionName + ':' + id]
@meteorSub.changed collectionName, id, changes
@_updateDocHash collectionName, id, changes
removed: (collectionName, id) ->
ServerTransform.log ['Subscription.removed', collectionName + ':' + id.valueOf()]
@refCounter.decrement collectionName, id
_computeChanges: (collectionName, id, doc) ->
existingDoc = @docHash[@_buildHashKey(collectionName, id)]
return doc unless existingDoc
changes = {}
for i of doc when doc.hasOwnProperty(i) and !_.isEqual(doc[i], existingDoc[i])
changes[i] = doc[i]
return changes
_addDocHash: (collectionName, doc) ->
@docHash[@_buildHashKey(collectionName, doc._id)] = doc
_updateDocHash: (collectionName, id, changes) ->
key = PI:KEY:<KEY>END_PI(collectionPI:KEY:<KEY>END_PI, id)
existingDoc = @docHash[key] or {}
@docHash[key] = _.extend(existingDoc, changes)
_isDocPublished: (collectionName, id) ->
key = PI:KEY:<KEY>END_PI)
!!@docHash[key]
_hasDocChanged: (collectionName, id, doc) ->
existingDoc = @docHash[@_buildHashKey(collectionName, id)]
return true unless existingDoc
for i of doc
return true if doc.hasOwnProperty(i) and !_.isEqual(doc[i], existingDoc[i])
return false
_removeDocHash: (collectionName, id) ->
key = PI:KEY:<KEY>END_PI
delete @docHash[key]
_buildHashKey: (collectionName, id) ->
collectionName + '::' + id.valueOf()
|
[
{
"context": "#Language: German\n#Translators: softwarerero, robhunt3r\n\nde =\n\n#>add: \"add\"\n and: \"und\"\n#>bac",
"end": 44,
"score": 0.9993394613265991,
"start": 32,
"tag": "USERNAME",
"value": "softwarerero"
},
{
"context": "#Language: German\n#Translators: softwarerero, ro... | t9n/de.coffee | timbrandin/meteor-accounts-t9n | 0 | #Language: German
#Translators: softwarerero, robhunt3r
de =
#>add: "add"
and: "und"
#>back: "back"
#>changePassword: "Change Password"
#>choosePassword: "Choose a Password"
clickAgree: "Durch die Registrierung akzeptieren Sie unsere"
configure: "Konfigurieren"
createAccount: "Konto erzeugen"
#>currentPassword: "Current Password"
dontHaveAnAccount: "Noch kein Konto?"
email: "E-Mail"
emailAddress: "E-Mail Adresse"
emailResetLink: "Senden"
forgotPassword: "Passwort vergessen?"
ifYouAlreadyHaveAnAccount: "Falls Sie ein Konto haben, bitte hier"
#>newPassword: "New Password"
#>newPasswordAgain: "New Password (again)"
optional: "Optional"
OR: "ODER"
password: "Passwort"
#>passwordAgain: "Password (again)"
privacyPolicy: "Datenschutzerklärung"
#>remove: "remove"
resetYourPassword: "Passwort zurücksetzen"
#>setPassword: "Set Password"
sign: "Anmelden"
signIn: "Anmelden"
signin: "anmelden"
signOut: "Abmelden"
signUp: "Registrieren"
signupCode: "Registrierungscode"
signUpWithYourEmailAddress: "Mit E-Mail registrieren"
terms: "Geschäftsbedingungen"
updateYourPassword: "Passwort aktualisieren"
username: "Benutzername"
usernameOrEmail: "Benutzername oder E-Mail"
with: "mit"
#>info:
#> emailSent: "Email Sent"
#> emailVerified: "Email verified"
#> passwordChanged: "Password Changed"
#> passwordReset: "Password Reset"
error:
emailRequired: "E-Mail benötigt."
minChar: "Passwort muss mindesten 7 Zeichen lang sein."
#> pwdsDontMatch: "Passwords don't match"
pwOneDigit: "Passwort muss mindestens eine Ziffer enthalten."
pwOneLetter: "Passwort muss mindestens einen Buchstaben enthalten."
signInRequired: "Sie müssen sich anmelden."
signupCodeIncorrect: "Registrierungscode ungültig."
signupCodeRequired: "Registrierungscode benötigt."
usernameIsEmail: "Benutzername kann nicht eine E-Mail."
usernameRequired: "Benutzername benötigt."
accounts:
#---- accounts-base
#"@" + domain + " email required":
#"A login handler should return a result or undefined":
"Email already exists.": "Die Email gibt es schon."
"Email doesn't match the criteria.": "Emails stimmt nicht mit den Kriterien überein."
#> "Invalid login token":
#> "Login forbidden":
#"Service " + options.service + " already configured":
#> "Service unknown":
#> "Unrecognized options for login request":
"User validation failed": "Die Benutzerdaten scheinen nicht korrekt"
"Username already exists.": "Den Benutzer gibt es schon."
#> "You are not logged in.":
"You've been logged out by the server. Please log in again.": "Der Server hat Dich ausgeloggt. Bitte melde Dich erneut an."
"Your session has expired. Please log in again.": "Deine Sitzung ist abgelaufen. Bitte melde Dich erneut an."
#---- accounts-oauth
#> "No matching login attempt found":
#---- accounts-password-client
#> "Password is old. Please reset your password.":
#---- accounts-password
"Incorrect password": "Falschen Passwort"
#> "Invalid email":
"Must be logged in": "Da muss man sich aber erst anmelden"
"Need to set a username or email": "Benutzername oder Email sollte man schon angeben"
#> "old password format":
#> "Password may not be empty":
"Signups forbidden": "Anmeldungen sind verboten"
"Token expired": "Das Token ist abgelaufen"
"Token has invalid email address": "Für des Token stimmt die Email-Adresse nicht"
"User has no password set": "Kein Passwort für den Benutzer angegeben"
"User not found": "Benutzer nicht gefunden"
"Verify email link expired": "Token zur Verifizierung der Email ist abgelaufen"
"Verify email link is for unknown address": "Token zur Verifizierung der Email ist für eine unbekannte Adresse"
#---- match
#> "Match failed":
#---- Misc...
#> "Unknown error":
T9n.map "de", de | 203978 | #Language: German
#Translators: softwarerero, robhunt3r
de =
#>add: "add"
and: "und"
#>back: "back"
#>changePassword: "Change Password"
#>choosePassword: "Choose a Password"
clickAgree: "Durch die Registrierung akzeptieren Sie unsere"
configure: "Konfigurieren"
createAccount: "Konto erzeugen"
#>currentPassword: "<PASSWORD>"
dontHaveAnAccount: "Noch kein Konto?"
email: "E-Mail"
emailAddress: "E-Mail Adresse"
emailResetLink: "Senden"
forgotPassword: "<PASSWORD>?"
ifYouAlreadyHaveAnAccount: "Falls Sie ein Konto haben, bitte hier"
#>newPassword: "<PASSWORD>"
#>newPasswordAgain: "New Password (again)"
optional: "Optional"
OR: "ODER"
password: "<PASSWORD>"
#>passwordAgain: "Password (again)"
privacyPolicy: "Datenschutzerklärung"
#>remove: "remove"
resetYourPassword: "<PASSWORD>"
#>setPassword: "<PASSWORD>"
sign: "Anmelden"
signIn: "Anmelden"
signin: "anmelden"
signOut: "Abmelden"
signUp: "Registrieren"
signupCode: "Registrierungscode"
signUpWithYourEmailAddress: "Mit E-Mail registrieren"
terms: "Geschäftsbedingungen"
updateYourPassword: "<PASSWORD>"
username: "Benutzername"
usernameOrEmail: "Benutzername oder E-Mail"
with: "mit"
#>info:
#> emailSent: "Email Sent"
#> emailVerified: "Email verified"
#> passwordChanged: "<PASSWORD>"
#> passwordReset: "<PASSWORD>"
error:
emailRequired: "E-Mail benötigt."
minChar: "Passwort muss mindesten 7 Zeichen lang sein."
#> pwdsDontMatch: "Passwords don't match"
pwOneDigit: "Passwort muss mindestens eine Ziffer enthalten."
pwOneLetter: "Passwort muss mindestens einen Buchstaben enthalten."
signInRequired: "Sie müssen sich anmelden."
signupCodeIncorrect: "Registrierungscode ungültig."
signupCodeRequired: "Registrierungscode benötigt."
usernameIsEmail: "<NAME> kann nicht eine E-Mail."
usernameRequired: "<NAME> benötigt."
accounts:
#---- accounts-base
#"@" + domain + " email required":
#"A login handler should return a result or undefined":
"Email already exists.": "Die Email gibt es schon."
"Email doesn't match the criteria.": "Emails stimmt nicht mit den Kriterien überein."
#> "Invalid login token":
#> "Login forbidden":
#"Service " + options.service + " already configured":
#> "Service unknown":
#> "Unrecognized options for login request":
"User validation failed": "Die Benutzerdaten scheinen nicht korrekt"
"Username already exists.": "Den Benutzer gibt es schon."
#> "You are not logged in.":
"You've been logged out by the server. Please log in again.": "Der Server hat Dich ausgeloggt. Bitte melde Dich erneut an."
"Your session has expired. Please log in again.": "Deine Sitzung ist abgelaufen. Bitte melde Dich erneut an."
#---- accounts-oauth
#> "No matching login attempt found":
#---- accounts-password-client
#> "Password is old. Please reset your password.":
#---- accounts-password
"Incorrect password": "<PASSWORD>"
#> "Invalid email":
"Must be logged in": "Da muss man sich aber erst anmelden"
"Need to set a username or email": "Benutzername oder Email sollte man schon angeben"
#> "old password format":
#> "Password may not be empty":
"Signups forbidden": "Anmeldungen sind verboten"
"Token expired": "Das Token ist abgelaufen"
"Token has invalid email address": "Für des Token stimmt die Email-Adresse nicht"
"User has no password set": "Kein Passwort für den Benutzer angegeben"
"User not found": "Benutzer nicht gefunden"
"Verify email link expired": "Token zur Verifizierung der Email ist abgelaufen"
"Verify email link is for unknown address": "Token zur Verifizierung der Email ist für eine unbekannte Adresse"
#---- match
#> "Match failed":
#---- Misc...
#> "Unknown error":
T9n.map "de", de | true | #Language: German
#Translators: softwarerero, robhunt3r
de =
#>add: "add"
and: "und"
#>back: "back"
#>changePassword: "Change Password"
#>choosePassword: "Choose a Password"
clickAgree: "Durch die Registrierung akzeptieren Sie unsere"
configure: "Konfigurieren"
createAccount: "Konto erzeugen"
#>currentPassword: "PI:PASSWORD:<PASSWORD>END_PI"
dontHaveAnAccount: "Noch kein Konto?"
email: "E-Mail"
emailAddress: "E-Mail Adresse"
emailResetLink: "Senden"
forgotPassword: "PI:PASSWORD:<PASSWORD>END_PI?"
ifYouAlreadyHaveAnAccount: "Falls Sie ein Konto haben, bitte hier"
#>newPassword: "PI:PASSWORD:<PASSWORD>END_PI"
#>newPasswordAgain: "New Password (again)"
optional: "Optional"
OR: "ODER"
password: "PI:PASSWORD:<PASSWORD>END_PI"
#>passwordAgain: "Password (again)"
privacyPolicy: "Datenschutzerklärung"
#>remove: "remove"
resetYourPassword: "PI:PASSWORD:<PASSWORD>END_PI"
#>setPassword: "PI:PASSWORD:<PASSWORD>END_PI"
sign: "Anmelden"
signIn: "Anmelden"
signin: "anmelden"
signOut: "Abmelden"
signUp: "Registrieren"
signupCode: "Registrierungscode"
signUpWithYourEmailAddress: "Mit E-Mail registrieren"
terms: "Geschäftsbedingungen"
updateYourPassword: "PI:PASSWORD:<PASSWORD>END_PI"
username: "Benutzername"
usernameOrEmail: "Benutzername oder E-Mail"
with: "mit"
#>info:
#> emailSent: "Email Sent"
#> emailVerified: "Email verified"
#> passwordChanged: "PI:PASSWORD:<PASSWORD>END_PI"
#> passwordReset: "PI:PASSWORD:<PASSWORD>END_PI"
error:
emailRequired: "E-Mail benötigt."
minChar: "Passwort muss mindesten 7 Zeichen lang sein."
#> pwdsDontMatch: "Passwords don't match"
pwOneDigit: "Passwort muss mindestens eine Ziffer enthalten."
pwOneLetter: "Passwort muss mindestens einen Buchstaben enthalten."
signInRequired: "Sie müssen sich anmelden."
signupCodeIncorrect: "Registrierungscode ungültig."
signupCodeRequired: "Registrierungscode benötigt."
usernameIsEmail: "PI:NAME:<NAME>END_PI kann nicht eine E-Mail."
usernameRequired: "PI:NAME:<NAME>END_PI benötigt."
accounts:
#---- accounts-base
#"@" + domain + " email required":
#"A login handler should return a result or undefined":
"Email already exists.": "Die Email gibt es schon."
"Email doesn't match the criteria.": "Emails stimmt nicht mit den Kriterien überein."
#> "Invalid login token":
#> "Login forbidden":
#"Service " + options.service + " already configured":
#> "Service unknown":
#> "Unrecognized options for login request":
"User validation failed": "Die Benutzerdaten scheinen nicht korrekt"
"Username already exists.": "Den Benutzer gibt es schon."
#> "You are not logged in.":
"You've been logged out by the server. Please log in again.": "Der Server hat Dich ausgeloggt. Bitte melde Dich erneut an."
"Your session has expired. Please log in again.": "Deine Sitzung ist abgelaufen. Bitte melde Dich erneut an."
#---- accounts-oauth
#> "No matching login attempt found":
#---- accounts-password-client
#> "Password is old. Please reset your password.":
#---- accounts-password
"Incorrect password": "PI:PASSWORD:<PASSWORD>END_PI"
#> "Invalid email":
"Must be logged in": "Da muss man sich aber erst anmelden"
"Need to set a username or email": "Benutzername oder Email sollte man schon angeben"
#> "old password format":
#> "Password may not be empty":
"Signups forbidden": "Anmeldungen sind verboten"
"Token expired": "Das Token ist abgelaufen"
"Token has invalid email address": "Für des Token stimmt die Email-Adresse nicht"
"User has no password set": "Kein Passwort für den Benutzer angegeben"
"User not found": "Benutzer nicht gefunden"
"Verify email link expired": "Token zur Verifizierung der Email ist abgelaufen"
"Verify email link is for unknown address": "Token zur Verifizierung der Email ist für eine unbekannte Adresse"
#---- match
#> "Match failed":
#---- Misc...
#> "Unknown error":
T9n.map "de", de |
[
{
"context": "\n random_bytes: 32\n crypto_box_keypair: 32\n crypto_box_random_nonce: 24\n crypto_s",
"end": 442,
"score": 0.49097755551338196,
"start": 441,
"tag": "KEY",
"value": "3"
}
] | src/js_nacl_worker_driver.coffee | vault12/glow | 14 | # Copyright (c) 2015 Vault12, Inc.
# MIT License https://opensource.org/licenses/MIT
Utils = require 'utils'
# Nacl driver for the js-nacl emscripten implementation run in a Web Worker
class JsNaclWebWorkerDriver
constructor: (
worker_path = './build/js_nacl_worker.js',
js_nacl_path = '../node_modules/js-nacl/lib/nacl_factory.js',
heap_size = 2 ** 26 )->
random_reqs =
random_bytes: 32
crypto_box_keypair: 32
crypto_box_random_nonce: 24
crypto_secretbox_random_nonce: 24
hasCrypto = false
api = []
queues = {}
worker = new Worker(worker_path)
@.crypto_secretbox_KEYBYTES = 32 # TODO: get from js_nacl
require('nacl').API.forEach (f)=>
queue = []
queues[f] = queue
api.push(f)
@[f] = ->
p = Utils.promise (res, rej)->
queue.push
resolve: res
reject: rej
args = Array.prototype.slice.call(arguments)
refs = []
# args.forEach (arg)->
# refs.push(arg.buffer) if arg instanceof Uint8Array
rnd = null
if !hasCrypto
n = random_reqs[f]
if n
rnd = new Uint8Array(32) # always use 32 otherwise stress tests fail
crypto.getRandomValues(rnd)
worker.postMessage({ cmd: f, args: args, rnd: rnd }, refs)
p
onmessage2 = (e)->
queue = queues[e.data.cmd]
if e.data.error
queue.shift().reject(new Error(e.data.message))
else
queue.shift().resolve(e.data.res)
worker.onmessage = (e)->
throw new Error() unless e.data.cmd == 'init'
hasCrypto = e.data.hasCrypto
console.log('js nacl web worker initialized; hasCrypto: ' + hasCrypto)
worker.onmessage = onmessage2
worker.postMessage
cmd: 'init'
naclPath: js_nacl_path
heapSize: heap_size
api: api
module.exports = JsNaclWebWorkerDriver
window.JsNaclDriver = JsNaclWebWorkerDriver if window.__CRYPTO_DEBUG
| 121053 | # Copyright (c) 2015 Vault12, Inc.
# MIT License https://opensource.org/licenses/MIT
Utils = require 'utils'
# Nacl driver for the js-nacl emscripten implementation run in a Web Worker
class JsNaclWebWorkerDriver
constructor: (
worker_path = './build/js_nacl_worker.js',
js_nacl_path = '../node_modules/js-nacl/lib/nacl_factory.js',
heap_size = 2 ** 26 )->
random_reqs =
random_bytes: 32
crypto_box_keypair: <KEY>2
crypto_box_random_nonce: 24
crypto_secretbox_random_nonce: 24
hasCrypto = false
api = []
queues = {}
worker = new Worker(worker_path)
@.crypto_secretbox_KEYBYTES = 32 # TODO: get from js_nacl
require('nacl').API.forEach (f)=>
queue = []
queues[f] = queue
api.push(f)
@[f] = ->
p = Utils.promise (res, rej)->
queue.push
resolve: res
reject: rej
args = Array.prototype.slice.call(arguments)
refs = []
# args.forEach (arg)->
# refs.push(arg.buffer) if arg instanceof Uint8Array
rnd = null
if !hasCrypto
n = random_reqs[f]
if n
rnd = new Uint8Array(32) # always use 32 otherwise stress tests fail
crypto.getRandomValues(rnd)
worker.postMessage({ cmd: f, args: args, rnd: rnd }, refs)
p
onmessage2 = (e)->
queue = queues[e.data.cmd]
if e.data.error
queue.shift().reject(new Error(e.data.message))
else
queue.shift().resolve(e.data.res)
worker.onmessage = (e)->
throw new Error() unless e.data.cmd == 'init'
hasCrypto = e.data.hasCrypto
console.log('js nacl web worker initialized; hasCrypto: ' + hasCrypto)
worker.onmessage = onmessage2
worker.postMessage
cmd: 'init'
naclPath: js_nacl_path
heapSize: heap_size
api: api
module.exports = JsNaclWebWorkerDriver
window.JsNaclDriver = JsNaclWebWorkerDriver if window.__CRYPTO_DEBUG
| true | # Copyright (c) 2015 Vault12, Inc.
# MIT License https://opensource.org/licenses/MIT
Utils = require 'utils'
# Nacl driver for the js-nacl emscripten implementation run in a Web Worker
class JsNaclWebWorkerDriver
constructor: (
worker_path = './build/js_nacl_worker.js',
js_nacl_path = '../node_modules/js-nacl/lib/nacl_factory.js',
heap_size = 2 ** 26 )->
random_reqs =
random_bytes: 32
crypto_box_keypair: PI:KEY:<KEY>END_PI2
crypto_box_random_nonce: 24
crypto_secretbox_random_nonce: 24
hasCrypto = false
api = []
queues = {}
worker = new Worker(worker_path)
@.crypto_secretbox_KEYBYTES = 32 # TODO: get from js_nacl
require('nacl').API.forEach (f)=>
queue = []
queues[f] = queue
api.push(f)
@[f] = ->
p = Utils.promise (res, rej)->
queue.push
resolve: res
reject: rej
args = Array.prototype.slice.call(arguments)
refs = []
# args.forEach (arg)->
# refs.push(arg.buffer) if arg instanceof Uint8Array
rnd = null
if !hasCrypto
n = random_reqs[f]
if n
rnd = new Uint8Array(32) # always use 32 otherwise stress tests fail
crypto.getRandomValues(rnd)
worker.postMessage({ cmd: f, args: args, rnd: rnd }, refs)
p
onmessage2 = (e)->
queue = queues[e.data.cmd]
if e.data.error
queue.shift().reject(new Error(e.data.message))
else
queue.shift().resolve(e.data.res)
worker.onmessage = (e)->
throw new Error() unless e.data.cmd == 'init'
hasCrypto = e.data.hasCrypto
console.log('js nacl web worker initialized; hasCrypto: ' + hasCrypto)
worker.onmessage = onmessage2
worker.postMessage
cmd: 'init'
naclPath: js_nacl_path
heapSize: heap_size
api: api
module.exports = JsNaclWebWorkerDriver
window.JsNaclDriver = JsNaclWebWorkerDriver if window.__CRYPTO_DEBUG
|
[
{
"context": "r this song\n#\n# Example: lyrics for purple haze by jimi hendrix\nmodule.exports = (robot) ->\n robot.respond /lyri",
"end": 212,
"score": 0.9987391233444214,
"start": 200,
"tag": "NAME",
"value": "jimi hendrix"
}
] | src/scripts/lyrics.coffee | mcollina/hubot-scripts | 1 | # Grabs snippets of song lyrics.
# Limited to snippets due to copyright stuff.
#
# hubot lyrics for <song> by <artist> - returns snippet of lyrics for this song
#
# Example: lyrics for purple haze by jimi hendrix
module.exports = (robot) ->
robot.respond /lyrics for (.*) by (.*)/i, (msg) ->
song = msg.match[1]
artist = msg.match[2]
getLyrics msg, song, artist
getLyrics = (msg, song, artist) ->
msg.http("http://lyrics.wikia.com/api.php")
.query(artist: artist, song: song, fmt: "json")
.get() (err, res, body) ->
result = eval body # can't use JSON.parse :(
msg.send result['url']
msg.send result['lyrics']
| 187204 | # Grabs snippets of song lyrics.
# Limited to snippets due to copyright stuff.
#
# hubot lyrics for <song> by <artist> - returns snippet of lyrics for this song
#
# Example: lyrics for purple haze by <NAME>
module.exports = (robot) ->
robot.respond /lyrics for (.*) by (.*)/i, (msg) ->
song = msg.match[1]
artist = msg.match[2]
getLyrics msg, song, artist
getLyrics = (msg, song, artist) ->
msg.http("http://lyrics.wikia.com/api.php")
.query(artist: artist, song: song, fmt: "json")
.get() (err, res, body) ->
result = eval body # can't use JSON.parse :(
msg.send result['url']
msg.send result['lyrics']
| true | # Grabs snippets of song lyrics.
# Limited to snippets due to copyright stuff.
#
# hubot lyrics for <song> by <artist> - returns snippet of lyrics for this song
#
# Example: lyrics for purple haze by PI:NAME:<NAME>END_PI
module.exports = (robot) ->
robot.respond /lyrics for (.*) by (.*)/i, (msg) ->
song = msg.match[1]
artist = msg.match[2]
getLyrics msg, song, artist
getLyrics = (msg, song, artist) ->
msg.http("http://lyrics.wikia.com/api.php")
.query(artist: artist, song: song, fmt: "json")
.get() (err, res, body) ->
result = eval body # can't use JSON.parse :(
msg.send result['url']
msg.send result['lyrics']
|
[
{
"context": "Quien',\n field: 'quien'\n },{\n name: 'Cuantos',\n field: 'cuantos'\n },{\n name: 'Ley",
"end": 352,
"score": 0.9171228408813477,
"start": 345,
"tag": "NAME",
"value": "Cuantos"
},
{
"context": "n'\n },{\n name: 'Cuantos',\n field... | frontend/app/js/controllers/batches_index_controller.coffee | degzcs/rails-angular-lineman-example | 0 | angular.module('app').controller 'BatchesIndexCtrl', ($scope, InventoryService) ->
$scope.toggleSearch = false
$scope.headers = [
{
name:'',
field:'thumbs'
},{
name: 'Fecha',
field: 'date'
},{
name:'Hora',
field: 'hour'
},{
name: 'Quien',
field: 'quien'
},{
name: 'Cuantos',
field: 'cuantos'
},{
name: 'Ley',
field: 'law'
},{
name: 'Valor',
field: 'value'
}
]
# get the list value from server response ans setup the list
InventoryService.query ((res) ->
$scope.list = res.list
$scope.count = res.list.length
), (error) ->
# Error handler code
$scope.custom = {date: 'bold', hour:'grey', quien: 'grey', cuantos: 'grey', law:'grey', value: 'grey'}
$scope.sortable = ['date', 'hour', 'quien', 'cuantos', 'law', 'value']
$scope.thumbs = 'thumb';
#$scope.count= $scope.list.length;
# define scope values
$scope.selectall = false
$scope.grams ={value: 0}
#
# Functions
#
# show detail of the inventory item
# @params item [Object]
$scope.show = (item) ->
console.log 'selecciona item' + item.selected
InventoryServic.setItem(item); | 19172 | angular.module('app').controller 'BatchesIndexCtrl', ($scope, InventoryService) ->
$scope.toggleSearch = false
$scope.headers = [
{
name:'',
field:'thumbs'
},{
name: 'Fecha',
field: 'date'
},{
name:'Hora',
field: 'hour'
},{
name: 'Quien',
field: 'quien'
},{
name: '<NAME>',
field: 'cu<NAME>tos'
},{
name: 'L<NAME>',
field: 'law'
},{
name: 'Valor',
field: 'value'
}
]
# get the list value from server response ans setup the list
InventoryService.query ((res) ->
$scope.list = res.list
$scope.count = res.list.length
), (error) ->
# Error handler code
$scope.custom = {date: 'bold', hour:'grey', quien: 'grey', cuantos: 'grey', law:'grey', value: 'grey'}
$scope.sortable = ['date', 'hour', 'quien', 'cuantos', 'law', 'value']
$scope.thumbs = 'thumb';
#$scope.count= $scope.list.length;
# define scope values
$scope.selectall = false
$scope.grams ={value: 0}
#
# Functions
#
# show detail of the inventory item
# @params item [Object]
$scope.show = (item) ->
console.log 'selecciona item' + item.selected
InventoryServic.setItem(item); | true | angular.module('app').controller 'BatchesIndexCtrl', ($scope, InventoryService) ->
$scope.toggleSearch = false
$scope.headers = [
{
name:'',
field:'thumbs'
},{
name: 'Fecha',
field: 'date'
},{
name:'Hora',
field: 'hour'
},{
name: 'Quien',
field: 'quien'
},{
name: 'PI:NAME:<NAME>END_PI',
field: 'cuPI:NAME:<NAME>END_PItos'
},{
name: 'LPI:NAME:<NAME>END_PI',
field: 'law'
},{
name: 'Valor',
field: 'value'
}
]
# get the list value from server response ans setup the list
InventoryService.query ((res) ->
$scope.list = res.list
$scope.count = res.list.length
), (error) ->
# Error handler code
$scope.custom = {date: 'bold', hour:'grey', quien: 'grey', cuantos: 'grey', law:'grey', value: 'grey'}
$scope.sortable = ['date', 'hour', 'quien', 'cuantos', 'law', 'value']
$scope.thumbs = 'thumb';
#$scope.count= $scope.list.length;
# define scope values
$scope.selectall = false
$scope.grams ={value: 0}
#
# Functions
#
# show detail of the inventory item
# @params item [Object]
$scope.show = (item) ->
console.log 'selecciona item' + item.selected
InventoryServic.setItem(item); |
[
{
"context": "alidate (v) ->\n @platform =\n if inNetwork v, '127.0.0.1/24'\n 'localdomain'\n else if inNetwork v, ",
"end": 491,
"score": 0.9997166395187378,
"start": 482,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
},
{
"context": "24'\n 'localdomain'\n else if in... | models/deploy.coffee | sabman/website | 0 | mongoose = require 'mongoose'
ObjectId = mongoose.Schema.ObjectId
DeploySchema = module.exports = new mongoose.Schema
teamId:
type: ObjectId
index: true
required: true
hostname: String
os: String
remoteAddress: String
platform: String
# associations
DeploySchema.method 'team', (callback) ->
Team = mongoose.model 'Team'
Team.findById @teamId, callback
# validations
DeploySchema.path('remoteAddress').validate (v) ->
@platform =
if inNetwork v, '127.0.0.1/24'
'localdomain'
else if inNetwork v, '72.2.126.0/23'
'joyent'
else if inNetwork v, """
50.18.0.0/16 184.72.0.0/18 204.236.128.0/18
107.20.0.0/15 50.19.0.0/16 50.16.0.0/15
184.72.64.0/18 184.72.128.0/17 184.73.0.0/16
204.236.192.0/18 174.129.0.0/16 75.101.128.0/17
67.202.0.0/18 72.44.32.0/19 216.182.224.0/20
"""
'heroku'
else if inNetwork v, '96.126.12.0/24', '74.207.251.0/24'
'linode'
@platform?
, 'not production'
# callbacks
DeploySchema.post 'save', ->
@team (err, team) =>
throw err if err
team.lastDeploy = @toObject()
team.save()
Deploy = mongoose.model 'Deploy', DeploySchema
toBytes = (ip) ->
[ a, b, c, d ] = ip.split '.'
(a << 24 | b << 16 | c << 8 | d)
inNetwork = (ip, networks) ->
for network in networks.split(/\s+/)
[ network, netmask ] = network.split '/'
netmask = 0x100000000 - (1 << 32 - netmask)
return true if (toBytes(ip) & netmask) == (toBytes(network) & netmask)
false
| 18981 | mongoose = require 'mongoose'
ObjectId = mongoose.Schema.ObjectId
DeploySchema = module.exports = new mongoose.Schema
teamId:
type: ObjectId
index: true
required: true
hostname: String
os: String
remoteAddress: String
platform: String
# associations
DeploySchema.method 'team', (callback) ->
Team = mongoose.model 'Team'
Team.findById @teamId, callback
# validations
DeploySchema.path('remoteAddress').validate (v) ->
@platform =
if inNetwork v, '127.0.0.1/24'
'localdomain'
else if inNetwork v, '192.168.3.11/23'
'joyent'
else if inNetwork v, """
172.16.31.10/16 172.16.17.32/18 172.16.58.3/18
192.168.3.11/15 172.16.17.32/16 172.16.58.3/15
192.168.3.11/18 172.16.31.10/17 192.168.3.11/16
172.16.31.10/18 192.168.127.12/16 172.16.17.32/17
192.168.3.11/18 172.16.31.10/19 172.16.58.3/20
"""
'heroku'
else if inNetwork v, '192.168.127.12/24', '172.16.31.10/24'
'linode'
@platform?
, 'not production'
# callbacks
DeploySchema.post 'save', ->
@team (err, team) =>
throw err if err
team.lastDeploy = @toObject()
team.save()
Deploy = mongoose.model 'Deploy', DeploySchema
toBytes = (ip) ->
[ a, b, c, d ] = ip.split '.'
(a << 24 | b << 16 | c << 8 | d)
inNetwork = (ip, networks) ->
for network in networks.split(/\s+/)
[ network, netmask ] = network.split '/'
netmask = 0x100000000 - (1 << 32 - netmask)
return true if (toBytes(ip) & netmask) == (toBytes(network) & netmask)
false
| true | mongoose = require 'mongoose'
ObjectId = mongoose.Schema.ObjectId
DeploySchema = module.exports = new mongoose.Schema
teamId:
type: ObjectId
index: true
required: true
hostname: String
os: String
remoteAddress: String
platform: String
# associations
DeploySchema.method 'team', (callback) ->
Team = mongoose.model 'Team'
Team.findById @teamId, callback
# validations
DeploySchema.path('remoteAddress').validate (v) ->
@platform =
if inNetwork v, '127.0.0.1/24'
'localdomain'
else if inNetwork v, 'PI:IP_ADDRESS:192.168.3.11END_PI/23'
'joyent'
else if inNetwork v, """
PI:IP_ADDRESS:172.16.31.10END_PI/16 PI:IP_ADDRESS:172.16.17.32END_PI/18 PI:IP_ADDRESS:172.16.58.3END_PI/18
PI:IP_ADDRESS:192.168.3.11END_PI/15 PI:IP_ADDRESS:172.16.17.32END_PI/16 PI:IP_ADDRESS:172.16.58.3END_PI/15
PI:IP_ADDRESS:192.168.3.11END_PI/18 PI:IP_ADDRESS:172.16.31.10END_PI/17 PI:IP_ADDRESS:192.168.3.11END_PI/16
PI:IP_ADDRESS:172.16.31.10END_PI/18 PI:IP_ADDRESS:192.168.127.12END_PI/16 PI:IP_ADDRESS:172.16.17.32END_PI/17
PI:IP_ADDRESS:192.168.3.11END_PI/18 PI:IP_ADDRESS:172.16.31.10END_PI/19 PI:IP_ADDRESS:172.16.58.3END_PI/20
"""
'heroku'
else if inNetwork v, 'PI:IP_ADDRESS:192.168.127.12END_PI/24', 'PI:IP_ADDRESS:172.16.31.10END_PI/24'
'linode'
@platform?
, 'not production'
# callbacks
DeploySchema.post 'save', ->
@team (err, team) =>
throw err if err
team.lastDeploy = @toObject()
team.save()
Deploy = mongoose.model 'Deploy', DeploySchema
toBytes = (ip) ->
[ a, b, c, d ] = ip.split '.'
(a << 24 | b << 16 | c << 8 | d)
inNetwork = (ip, networks) ->
for network in networks.split(/\s+/)
[ network, netmask ] = network.split '/'
netmask = 0x100000000 - (1 << 32 - netmask)
return true if (toBytes(ip) & netmask) == (toBytes(network) & netmask)
false
|
[
{
"context": "ndieLinter = linter.indieLinter.register({name: 'Wow'})\n indieLinter.setMessages([{type: 'Error', t",
"end": 448,
"score": 0.9183880090713501,
"start": 446,
"tag": "NAME",
"value": "ow"
}
] | atom/packages/linter/spec/linter-indie-api.coffee | JoshAddington/dotfiles | 0 | describe 'Linter Indie API', ->
linter = null
{wait} = require('./common')
Remote = require('remote')
beforeEach ->
global.setTimeout = Remote.getGlobal('setTimeout')
global.setInterval = Remote.getGlobal('setInterval')
waitsForPromise ->
atom.packages.activate('linter').then ->
linter = atom.packages.getActivePackage(linter)
describe 'it works', ->
indieLinter = linter.indieLinter.register({name: 'Wow'})
indieLinter.setMessages([{type: 'Error', text: 'Hey!'}])
waitsForPromise ->
wait(100).then ->
expect(linter.messages.publicMessages.length).toBe(1)
indieLinter.deleteMessages()
wait(100)
.then ->
expect(linter.messages.publicMessages.length).toBe(0)
| 109626 | describe 'Linter Indie API', ->
linter = null
{wait} = require('./common')
Remote = require('remote')
beforeEach ->
global.setTimeout = Remote.getGlobal('setTimeout')
global.setInterval = Remote.getGlobal('setInterval')
waitsForPromise ->
atom.packages.activate('linter').then ->
linter = atom.packages.getActivePackage(linter)
describe 'it works', ->
indieLinter = linter.indieLinter.register({name: 'W<NAME>'})
indieLinter.setMessages([{type: 'Error', text: 'Hey!'}])
waitsForPromise ->
wait(100).then ->
expect(linter.messages.publicMessages.length).toBe(1)
indieLinter.deleteMessages()
wait(100)
.then ->
expect(linter.messages.publicMessages.length).toBe(0)
| true | describe 'Linter Indie API', ->
linter = null
{wait} = require('./common')
Remote = require('remote')
beforeEach ->
global.setTimeout = Remote.getGlobal('setTimeout')
global.setInterval = Remote.getGlobal('setInterval')
waitsForPromise ->
atom.packages.activate('linter').then ->
linter = atom.packages.getActivePackage(linter)
describe 'it works', ->
indieLinter = linter.indieLinter.register({name: 'WPI:NAME:<NAME>END_PI'})
indieLinter.setMessages([{type: 'Error', text: 'Hey!'}])
waitsForPromise ->
wait(100).then ->
expect(linter.messages.publicMessages.length).toBe(1)
indieLinter.deleteMessages()
wait(100)
.then ->
expect(linter.messages.publicMessages.length).toBe(0)
|
[
{
"context": "stringify(require('./replies/current-0.json'))\n\t\t@current0 = JSON.parse(current0str)\n\n\tcontext 'mock beerbod",
"end": 800,
"score": 0.8212924003601074,
"start": 792,
"tag": "USERNAME",
"value": "current0"
},
{
"context": "m\")\n\t\t\t\t.get(\"/v1/current/0.json\")... | test/hubot-beerbods-unit.coffee | andersonshatch/hubot-beerbods | 0 | Helper = require 'hubot-test-helper'
expect = require('chai').expect
nock = require 'nock'
helper = new Helper('../src')
beforeEach ->
global.room = helper.createRoom(httpd: false)
do nock.disableNetConnect
afterEach ->
global.nockscope.done()
configureRoomForSlack = ->
global.room.robot.adapterName = 'slack'
global.room.robot.slackMessages = []
global.room.robot.on 'slack-attachment', (data) ->
data.message.robot.slackMessages.push data
describe 'hubot-beerbods-slack-unit', ->
beforeEach ->
do configureRoomForSlack
#nasty hack to allow modifying the @attachment and current-0 in individual tests
str = JSON.stringify(require('./expected/slack-attachment.json'))
@attachment = JSON.parse(str)
current0str = JSON.stringify(require('./replies/current-0.json'))
@current0 = JSON.parse(current0str)
context 'mock beerbods api returns beer and untappd data', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, @current0)
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['josh', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
#Slack message will be emitted as a slack-attachment for the v3.x adapter, as a message object for v4.x
#... check that they are both the same as we expect
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns an error', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithError("intentional mock request fail")
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'replies with an apology via normal message', ->
expect(global.room.messages).to.eql [
['josh', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
expect(global.room.robot.slackMessages).to.have.length 0
context 'mock beerbods api returns a non 200 status', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(404, '', [])
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'replies with an apology via normal message', ->
expect(global.room.messages).to.eql [
['josh', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
expect(global.room.robot.slackMessages).to.have.length 0
context 'mock beerbods api returns beer and untappd data without rating', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.rating
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['josh', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
expect(message.attachments).to.eql(require './expected/slack-attachment-no-rating-or-abv.json')
context 'mock beerbods api returns beer and untappd data without abv', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.abv
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['josh', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
@attachment[0].fields = [@attachment[0].fields[0], @attachment[0].fields[2]]
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns beer and untappd data without description', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.description
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['josh', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
@attachment[0].fields = [@attachment[0].fields[0], @attachment[0].fields[1]]
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns beer and untappd data, slack custom identity disabled', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithFile(200, __dirname + '/replies/current-0.json')
process.env.HUBOT_DISABLE_BEERBODS_CUSTOM_IDENTITY = 'true'
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as hubot', ->
expect(global.room.messages[0]).to.eql ['josh', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.be.undefined
expect(message.icon_url).to.be.undefined
expect(message.attachments).to.eql @attachment
describe 'hubot-beerbods-unit', ->
context 'mock beerbods api returns page with expected layout', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.times(8)
.replyWithFile(200, __dirname + '/replies/current-0.json')
global.room.user.say 'josh', 'hubot beerbods'
global.room.user.say 'josh', 'hubot whats this weeks beerbods '
global.room.user.say 'josh', 'hubot whats this weeks beerbods?'
global.room.user.say 'josh', 'hubot what\'s this weeks beerbods'
global.room.user.say 'josh', 'hubot what\'s this weeks beerbods?'
global.room.user.say 'josh', 'hubot what\'s this week\'s beerbods'
global.room.user.say 'josh', 'hubot what\'s this week\'s beerbods?'
global.room.user.say 'josh', 'hubot what’s this week’s beerbods?'
setTimeout done, 50
response = ['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
it 'responds to hubot beerbods', ->
expect(global.room.messages).to.eql [
['josh', 'hubot beerbods']
['josh', 'hubot whats this weeks beerbods ']
['josh', 'hubot whats this weeks beerbods?']
['josh', 'hubot what\'s this weeks beerbods']
['josh', 'hubot what\'s this weeks beerbods?']
['josh', 'hubot what\'s this week\'s beerbods']
['josh', 'hubot what\'s this week\'s beerbods?']
['josh', 'hubot what’s this week’s beerbods?']
response
response
response
response
response
response
response
response
]
context 'mock beerbods api returns no body for previous', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/previous/0.json").reply(200)
.get("/v1/previous/1.json").reply(200)
.get("/v1/previous/2.json").reply(200)
.get("/v1/previous/3.json").reply(200)
global.room.user.say 'josh', 'hubot what was last week\'s beerbods?'
global.room.user.say 'josh', 'hubot beerbods -2'
global.room.user.say 'josh', 'hubot beerbods -3'
global.room.user.say 'josh', 'hubot beerbods -4'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['josh', 'hubot what was last week\'s beerbods?']
['josh', 'hubot beerbods -2']
['josh', 'hubot beerbods -3']
['josh', 'hubot beerbods -4']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
context 'mock beerbods api valid for next weeks beer', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/1.json")
.replyWithFile(200, __dirname + '/replies/current-1.json')
global.room.user.say 'josh', 'hubot what\'s next week\'s beerbods?'
setTimeout done, 50
it 'responds with next weeks beer', ->
expect(global.room.messages).to.eql [
['josh', 'hubot what\'s next week\'s beerbods?']
['hubot', 'Next week\'s test beer shall be Dalrympley, Hikin - https://beerbods.co.uk/this-weeks-beer/dalrymple-hikin']
]
context 'mock beerbods api valid for last weeks beer', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/previous/0.json")
.times(3)
.replyWithFile(200, __dirname + '/replies/current-0.json')
global.room.user.say 'josh', 'hubot what\'s last week\'s beerbods?'
global.room.user.say 'josh', 'hubot beerbods -1'
global.room.user.say 'josh', 'hubot beerbods prev'
setTimeout done, 50
it 'responds with last weeks beer', ->
expect(global.room.messages).to.eql [
['josh', 'hubot what\'s last week\'s beerbods?']
['josh', 'hubot beerbods -1']
['josh', 'hubot beerbods prev']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
]
context 'mock beerbods api unavailable', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithError('intentional mock request fail')
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['josh', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
context 'mock beerbods api 404', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(404)
global.room.user.say 'josh', 'hubot beerbods'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['josh', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
| 83719 | Helper = require 'hubot-test-helper'
expect = require('chai').expect
nock = require 'nock'
helper = new Helper('../src')
beforeEach ->
global.room = helper.createRoom(httpd: false)
do nock.disableNetConnect
afterEach ->
global.nockscope.done()
configureRoomForSlack = ->
global.room.robot.adapterName = 'slack'
global.room.robot.slackMessages = []
global.room.robot.on 'slack-attachment', (data) ->
data.message.robot.slackMessages.push data
describe 'hubot-beerbods-slack-unit', ->
beforeEach ->
do configureRoomForSlack
#nasty hack to allow modifying the @attachment and current-0 in individual tests
str = JSON.stringify(require('./expected/slack-attachment.json'))
@attachment = JSON.parse(str)
current0str = JSON.stringify(require('./replies/current-0.json'))
@current0 = JSON.parse(current0str)
context 'mock beerbods api returns beer and untappd data', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, @current0)
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['j<NAME>', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
#Slack message will be emitted as a slack-attachment for the v3.x adapter, as a message object for v4.x
#... check that they are both the same as we expect
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns an error', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithError("intentional mock request fail")
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'replies with an apology via normal message', ->
expect(global.room.messages).to.eql [
['<NAME>', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
expect(global.room.robot.slackMessages).to.have.length 0
context 'mock beerbods api returns a non 200 status', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(404, '', [])
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'replies with an apology via normal message', ->
expect(global.room.messages).to.eql [
['<NAME>', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
expect(global.room.robot.slackMessages).to.have.length 0
context 'mock beerbods api returns beer and untappd data without rating', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.rating
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['<NAME>', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
expect(message.attachments).to.eql(require './expected/slack-attachment-no-rating-or-abv.json')
context 'mock beerbods api returns beer and untappd data without abv', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.abv
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['<NAME>', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
@attachment[0].fields = [@attachment[0].fields[0], @attachment[0].fields[2]]
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns beer and untappd data without description', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.description
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['j<NAME>', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
@attachment[0].fields = [@attachment[0].fields[0], @attachment[0].fields[1]]
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns beer and untappd data, slack custom identity disabled', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithFile(200, __dirname + '/replies/current-0.json')
process.env.HUBOT_DISABLE_BEERBODS_CUSTOM_IDENTITY = 'true'
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as hubot', ->
expect(global.room.messages[0]).to.eql ['<NAME>', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.be.undefined
expect(message.icon_url).to.be.undefined
expect(message.attachments).to.eql @attachment
describe 'hubot-beerbods-unit', ->
context 'mock beerbods api returns page with expected layout', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.times(8)
.replyWithFile(200, __dirname + '/replies/current-0.json')
global.room.user.say '<NAME>', 'hubot beerbods'
global.room.user.say '<NAME>', 'hubot whats this weeks beerbods '
global.room.user.say '<NAME>', 'hubot whats this weeks beerbods?'
global.room.user.say '<NAME>', 'hubot what\'s this weeks beerbods'
global.room.user.say '<NAME>', 'hubot what\'s this weeks beerbods?'
global.room.user.say '<NAME>', 'hubot what\'s this week\'s beerbods'
global.room.user.say '<NAME>', 'hubot what\'s this week\'s beerbods?'
global.room.user.say '<NAME>', 'hubot what’s this week’s beerbods?'
setTimeout done, 50
response = ['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
it 'responds to hubot beerbods', ->
expect(global.room.messages).to.eql [
['<NAME>', 'hubot beerbods']
['<NAME>', 'hubot whats this weeks beerbods ']
['<NAME>', 'hubot whats this weeks beerbods?']
['<NAME>', 'hubot what\'s this weeks beerbods']
['<NAME>', 'hubot what\'s this weeks beerbods?']
['<NAME>', 'hubot what\'s this week\'s beerbods']
['<NAME>', 'hubot what\'s this week\'s beerbods?']
['<NAME>', 'hubot what’s this week’s beerbods?']
response
response
response
response
response
response
response
response
]
context 'mock beerbods api returns no body for previous', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/previous/0.json").reply(200)
.get("/v1/previous/1.json").reply(200)
.get("/v1/previous/2.json").reply(200)
.get("/v1/previous/3.json").reply(200)
global.room.user.say '<NAME>', 'hubot what was last week\'s beerbods?'
global.room.user.say '<NAME>', 'hubot beerbods -2'
global.room.user.say '<NAME>', 'hubot beerbods -3'
global.room.user.say '<NAME>', 'hubot beerbods -4'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['<NAME>', 'hubot what was last week\'s beerbods?']
['<NAME>', 'hubot beerbods -2']
['<NAME>', 'hubot beerbods -3']
['<NAME>', 'hubot beerbods -4']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
context 'mock beerbods api valid for next weeks beer', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/1.json")
.replyWithFile(200, __dirname + '/replies/current-1.json')
global.room.user.say '<NAME>', 'hubot what\'s next week\'s beerbods?'
setTimeout done, 50
it 'responds with next weeks beer', ->
expect(global.room.messages).to.eql [
['<NAME>', 'hubot what\'s next week\'s beerbods?']
['hubot', 'Next week\'s test beer shall be Dalrympley, Hikin - https://beerbods.co.uk/this-weeks-beer/dalrymple-hikin']
]
context 'mock beerbods api valid for last weeks beer', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/previous/0.json")
.times(3)
.replyWithFile(200, __dirname + '/replies/current-0.json')
global.room.user.say '<NAME>', 'hubot what\'s last week\'s beerbods?'
global.room.user.say '<NAME>', 'hubot beerbods -1'
global.room.user.say '<NAME>', 'hubot beerbods prev'
setTimeout done, 50
it 'responds with last weeks beer', ->
expect(global.room.messages).to.eql [
['<NAME>', 'hubot what\'s last week\'s beerbods?']
['<NAME>', 'hubot beerbods -1']
['<NAME>', 'hubot beerbods prev']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
]
context 'mock beerbods api unavailable', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithError('intentional mock request fail')
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['<NAME>', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
context 'mock beerbods api 404', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(404)
global.room.user.say '<NAME>', 'hubot beerbods'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['<NAME>', 'hubot beer<NAME>']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
| true | Helper = require 'hubot-test-helper'
expect = require('chai').expect
nock = require 'nock'
helper = new Helper('../src')
beforeEach ->
global.room = helper.createRoom(httpd: false)
do nock.disableNetConnect
afterEach ->
global.nockscope.done()
configureRoomForSlack = ->
global.room.robot.adapterName = 'slack'
global.room.robot.slackMessages = []
global.room.robot.on 'slack-attachment', (data) ->
data.message.robot.slackMessages.push data
describe 'hubot-beerbods-slack-unit', ->
beforeEach ->
do configureRoomForSlack
#nasty hack to allow modifying the @attachment and current-0 in individual tests
str = JSON.stringify(require('./expected/slack-attachment.json'))
@attachment = JSON.parse(str)
current0str = JSON.stringify(require('./replies/current-0.json'))
@current0 = JSON.parse(current0str)
context 'mock beerbods api returns beer and untappd data', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, @current0)
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['jPI:NAME:<NAME>END_PI', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
#Slack message will be emitted as a slack-attachment for the v3.x adapter, as a message object for v4.x
#... check that they are both the same as we expect
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns an error', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithError("intentional mock request fail")
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'replies with an apology via normal message', ->
expect(global.room.messages).to.eql [
['PI:NAME:<NAME>END_PI', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
expect(global.room.robot.slackMessages).to.have.length 0
context 'mock beerbods api returns a non 200 status', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(404, '', [])
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'replies with an apology via normal message', ->
expect(global.room.messages).to.eql [
['PI:NAME:<NAME>END_PI', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
expect(global.room.robot.slackMessages).to.have.length 0
context 'mock beerbods api returns beer and untappd data without rating', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.rating
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['PI:NAME:<NAME>END_PI', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
expect(message.attachments).to.eql(require './expected/slack-attachment-no-rating-or-abv.json')
context 'mock beerbods api returns beer and untappd data without abv', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.abv
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['PI:NAME:<NAME>END_PI', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
@attachment[0].fields = [@attachment[0].fields[0], @attachment[0].fields[2]]
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns beer and untappd data without description', ->
beforeEach (done) ->
response = @current0
delete response.beers[0].untappd.description
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(200, response)
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as beerbods', ->
expect(global.room.messages[0]).to.eql ['jPI:NAME:<NAME>END_PI', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.eql "beerbods"
expect(message.icon_url).to.eql "https://beerbods.co.uk/images/favicon.ico"
@attachment[0].fields = [@attachment[0].fields[0], @attachment[0].fields[1]]
expect(message.attachments).to.eql @attachment
context 'mock beerbods api returns beer and untappd data, slack custom identity disabled', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithFile(200, __dirname + '/replies/current-0.json')
process.env.HUBOT_DISABLE_BEERBODS_CUSTOM_IDENTITY = 'true'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'doesn\'t reply with a normal message, sends slack attachment as hubot', ->
expect(global.room.messages[0]).to.eql ['PI:NAME:<NAME>END_PI', 'hubot beerbods']
expect(global.room.robot.slackMessages).to.have.length 1
expect(global.room.robot.slackMessages[0]).to.eql global.room.messages[1][1]
message = global.room.robot.slackMessages[0]
expect(message.username).to.be.undefined
expect(message.icon_url).to.be.undefined
expect(message.attachments).to.eql @attachment
describe 'hubot-beerbods-unit', ->
context 'mock beerbods api returns page with expected layout', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.times(8)
.replyWithFile(200, __dirname + '/replies/current-0.json')
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot whats this weeks beerbods '
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot whats this weeks beerbods?'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot what\'s this weeks beerbods'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot what\'s this weeks beerbods?'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot what\'s this week\'s beerbods'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot what\'s this week\'s beerbods?'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot what’s this week’s beerbods?'
setTimeout done, 50
response = ['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
it 'responds to hubot beerbods', ->
expect(global.room.messages).to.eql [
['PI:NAME:<NAME>END_PI', 'hubot beerbods']
['PI:NAME:<NAME>END_PI', 'hubot whats this weeks beerbods ']
['PI:NAME:<NAME>END_PI', 'hubot whats this weeks beerbods?']
['PI:NAME:<NAME>END_PI', 'hubot what\'s this weeks beerbods']
['PI:NAME:<NAME>END_PI', 'hubot what\'s this weeks beerbods?']
['PI:NAME:<NAME>END_PI', 'hubot what\'s this week\'s beerbods']
['PI:NAME:<NAME>END_PI', 'hubot what\'s this week\'s beerbods?']
['PI:NAME:<NAME>END_PI', 'hubot what’s this week’s beerbods?']
response
response
response
response
response
response
response
response
]
context 'mock beerbods api returns no body for previous', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/previous/0.json").reply(200)
.get("/v1/previous/1.json").reply(200)
.get("/v1/previous/2.json").reply(200)
.get("/v1/previous/3.json").reply(200)
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot what was last week\'s beerbods?'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods -2'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods -3'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods -4'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['PI:NAME:<NAME>END_PI', 'hubot what was last week\'s beerbods?']
['PI:NAME:<NAME>END_PI', 'hubot beerbods -2']
['PI:NAME:<NAME>END_PI', 'hubot beerbods -3']
['PI:NAME:<NAME>END_PI', 'hubot beerbods -4']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
context 'mock beerbods api valid for next weeks beer', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/1.json")
.replyWithFile(200, __dirname + '/replies/current-1.json')
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot what\'s next week\'s beerbods?'
setTimeout done, 50
it 'responds with next weeks beer', ->
expect(global.room.messages).to.eql [
['PI:NAME:<NAME>END_PI', 'hubot what\'s next week\'s beerbods?']
['hubot', 'Next week\'s test beer shall be Dalrympley, Hikin - https://beerbods.co.uk/this-weeks-beer/dalrymple-hikin']
]
context 'mock beerbods api valid for last weeks beer', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/previous/0.json")
.times(3)
.replyWithFile(200, __dirname + '/replies/current-0.json')
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot what\'s last week\'s beerbods?'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods -1'
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods prev'
setTimeout done, 50
it 'responds with last weeks beer', ->
expect(global.room.messages).to.eql [
['PI:NAME:<NAME>END_PI', 'hubot what\'s last week\'s beerbods?']
['PI:NAME:<NAME>END_PI', 'hubot beerbods -1']
['PI:NAME:<NAME>END_PI', 'hubot beerbods prev']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
['hubot', 'This week\'s test beer shall be Beer?, The Dharma Initiative - https://beerbods.co.uk/this-weeks-beer/beer-dharma-initiative']
]
context 'mock beerbods api unavailable', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.replyWithError('intentional mock request fail')
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['PI:NAME:<NAME>END_PI', 'hubot beerbods']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
context 'mock beerbods api 404', ->
beforeEach (done) ->
global.nockscope = nock("https://beerbods.andersonshatch.com")
.get("/v1/current/0.json")
.reply(404)
global.room.user.say 'PI:NAME:<NAME>END_PI', 'hubot beerbods'
setTimeout done, 50
it 'responds with an apology', ->
expect(global.room.messages).to.eql [
['PI:NAME:<NAME>END_PI', 'hubot beerPI:NAME:<NAME>END_PI']
['hubot', 'Sorry, there was an error finding beers. Please check https://beerbods.co.uk']
]
|
[
{
"context": ".getConfigVal', \n\tsetup: ->\n\t\t@config =\n\t\t\tname: 'John'\n\t\t\tage: 21.2\n\t\t\tsex: true\n\t\t\theight: 173\n\t\t\tweig",
"end": 65,
"score": 0.9997538924217224,
"start": 61,
"tag": "NAME",
"value": "John"
},
{
"context": "ing', (val)-> \"hello #{val}\" \n\teq... | src/beta 0.3/UnitTest_old/testcases.coffee | fsjohnhuang/lpp | 1 | module 'lpp.getConfigVal',
setup: ->
@config =
name: 'John'
age: 21.2
sex: true
height: 173
weight: 150.56
hobbies: ['dancing', 'singing']
job: 'programmer'
test 'lpp.getConfigVal, propName is string!', ->
config = @config
name = lpp.getConfigVal config, 'name', 'DefaultVal', 'string', (val)-> "hello #{val}"
equal name, 'hello John', "test property in string type"
age = lpp.getConfigVal config, 'age', 'DefaultVal', ['int'], (val)-> "My age is #{val}"
equal age, 'DefaultVal', "age isn't int"
sex = lpp.getConfigVal config, 'sex', 'DefaultVal', 'bool', [true]
equal sex, true, "false stands for men!"
height = lpp.getConfigVal config, 'height', 'DefaultVal', ['int', 'string'], (val)->
if lpp.isInt val then "#{val}cm" else val
equal height, '173cm', 'testing tall'
hobbies = lpp.getConfigVal config, 'hobbies', null, 'Array'
equal hobbies, config.hobbies, 'is array'
job = lpp.getConfigVal config, 'job', null, 'string', ['programmer', 'pm']
equal job, 'programmer', ' is programmer'
test 'lpp.getConfigVal, propName is object!', ->
config = @config
[name, age, sex, height, hobbies, job] = lpp.getConfigVal config,
name:
defaultVal: 'DefaultVal'
dataTypes: 'string'
success: (val)-> "hello #{val}"
age:
defaultVal: 'DefaultVal'
dataTypes: ['int']
success: (val)-> "My age is #{val}"
sex:
defaultVal: 'DefaultVal'
dataTypes: 'bool'
valRange: [true]
height:
defaultVal: 'DefaultVal'
dataTypes: ['int', 'string']
success: (val)->
if lpp.isInt val then "#{val}cm" else val
hobbies:
defaultVal: null
dataTypes: 'Array'
job:
defaultVal: null
dataTypes: 'string'
valRange: ['programmer', 'pm']
equal name, 'hello John', "test property in string type"
equal age, 'DefaultVal', "age isn't int"
equal sex, true, "false stands for men!"
equal height, '173cm', 'testing tall'
equal hobbies, config.hobbies, 'is array'
equal job, 'programmer', ' is programmer'
test 'lpp.splice', ->
str = '0123456789abcdef'
result = lpp.splice(str, 1, 2)
result1 = lpp.Str.splice str, 1, 2
equal str, '0123456789abcdef', 'str'
equal result.items.join(''), '03456789abcdef', 'result'
equal result1.str, '03456789abcdef', 'result1'
test 'lpp.toArray', ->
str = '012'
debugger
result = lpp.toArray str
deepEqual result, ["0","1","2"] | 43876 | module 'lpp.getConfigVal',
setup: ->
@config =
name: '<NAME>'
age: 21.2
sex: true
height: 173
weight: 150.56
hobbies: ['dancing', 'singing']
job: 'programmer'
test 'lpp.getConfigVal, propName is string!', ->
config = @config
name = lpp.getConfigVal config, 'name', 'DefaultVal', 'string', (val)-> "hello #{val}"
equal name, 'hello <NAME>', "test property in string type"
age = lpp.getConfigVal config, 'age', 'DefaultVal', ['int'], (val)-> "My age is #{val}"
equal age, 'DefaultVal', "age isn't int"
sex = lpp.getConfigVal config, 'sex', 'DefaultVal', 'bool', [true]
equal sex, true, "false stands for men!"
height = lpp.getConfigVal config, 'height', 'DefaultVal', ['int', 'string'], (val)->
if lpp.isInt val then "#{val}cm" else val
equal height, '173cm', 'testing tall'
hobbies = lpp.getConfigVal config, 'hobbies', null, 'Array'
equal hobbies, config.hobbies, 'is array'
job = lpp.getConfigVal config, 'job', null, 'string', ['programmer', 'pm']
equal job, 'programmer', ' is programmer'
test 'lpp.getConfigVal, propName is object!', ->
config = @config
[name, age, sex, height, hobbies, job] = lpp.getConfigVal config,
name:
defaultVal: 'DefaultVal'
dataTypes: 'string'
success: (val)-> "hello #{val}"
age:
defaultVal: 'DefaultVal'
dataTypes: ['int']
success: (val)-> "My age is #{val}"
sex:
defaultVal: 'DefaultVal'
dataTypes: 'bool'
valRange: [true]
height:
defaultVal: 'DefaultVal'
dataTypes: ['int', 'string']
success: (val)->
if lpp.isInt val then "#{val}cm" else val
hobbies:
defaultVal: null
dataTypes: 'Array'
job:
defaultVal: null
dataTypes: 'string'
valRange: ['programmer', 'pm']
equal name, '<NAME> <NAME>', "test property in string type"
equal age, 'DefaultVal', "age isn't int"
equal sex, true, "false stands for men!"
equal height, '173cm', 'testing tall'
equal hobbies, config.hobbies, 'is array'
equal job, 'programmer', ' is programmer'
test 'lpp.splice', ->
str = '0123456789abcdef'
result = lpp.splice(str, 1, 2)
result1 = lpp.Str.splice str, 1, 2
equal str, '0123456789abcdef', 'str'
equal result.items.join(''), '03456789abcdef', 'result'
equal result1.str, '03456789abcdef', 'result1'
test 'lpp.toArray', ->
str = '012'
debugger
result = lpp.toArray str
deepEqual result, ["0","1","2"] | true | module 'lpp.getConfigVal',
setup: ->
@config =
name: 'PI:NAME:<NAME>END_PI'
age: 21.2
sex: true
height: 173
weight: 150.56
hobbies: ['dancing', 'singing']
job: 'programmer'
test 'lpp.getConfigVal, propName is string!', ->
config = @config
name = lpp.getConfigVal config, 'name', 'DefaultVal', 'string', (val)-> "hello #{val}"
equal name, 'hello PI:NAME:<NAME>END_PI', "test property in string type"
age = lpp.getConfigVal config, 'age', 'DefaultVal', ['int'], (val)-> "My age is #{val}"
equal age, 'DefaultVal', "age isn't int"
sex = lpp.getConfigVal config, 'sex', 'DefaultVal', 'bool', [true]
equal sex, true, "false stands for men!"
height = lpp.getConfigVal config, 'height', 'DefaultVal', ['int', 'string'], (val)->
if lpp.isInt val then "#{val}cm" else val
equal height, '173cm', 'testing tall'
hobbies = lpp.getConfigVal config, 'hobbies', null, 'Array'
equal hobbies, config.hobbies, 'is array'
job = lpp.getConfigVal config, 'job', null, 'string', ['programmer', 'pm']
equal job, 'programmer', ' is programmer'
test 'lpp.getConfigVal, propName is object!', ->
config = @config
[name, age, sex, height, hobbies, job] = lpp.getConfigVal config,
name:
defaultVal: 'DefaultVal'
dataTypes: 'string'
success: (val)-> "hello #{val}"
age:
defaultVal: 'DefaultVal'
dataTypes: ['int']
success: (val)-> "My age is #{val}"
sex:
defaultVal: 'DefaultVal'
dataTypes: 'bool'
valRange: [true]
height:
defaultVal: 'DefaultVal'
dataTypes: ['int', 'string']
success: (val)->
if lpp.isInt val then "#{val}cm" else val
hobbies:
defaultVal: null
dataTypes: 'Array'
job:
defaultVal: null
dataTypes: 'string'
valRange: ['programmer', 'pm']
equal name, 'PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI', "test property in string type"
equal age, 'DefaultVal', "age isn't int"
equal sex, true, "false stands for men!"
equal height, '173cm', 'testing tall'
equal hobbies, config.hobbies, 'is array'
equal job, 'programmer', ' is programmer'
test 'lpp.splice', ->
str = '0123456789abcdef'
result = lpp.splice(str, 1, 2)
result1 = lpp.Str.splice str, 1, 2
equal str, '0123456789abcdef', 'str'
equal result.items.join(''), '03456789abcdef', 'result'
equal result1.str, '03456789abcdef', 'result1'
test 'lpp.toArray', ->
str = '012'
debugger
result = lpp.toArray str
deepEqual result, ["0","1","2"] |
[
{
"context": "s\": [\n {\n \"id\": 888,\n \"name\": \"Ruby App\",\n \"language\": \"ruby\",\n \"health",
"end": 94,
"score": 0.6911564469337463,
"start": 90,
"tag": "NAME",
"value": "Ruby"
},
{
"context": " },\n {\n \"id\": 333,\n ... | test/samples/apps.coffee | marcesher/hubot-newrelic2-cfpb | 12 | module.exports = ->
{
"applications": [
{
"id": 888,
"name": "Ruby App",
"language": "ruby",
"health_status": "green",
"reporting": true,
"last_reported_at": "2014-10-31T21:02:21+00:00",
"application_summary": {
"response_time": 12.5,
"throughput": 3,
"error_rate": 0,
"apdex_target": 3,
"apdex_score": 1
},
"settings": {
"app_apdex_threshold": 3,
"end_user_apdex_threshold": 7,
"enable_real_user_monitoring": false,
"use_server_side_config": false
},
"links": {
"application_instances": [
123,
456
],
"alert_policy": 1000,
"servers": [
72727
],
"application_hosts": [
383838,
382929
]
}
},
{
"id": 333,
"name": "Python App",
"language": "python",
"health_status": "red",
"reporting": false,
"settings": {
"app_apdex_threshold": 0.5,
"end_user_apdex_threshold": 7,
"enable_real_user_monitoring": false,
"use_server_side_config": false
},
"links": {
"application_instances": [
38382,
38383
],
"alert_policy": 38382,
"servers": [
838432
],
"application_hosts": [
287223
]
}
}
]
}
| 209383 | module.exports = ->
{
"applications": [
{
"id": 888,
"name": "<NAME> App",
"language": "ruby",
"health_status": "green",
"reporting": true,
"last_reported_at": "2014-10-31T21:02:21+00:00",
"application_summary": {
"response_time": 12.5,
"throughput": 3,
"error_rate": 0,
"apdex_target": 3,
"apdex_score": 1
},
"settings": {
"app_apdex_threshold": 3,
"end_user_apdex_threshold": 7,
"enable_real_user_monitoring": false,
"use_server_side_config": false
},
"links": {
"application_instances": [
123,
456
],
"alert_policy": 1000,
"servers": [
72727
],
"application_hosts": [
383838,
382929
]
}
},
{
"id": 333,
"name": "<NAME> App",
"language": "python",
"health_status": "red",
"reporting": false,
"settings": {
"app_apdex_threshold": 0.5,
"end_user_apdex_threshold": 7,
"enable_real_user_monitoring": false,
"use_server_side_config": false
},
"links": {
"application_instances": [
38382,
38383
],
"alert_policy": 38382,
"servers": [
838432
],
"application_hosts": [
287223
]
}
}
]
}
| true | module.exports = ->
{
"applications": [
{
"id": 888,
"name": "PI:NAME:<NAME>END_PI App",
"language": "ruby",
"health_status": "green",
"reporting": true,
"last_reported_at": "2014-10-31T21:02:21+00:00",
"application_summary": {
"response_time": 12.5,
"throughput": 3,
"error_rate": 0,
"apdex_target": 3,
"apdex_score": 1
},
"settings": {
"app_apdex_threshold": 3,
"end_user_apdex_threshold": 7,
"enable_real_user_monitoring": false,
"use_server_side_config": false
},
"links": {
"application_instances": [
123,
456
],
"alert_policy": 1000,
"servers": [
72727
],
"application_hosts": [
383838,
382929
]
}
},
{
"id": 333,
"name": "PI:NAME:<NAME>END_PI App",
"language": "python",
"health_status": "red",
"reporting": false,
"settings": {
"app_apdex_threshold": 0.5,
"end_user_apdex_threshold": 7,
"enable_real_user_monitoring": false,
"use_server_side_config": false
},
"links": {
"application_instances": [
38382,
38383
],
"alert_policy": 38382,
"servers": [
838432
],
"application_hosts": [
287223
]
}
}
]
}
|
[
{
"context": "ttp://alac.macosforge.org/\n#\n# Javascript port by Jens Nockert and Devon Govett of OFMLabs, https://github.com/o",
"end": 102,
"score": 0.999860942363739,
"start": 90,
"tag": "NAME",
"value": "Jens Nockert"
},
{
"context": "orge.org/\n#\n# Javascript port by Jens No... | src/matrix_dec.coffee | h0rn3z0r/alac.js | 0 | #
# Original C(++) version by Apple, http://alac.macosforge.org/
#
# Javascript port by Jens Nockert and Devon Govett of OFMLabs, https://github.com/ofmlabs/alac.js
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License 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.
#
# File: matrix_dec.coffee
# Contains: ALAC mixing/matrixing routines to/from 32-bit predictor buffers.
class Matrixlib
@unmix16 = (u, v, out, stride, samples, mixbits, mixres) ->
# Conventional separated stereo
if mixres is 0
for i in [0...samples] by 1
out[i * stride + 0] = u[i]
out[i * stride + 1] = v[i]
# Matrixed stereo
else
for i in [0...samples] by 1
l = u[i] + v[i] - ((mixres * v[i]) >> mixbits)
out[i * stride + 0] = l
out[i * stride + 1] = l - v[i]
return
# unmix20
# unmix24
# unmix 32
module.exports = Matrixlib
| 63270 | #
# Original C(++) version by Apple, http://alac.macosforge.org/
#
# Javascript port by <NAME> and <NAME> of OFMLabs, https://github.com/ofmlabs/alac.js
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License 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.
#
# File: matrix_dec.coffee
# Contains: ALAC mixing/matrixing routines to/from 32-bit predictor buffers.
class Matrixlib
@unmix16 = (u, v, out, stride, samples, mixbits, mixres) ->
# Conventional separated stereo
if mixres is 0
for i in [0...samples] by 1
out[i * stride + 0] = u[i]
out[i * stride + 1] = v[i]
# Matrixed stereo
else
for i in [0...samples] by 1
l = u[i] + v[i] - ((mixres * v[i]) >> mixbits)
out[i * stride + 0] = l
out[i * stride + 1] = l - v[i]
return
# unmix20
# unmix24
# unmix 32
module.exports = Matrixlib
| true | #
# Original C(++) version by Apple, http://alac.macosforge.org/
#
# Javascript port by PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI of OFMLabs, https://github.com/ofmlabs/alac.js
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License 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.
#
# File: matrix_dec.coffee
# Contains: ALAC mixing/matrixing routines to/from 32-bit predictor buffers.
class Matrixlib
@unmix16 = (u, v, out, stride, samples, mixbits, mixres) ->
# Conventional separated stereo
if mixres is 0
for i in [0...samples] by 1
out[i * stride + 0] = u[i]
out[i * stride + 1] = v[i]
# Matrixed stereo
else
for i in [0...samples] by 1
l = u[i] + v[i] - ((mixres * v[i]) >> mixbits)
out[i * stride + 0] = l
out[i * stride + 1] = l - v[i]
return
# unmix20
# unmix24
# unmix 32
module.exports = Matrixlib
|
[
{
"context": " Config\n customTypePayload = {\n key: 'my-type',\n name: { 'en': 'customized fields' },\n ",
"end": 6990,
"score": 0.9810559153556824,
"start": 6983,
"tag": "KEY",
"value": "my-type"
},
{
"context": " custom: {\n type: {\n key... | src/spec/integration/inventories-sync.spec.coffee | commercetools/sphere-node-sdk | 13 | debug = require('debug')('spec-integration:inventories')
_ = require 'underscore'
_.mixin require 'underscore-mixins'
Promise = require 'bluebird'
{SphereClient, InventorySync} = require '../../lib/main'
Config = require('../../config').config
describe 'Integration Inventories Sync', ->
beforeEach (done) ->
@client = new SphereClient config: Config
@sync = new InventorySync
@client.inventoryEntries.all().fetch()
.then (result) =>
stocks = result.body.results
debug 'Cleaning up all inventory entries'
Promise.all _.map stocks, (s) => @client.inventoryEntries.byId(s.id).delete(s.version)
.then -> done()
.catch (error) -> done(_.prettify(error))
it 'should update inventory entry', (done) ->
ie =
sku: '123'
quantityOnStock: 3
ieChanged =
sku: '123'
quantityOnStock: 7
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (quantity)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 7
done()
.catch (error) -> done(_.prettify(error))
it 'should add expectedDelivery date', (done) ->
ie =
sku: 'x1'
quantityOnStock: 3
ieChanged =
sku: 'x1'
quantityOnStock: 7
expectedDelivery: '2000-01-01T01:01:01'
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery add)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 7
expect(result.body.expectedDelivery).toBe '2000-01-01T01:01:01.000Z'
done()
.catch (error) -> done(_.prettify(error))
it 'should update expectedDelivery date', (done) ->
ie =
sku: 'x2'
quantityOnStock: 3
expectedDelivery: '1999-01-01T01:01:01.000Z'
ieChanged =
sku: 'x2'
quantityOnStock: 3
expectedDelivery: '2000-01-01T01:01:01.000Z'
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery update)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.expectedDelivery).toBe '2000-01-01T01:01:01.000Z'
done()
.catch (error) -> done(_.prettify(error))
it 'should remove expectedDelivery date', (done) ->
ie =
sku: 'x3'
quantityOnStock: 3
expectedDelivery: '2000-01-01T01:01:01.000Z'
ieChanged =
sku: 'x3'
quantityOnStock: 3
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery remove)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.expectedDelivery).not.toBeDefined()
done()
.catch (error) -> done(_.prettify(error))
, 60000
it 'should add restockableInDays', (done) ->
ie =
sku: 'xyz1'
quantityOnStock: 10
version: 1
ieChanged =
sku: 'xyz1'
quantityOnStock: 10
restockableInDays: 30
version: 1
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBeUndefined()
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to add to inventory with synced actions (restockableInDays add)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 10
expect(result.body.restockableInDays).toBe 30
done()
.catch (error) -> done(_.prettify(error))
it 'should update restockableInDays', (done) ->
ie =
sku: 'xyz2'
quantityOnStock: 3
restockableInDays: 30
version: 1
ieChanged =
sku: 'xyz2'
quantityOnStock: 3
restockableInDays: 7
version: 1
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBe 30
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (restockableInDays update)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.restockableInDays).toBe 7
done()
.catch (error) -> done(_.prettify(error))
it 'should remove restockableInDays', (done) ->
ie =
sku: 'xyz3'
quantityOnStock: 5
restockableInDays: 7
ieChanged =
sku: 'xyz3'
quantityOnStock: 5
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBe 7
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (restockableInDays remove)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 5
expect(result.body.restockableInDays).not.toBeDefined()
done()
.catch (error) -> done(_.prettify(error))
describe 'custom type and field handling', (done) ->
customType = undefined
inventoryEntry = undefined
typesCleanup = (client) ->
client.types.all().fetch()
.then (result) ->
Promise.all _.map result.body.results, (e) ->
client.types.byId(e.id).delete(e.version)
.then (results) ->
debug('Cleaned up all custom types.')
Promise.resolve()
beforeEach (done) ->
@client = new SphereClient config: Config
customTypePayload = {
key: 'my-type',
name: { 'en': 'customized fields' },
description: { 'en': 'customized fields definition' },
resourceTypeIds: ['inventory-entry'],
fieldDefinitions: [
{
name: 'nac',
type: { 'name': 'String' },
required: true,
label: { 'en': 'size' },
inputHint: 'SingleLine'
}
]
}
typesCleanup(@client).then =>
@client.types.create(customTypePayload).then (result) ->
customType = result.body
done()
it 'should update custom type and fields', (done) ->
ie =
sku: 'x6'
quantityOnStock: 0
custom: {
type: {
key: 'my-type'
},
fields: {
nac: 'ho'
}
}
ieChanged =
sku: 'x6'
quantityOnStock: 7
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (quantity)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
inventoryEntry = result.body
expect(result.statusCode).toBe 200
expect(result.body.custom.type.id).toBe customType.id
expect(result.body.custom.fields).toEqual {nac: 'ho'}
done()
.catch (error) -> done(_.prettify(error))
| 86209 | debug = require('debug')('spec-integration:inventories')
_ = require 'underscore'
_.mixin require 'underscore-mixins'
Promise = require 'bluebird'
{SphereClient, InventorySync} = require '../../lib/main'
Config = require('../../config').config
describe 'Integration Inventories Sync', ->
beforeEach (done) ->
@client = new SphereClient config: Config
@sync = new InventorySync
@client.inventoryEntries.all().fetch()
.then (result) =>
stocks = result.body.results
debug 'Cleaning up all inventory entries'
Promise.all _.map stocks, (s) => @client.inventoryEntries.byId(s.id).delete(s.version)
.then -> done()
.catch (error) -> done(_.prettify(error))
it 'should update inventory entry', (done) ->
ie =
sku: '123'
quantityOnStock: 3
ieChanged =
sku: '123'
quantityOnStock: 7
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (quantity)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 7
done()
.catch (error) -> done(_.prettify(error))
it 'should add expectedDelivery date', (done) ->
ie =
sku: 'x1'
quantityOnStock: 3
ieChanged =
sku: 'x1'
quantityOnStock: 7
expectedDelivery: '2000-01-01T01:01:01'
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery add)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 7
expect(result.body.expectedDelivery).toBe '2000-01-01T01:01:01.000Z'
done()
.catch (error) -> done(_.prettify(error))
it 'should update expectedDelivery date', (done) ->
ie =
sku: 'x2'
quantityOnStock: 3
expectedDelivery: '1999-01-01T01:01:01.000Z'
ieChanged =
sku: 'x2'
quantityOnStock: 3
expectedDelivery: '2000-01-01T01:01:01.000Z'
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery update)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.expectedDelivery).toBe '2000-01-01T01:01:01.000Z'
done()
.catch (error) -> done(_.prettify(error))
it 'should remove expectedDelivery date', (done) ->
ie =
sku: 'x3'
quantityOnStock: 3
expectedDelivery: '2000-01-01T01:01:01.000Z'
ieChanged =
sku: 'x3'
quantityOnStock: 3
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery remove)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.expectedDelivery).not.toBeDefined()
done()
.catch (error) -> done(_.prettify(error))
, 60000
it 'should add restockableInDays', (done) ->
ie =
sku: 'xyz1'
quantityOnStock: 10
version: 1
ieChanged =
sku: 'xyz1'
quantityOnStock: 10
restockableInDays: 30
version: 1
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBeUndefined()
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to add to inventory with synced actions (restockableInDays add)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 10
expect(result.body.restockableInDays).toBe 30
done()
.catch (error) -> done(_.prettify(error))
it 'should update restockableInDays', (done) ->
ie =
sku: 'xyz2'
quantityOnStock: 3
restockableInDays: 30
version: 1
ieChanged =
sku: 'xyz2'
quantityOnStock: 3
restockableInDays: 7
version: 1
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBe 30
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (restockableInDays update)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.restockableInDays).toBe 7
done()
.catch (error) -> done(_.prettify(error))
it 'should remove restockableInDays', (done) ->
ie =
sku: 'xyz3'
quantityOnStock: 5
restockableInDays: 7
ieChanged =
sku: 'xyz3'
quantityOnStock: 5
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBe 7
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (restockableInDays remove)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 5
expect(result.body.restockableInDays).not.toBeDefined()
done()
.catch (error) -> done(_.prettify(error))
describe 'custom type and field handling', (done) ->
customType = undefined
inventoryEntry = undefined
typesCleanup = (client) ->
client.types.all().fetch()
.then (result) ->
Promise.all _.map result.body.results, (e) ->
client.types.byId(e.id).delete(e.version)
.then (results) ->
debug('Cleaned up all custom types.')
Promise.resolve()
beforeEach (done) ->
@client = new SphereClient config: Config
customTypePayload = {
key: '<KEY>',
name: { 'en': 'customized fields' },
description: { 'en': 'customized fields definition' },
resourceTypeIds: ['inventory-entry'],
fieldDefinitions: [
{
name: 'nac',
type: { 'name': 'String' },
required: true,
label: { 'en': 'size' },
inputHint: 'SingleLine'
}
]
}
typesCleanup(@client).then =>
@client.types.create(customTypePayload).then (result) ->
customType = result.body
done()
it 'should update custom type and fields', (done) ->
ie =
sku: 'x6'
quantityOnStock: 0
custom: {
type: {
key: '<KEY>'
},
fields: {
nac: 'ho'
}
}
ieChanged =
sku: 'x6'
quantityOnStock: 7
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (quantity)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
inventoryEntry = result.body
expect(result.statusCode).toBe 200
expect(result.body.custom.type.id).toBe customType.id
expect(result.body.custom.fields).toEqual {nac: 'ho'}
done()
.catch (error) -> done(_.prettify(error))
| true | debug = require('debug')('spec-integration:inventories')
_ = require 'underscore'
_.mixin require 'underscore-mixins'
Promise = require 'bluebird'
{SphereClient, InventorySync} = require '../../lib/main'
Config = require('../../config').config
describe 'Integration Inventories Sync', ->
beforeEach (done) ->
@client = new SphereClient config: Config
@sync = new InventorySync
@client.inventoryEntries.all().fetch()
.then (result) =>
stocks = result.body.results
debug 'Cleaning up all inventory entries'
Promise.all _.map stocks, (s) => @client.inventoryEntries.byId(s.id).delete(s.version)
.then -> done()
.catch (error) -> done(_.prettify(error))
it 'should update inventory entry', (done) ->
ie =
sku: '123'
quantityOnStock: 3
ieChanged =
sku: '123'
quantityOnStock: 7
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (quantity)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 7
done()
.catch (error) -> done(_.prettify(error))
it 'should add expectedDelivery date', (done) ->
ie =
sku: 'x1'
quantityOnStock: 3
ieChanged =
sku: 'x1'
quantityOnStock: 7
expectedDelivery: '2000-01-01T01:01:01'
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery add)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 7
expect(result.body.expectedDelivery).toBe '2000-01-01T01:01:01.000Z'
done()
.catch (error) -> done(_.prettify(error))
it 'should update expectedDelivery date', (done) ->
ie =
sku: 'x2'
quantityOnStock: 3
expectedDelivery: '1999-01-01T01:01:01.000Z'
ieChanged =
sku: 'x2'
quantityOnStock: 3
expectedDelivery: '2000-01-01T01:01:01.000Z'
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery update)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.expectedDelivery).toBe '2000-01-01T01:01:01.000Z'
done()
.catch (error) -> done(_.prettify(error))
it 'should remove expectedDelivery date', (done) ->
ie =
sku: 'x3'
quantityOnStock: 3
expectedDelivery: '2000-01-01T01:01:01.000Z'
ieChanged =
sku: 'x3'
quantityOnStock: 3
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (expectedDelivery remove)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.expectedDelivery).not.toBeDefined()
done()
.catch (error) -> done(_.prettify(error))
, 60000
it 'should add restockableInDays', (done) ->
ie =
sku: 'xyz1'
quantityOnStock: 10
version: 1
ieChanged =
sku: 'xyz1'
quantityOnStock: 10
restockableInDays: 30
version: 1
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBeUndefined()
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to add to inventory with synced actions (restockableInDays add)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 10
expect(result.body.restockableInDays).toBe 30
done()
.catch (error) -> done(_.prettify(error))
it 'should update restockableInDays', (done) ->
ie =
sku: 'xyz2'
quantityOnStock: 3
restockableInDays: 30
version: 1
ieChanged =
sku: 'xyz2'
quantityOnStock: 3
restockableInDays: 7
version: 1
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBe 30
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (restockableInDays update)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 3
expect(result.body.restockableInDays).toBe 7
done()
.catch (error) -> done(_.prettify(error))
it 'should remove restockableInDays', (done) ->
ie =
sku: 'xyz3'
quantityOnStock: 5
restockableInDays: 7
ieChanged =
sku: 'xyz3'
quantityOnStock: 5
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
expect(result.body.restockableInDays).toBe 7
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (restockableInDays remove)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
expect(result.statusCode).toBe 200
expect(result.body.quantityOnStock).toBe 5
expect(result.body.restockableInDays).not.toBeDefined()
done()
.catch (error) -> done(_.prettify(error))
describe 'custom type and field handling', (done) ->
customType = undefined
inventoryEntry = undefined
typesCleanup = (client) ->
client.types.all().fetch()
.then (result) ->
Promise.all _.map result.body.results, (e) ->
client.types.byId(e.id).delete(e.version)
.then (results) ->
debug('Cleaned up all custom types.')
Promise.resolve()
beforeEach (done) ->
@client = new SphereClient config: Config
customTypePayload = {
key: 'PI:KEY:<KEY>END_PI',
name: { 'en': 'customized fields' },
description: { 'en': 'customized fields definition' },
resourceTypeIds: ['inventory-entry'],
fieldDefinitions: [
{
name: 'nac',
type: { 'name': 'String' },
required: true,
label: { 'en': 'size' },
inputHint: 'SingleLine'
}
]
}
typesCleanup(@client).then =>
@client.types.create(customTypePayload).then (result) ->
customType = result.body
done()
it 'should update custom type and fields', (done) ->
ie =
sku: 'x6'
quantityOnStock: 0
custom: {
type: {
key: 'PI:KEY:<KEY>END_PI'
},
fields: {
nac: 'ho'
}
}
ieChanged =
sku: 'x6'
quantityOnStock: 7
@client.inventoryEntries.create(ie)
.then (result) =>
expect(result.statusCode).toBe 201
syncedActions = @sync.buildActions(ieChanged, result.body)
debug 'About to update inventory with synced actions (quantity)'
@client.inventoryEntries.byId(syncedActions.getUpdateId()).update(syncedActions.getUpdatePayload())
.then (result) ->
inventoryEntry = result.body
expect(result.statusCode).toBe 200
expect(result.body.custom.type.id).toBe customType.id
expect(result.body.custom.fields).toEqual {nac: 'ho'}
done()
.catch (error) -> done(_.prettify(error))
|
[
{
"context": "tterCLDR (JavaScript) v{{version}}\n// Authors: Cameron Dutro [@camertron]\n Kirill Lashuk [@KL_7",
"end": 152,
"score": 0.9998912811279297,
"start": 139,
"tag": "NAME",
"value": "Cameron Dutro"
},
{
"context": "Script) v{{version}}\n// Authors: C... | js/lib/mustache/bundle.coffee | caniszczyk/twitter-cldr-rb | 0 | ###
// Copyright 2012 Twitter, Inc
// http://www.apache.org/licenses/LICENSE-2.0
// TwitterCLDR (JavaScript) v{{version}}
// Authors: Cameron Dutro [@camertron]
Kirill Lashuk [@KL_7]
portions by Sven Fuchs [@svenfuchs]
// Homepage: https://twitter.com
// Description: Provides date, time, number, and list formatting functionality for various Twitter-supported locales in Javascript.
###
TwitterCldr = {}
{{{contents}}} | 152514 | ###
// Copyright 2012 Twitter, Inc
// http://www.apache.org/licenses/LICENSE-2.0
// TwitterCLDR (JavaScript) v{{version}}
// Authors: <NAME> [@camertron]
<NAME> [@KL_7]
portions by <NAME> [@svenfuchs]
// Homepage: https://twitter.com
// Description: Provides date, time, number, and list formatting functionality for various Twitter-supported locales in Javascript.
###
TwitterCldr = {}
{{{contents}}} | true | ###
// Copyright 2012 Twitter, Inc
// http://www.apache.org/licenses/LICENSE-2.0
// TwitterCLDR (JavaScript) v{{version}}
// Authors: PI:NAME:<NAME>END_PI [@camertron]
PI:NAME:<NAME>END_PI [@KL_7]
portions by PI:NAME:<NAME>END_PI [@svenfuchs]
// Homepage: https://twitter.com
// Description: Provides date, time, number, and list formatting functionality for various Twitter-supported locales in Javascript.
###
TwitterCldr = {}
{{{contents}}} |
[
{
"context": "raw_output = false} )\"\n\t\"From php.net (modified by Mark Jaquith to behave like the native PHP5 function).\":\n\t\t\"pr",
"end": 12446,
"score": 0.9998890161514282,
"start": 12434,
"tag": "NAME",
"value": "Mark Jaquith"
},
{
"context": "efix\":\"create_user\"\n\t\t\"... | snippets/functions.cson | ImranKhalid/wordpress-autocomplete | 14 | '.source.php':
"_":
"prefix":"_"
"body":"_()"
"Retrieve the translation of $text.":
"prefix":"__"
"body":"__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Autoloader compatibility callback.":
"prefix":"__autoload"
"body":"__autoload( ${1:\\$classname} )"
"Private helper function for checked, selected, and disabled.":
"prefix":"__checked_selected_helper"
"body":"__checked_selected_helper( ${1:\\$helper}${2:, \\$current}${3:, \\$echo}${4:, \\$type} )"
"Helper function to clear the cache for number of authors.":
"prefix":"__clear_multi_author_cache"
"body":"__clear_multi_author_cache()"
"Utility version of get_option that is private to install/upgrade.":
"prefix":"__get_option"
"body":"__get_option( ${1:\\$setting} )"
"Retrieve the plural or single form based on the amount.":
"prefix":"__ngettext"
"body":"__ngettext()"
"Register plural strings in POT file, but don't translate them.":
"prefix":"__ngettext_noop"
"body":"__ngettext_noop()"
"Returns an empty array.":
"prefix":"__return_empty_array"
"body":"__return_empty_array()"
"Returns an empty string.":
"prefix":"__return_empty_string"
"body":"__return_empty_string()"
"Returns false.":
"prefix":"__return_false"
"body":"__return_false()"
"Returns null.":
"prefix":"__return_null"
"body":"__return_null()"
"Returns true.":
"prefix":"__return_true"
"body":"__return_true()"
"Returns 0.":
"prefix":"__return_zero"
"body":"__return_zero()"
"Displays an access denied message when a user tries to view a site's dashboard they
do not have access to.":
"prefix":"_access_denied_splash"
"body":"_access_denied_splash()"
"Add submenus for post types.":
"prefix":"_add_post_type_submenus"
"body":"_add_post_type_submenus()"
"Adds the (theme) 'Editor' link to the bottom of the Appearance menu.":
"prefix":"_add_themes_utility_last"
"body":"_add_themes_utility_last()"
"Default admin bar callback.":
"prefix":"_admin_bar_bump_cb"
"body":"_admin_bar_bump_cb()"
"Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post.":
"prefix":"_admin_notice_post_locked"
"body":"_admin_notice_post_locked()"
"Displays the search query.":
"prefix":"_admin_search_query"
"body":"_admin_search_query()"
"Kill WordPress ajax execution.":
"prefix":"_ajax_wp_die_handler"
"body":"_ajax_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Newline preservation help function for wpautop":
"prefix":"_autop_newline_preservation_helper"
"body":"_autop_newline_preservation_helper( ${1:\\$matches} )"
"Retrieve translated string with vertical bar context":
"prefix":"_c"
"body":"_c( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Retrieve a canonical form of the provided charset appropriate for passing to PHP
functions such as htmlspecialchars() and charset html attributes.":
"prefix":"_canonical_charset"
"body":"_canonical_charset( ${1:\\$charset} )"
"Strip close comment and close php tags from file headers used by WP.":
"prefix":"_cleanup_header_comment"
"body":"_cleanup_header_comment( ${1:\\$str} )"
"Private preg_replace callback used in image_add_caption()":
"prefix":"_cleanup_image_add_caption"
"body":"_cleanup_image_add_caption()"
"Clear the lastcommentmodified cached value when a comment status is changed.":
"prefix":"_clear_modified_cache_on_transition_comment_status"
"body":"_clear_modified_cache_on_transition_comment_status( ${1:\\$new_status}${2:, \\$old_status} )"
"Close comments on an old post. Hooked to comments_open and pings_open.":
"prefix":"_close_comments_for_old_post"
"body":"_close_comments_for_old_post( ${1:\\$open}${2:, \\$post_id} )"
"Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts.":
"prefix":"_close_comments_for_old_posts"
"body":"_close_comments_for_old_posts( ${1:\\$posts}${2:, \\$query} )"
"Retrieve the WordPress home page URL.":
"prefix":"_config_wp_home"
"body":"_config_wp_home( ${1:\\$url = ''} )"
"Retrieve the WordPress site URL.":
"prefix":"_config_wp_siteurl"
"body":"_config_wp_siteurl( ${1:\\$url = ''} )"
"Preview fix for JavaScript bug with foreign languages.":
"prefix":"_convert_urlencoded_to_entities"
"body":"_convert_urlencoded_to_entities( ${1:\\$match} )"
"_copy_dir":
"prefix":"_copy_dir"
"body":"_copy_dir( ${1:\\$from}${2:, \\$to}${3:, \\$skip_list = array()} )"
"Copy an existing image file.":
"prefix":"_copy_image_file"
"body":"_copy_image_file( ${1:\\$attachment_id} )"
"Return the cache key for wp_count_posts() based on the passed arguments.":
"prefix":"_count_posts_cache_key"
"body":"_count_posts_cache_key( ${1:\\$type = 'post'}${2:, \\$perm = ''} )"
"Crops an image resource. Internal use only.":
"prefix":"_crop_image_resource"
"body":"_crop_image_resource( ${1:\\$img}${2:, \\$x}${3:, \\$y}${4:, \\$w}${5:, \\$h} )"
"Default custom background callback.":
"prefix":"_custom_background_cb"
"body":"_custom_background_cb()"
"Registers the internal custom header and background routines.":
"prefix":"_custom_header_background_just_in_time"
"body":"_custom_header_background_just_in_time()"
"Adds CSS to hide header text for custom logo, based on Customizer setting.":
"prefix":"_custom_logo_header_styles"
"body":"_custom_logo_header_styles()"
"Perform a deep string replace operation to ensure the values in $search are no longer present":
"prefix":"_deep_replace"
"body":"_deep_replace( ${1:\\$search}${2:, \\$subject} )"
"Kills WordPress execution and display HTML message with error message.":
"prefix":"_default_wp_die_handler"
"body":"_default_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Checks an attachment being deleted to see if it's a header or background image.":
"prefix":"_delete_attachment_theme_mod"
"body":"_delete_attachment_theme_mod( ${1:\\$id} )"
"Delete the fresh site option.":
"prefix":"_delete_option_fresh_site"
"body":"_delete_option_fresh_site()"
"Mark a function argument as deprecated and inform when it has been used.":
"prefix":"_deprecated_argument"
"body":"_deprecated_argument( ${1:\\$function}${2:, \\$version}${3:, \\$message = null} )"
"Marks a constructor as deprecated and informs when it has been used.":
"prefix":"_deprecated_constructor"
"body":"_deprecated_constructor( ${1:\\$class}${2:, \\$version}${3:, \\$parent_class = ''} )"
"Mark a file as deprecated and inform when it has been used.":
"prefix":"_deprecated_file"
"body":"_deprecated_file( ${1:\\$file}${2:, \\$version}${3:, \\$replacement = null}${4:, \\$message = ''} )"
"Mark a function as deprecated and inform when it has been used.":
"prefix":"_deprecated_function"
"body":"_deprecated_function( ${1:\\$function}${2:, \\$version}${3:, \\$replacement = null} )"
"Marks a deprecated action or filter hook as deprecated and throws a notice.":
"prefix":"_deprecated_hook"
"body":"_deprecated_hook( ${1:\\$hook}${2:, \\$version}${3:, \\$replacement = null}${4:, \\$message = null} )"
"Test if the current device has the capability to upload files.":
"prefix":"_device_can_upload"
"body":"_device_can_upload()"
"Mark something as being incorrectly called.":
"prefix":"_doing_it_wrong"
"body":"_doing_it_wrong( ${1:\\$function}${2:, \\$message}${3:, \\$version} )"
"Get the post title.":
"prefix":"_draft_or_post_title"
"body":"_draft_or_post_title( ${1:\\$post} )"
"Display translated text.":
"prefix":"_e"
"body":"_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated string with gettext context.":
"prefix":"_ex"
"body":"_ex( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Retrieve URL headers and content using WP HTTP Request API.":
"prefix":"_fetch_remote_file"
"body":"_fetch_remote_file( ${1:\\$url}${2:, \\$headers = ''} )"
"Filter the SQL clauses of an attachment query to include filenames.":
"prefix":"_filter_query_attachment_filenames"
"body":"_filter_query_attachment_filenames( ${1:\\$clauses} )"
"Replace hrefs of attachment anchors with up-to-date permalinks.":
"prefix":"_fix_attachment_links"
"body":"_fix_attachment_links( ${1:\\$post} )"
"Flips an image resource. Internal use only.":
"prefix":"_flip_image_resource"
"body":"_flip_image_resource( ${1:\\$img}${2:, \\$horz}${3:, \\$vert} )"
"Hook used to schedule publication for a post marked for the future.":
"prefix":"_future_post_hook"
"body":"_future_post_hook( ${1:\\$deprecated}${2:, \\$post} )"
"Returns a list of meta keys to be (maybe) populated in wp_update_user().":
"prefix":"_get_additional_user_keys"
"body":"_get_additional_user_keys( ${1:\\$user} )"
"Retrieve the admin bar display preference of a user.":
"prefix":"_get_admin_bar_pref"
"body":"_get_admin_bar_pref( ${1:\\$context = 'front'}${2:, \\$user} )"
"Retrieve a specific component from a parsed URL array.":
"prefix":"_get_component_from_parsed_url_array"
"body":"_get_component_from_parsed_url_array( ${1:\\$url_parts}${2:, \\$component = -1} )"
"Retrieve cron info array option.":
"prefix":"_get_cron_array"
"body":"_get_cron_array()"
"Retrieves the cron lock.":
"prefix":"_get_cron_lock"
"body":"_get_cron_lock()"
"Build an object with custom-something object (post type, taxonomy) labels
out of a custom-something object":
"prefix":"_get_custom_object_labels"
"body":"_get_custom_object_labels( ${1:\\$object}${2:, \\$nohier_vs_hier_defaults} )"
"Returns drop-ins that WordPress uses.":
"prefix":"_get_dropins"
"body":"_get_dropins()"
"Get the timestamp of the last time any post was modified or published.":
"prefix":"_get_last_post_time"
"body":"_get_last_post_time( ${1:\\$timezone}${2:, \\$field}${3:, \\$post_type = 'any'} )"
"Fetch an instance of a WP_List_Table class.":
"prefix":"_get_list_table"
"body":"_get_list_table( ${1:\\$class}${2:, \\$args = array()} )"
"Retrieve the name of the metadata table for the specified object type.":
"prefix":"_get_meta_table"
"body":"_get_meta_table( ${1:\\$type} )"
"Retrieve ids that are not already present in the cache.":
"prefix":"_get_non_cached_ids"
"body":"_get_non_cached_ids( ${1:\\$object_ids}${2:, \\$cache_key} )"
"Retrieves the page permalink.":
"prefix":"_get_page_link"
"body":"_get_page_link( ${1:\\$post = false}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Gets the path to a translation file for loading a textdomain just in time.":
"prefix":"_get_path_to_translation"
"body":"_get_path_to_translation( ${1:\\$domain}${2:, \\$reset = false} )"
"Gets the path to a translation file in the languages directory for the current locale.":
"prefix":"_get_path_to_translation_from_lang_dir"
"body":"_get_path_to_translation_from_lang_dir( ${1:\\$domain} )"
"Sanitizes plugin data, optionally adds markup, optionally translates.":
"prefix":"_get_plugin_data_markup_translate"
"body":"_get_plugin_data_markup_translate()"
"Retrieve post ancestors.":
"prefix":"_get_post_ancestors"
"body":"_get_post_ancestors( ${1:\\$post} )"
"Get random header image data from registered images in theme.":
"prefix":"_get_random_header_data"
"body":"_get_random_header_data()"
"Tidies a filename for url display by the theme editor.":
"prefix":"_get_template_edit_filename"
"body":"_get_template_edit_filename( ${1:\\$fullpath}${2:, \\$containingfolder} )"
"Get the subset of $terms that are descendants of $term_id.":
"prefix":"_get_term_children"
"body":"_get_term_children( ${1:\\$term_id}${2:, \\$terms}${3:, \\$taxonomy}${4:, \\$ancestors = array()} )"
"Retrieves children of taxonomy as Term IDs.":
"prefix":"_get_term_hierarchy"
"body":"_get_term_hierarchy( ${1:\\$taxonomy} )"
"Retrieves the widget ID base value.":
"prefix":"_get_widget_id_base"
"body":"_get_widget_id_base( ${1:\\$id} )"
"Retrieve the regular expression for shortcodes.":
"prefix":"_get_wptexturize_shortcode_regex"
"body":"_get_wptexturize_shortcode_regex( ${1:\\$tagnames} )"
"Retrieve the combined regular expression for HTML and shortcodes.":
"prefix":"_get_wptexturize_split_regex"
"body":"_get_wptexturize_split_regex( ${1:\\$shortcode_regex = ''} )"
"Internal compat function to mimic hash_hmac().":
"prefix":"_hash_hmac"
"body":"_hash_hmac( ${1:\\$algo}${2:, \\$data}${3:, \\$key}${4:, \\$raw_output = false} )"
"From php.net (modified by Mark Jaquith to behave like the native PHP5 function).":
"prefix":"_http_build_query"
"body":"_http_build_query( ${1:\\$data}${2:, \\$prefix = null}${3:, \\$sep = null}${4:, \\$key = ''}${5:, \\$urlencode = true} )"
"Image preview ratio. Internal use only.":
"prefix":"_image_get_preview_ratio"
"body":"_image_get_preview_ratio( ${1:\\$w}${2:, \\$h} )"
"This was once used to display an 'Insert into Post' button.":
"prefix":"_insert_into_post_button"
"body":"_insert_into_post_button()"
"_ipad_meta":
"prefix":"_ipad_meta"
"body":"_ipad_meta()"
"Return if a menu item is valid.":
"prefix":"_is_valid_nav_menu_item"
"body":"_is_valid_nav_menu_item( ${1:\\$item} )"
"_json_decode_object_helper":
"prefix":"_json_decode_object_helper"
"body":"_json_decode_object_helper( ${1:\\$data} )"
"Callback to add a base url to relative links in passed content.":
"prefix":"_links_add_base"
"body":"_links_add_base( ${1:\\$m} )"
"Callback to add a target attribute to all links in passed content.":
"prefix":"_links_add_target"
"body":"_links_add_target( ${1:\\$m} )"
"Outputs a single row of public meta data in the Custom Fields meta box.":
"prefix":"_list_meta_row"
"body":"_list_meta_row( ${1:\\$entry}${2:, \\$count} )"
"Retrieve the path or url of an attachment's attached file.":
"prefix":"_load_image_to_edit_path"
"body":"_load_image_to_edit_path( ${1:\\$attachment_id}${2:, \\$size = 'full'} )"
"Loads plugin and theme textdomains just-in-time.":
"prefix":"_load_textdomain_just_in_time"
"body":"_load_textdomain_just_in_time( ${1:\\$domain} )"
"Output the HTML for restoring the post data from DOM storage":
"prefix":"_local_storage_notice"
"body":"_local_storage_notice()"
"Update category structure to old pre 2.3 from new taxonomy structure.":
"prefix":"_make_cat_compat"
"body":"_make_cat_compat( ${1:\\$category} )"
"Callback to convert email address match to HTML A element.":
"prefix":"_make_email_clickable_cb"
"body":"_make_email_clickable_cb( ${1:\\$matches} )"
"Callback to convert URI match to HTML A element.":
"prefix":"_make_url_clickable_cb"
"body":"_make_url_clickable_cb( ${1:\\$matches} )"
"Callback to convert URL match to HTML A element.":
"prefix":"_make_web_ftp_clickable_cb"
"body":"_make_web_ftp_clickable_cb( ${1:\\$matches} )"
"Determines whether core should be updated.":
"prefix":"_maybe_update_core"
"body":"_maybe_update_core()"
"Check the last time plugins were run before checking plugin versions.":
"prefix":"_maybe_update_plugins"
"body":"_maybe_update_plugins()"
"Check themes versions only after a duration of time.":
"prefix":"_maybe_update_themes"
"body":"_maybe_update_themes()"
"Internal compat function to mimic mb_strlen().":
"prefix":"_mb_strlen"
"body":"_mb_strlen( ${1:\\$str}${2:, \\$encoding = null} )"
"Internal compat function to mimic mb_substr().":
"prefix":"_mb_substr"
"body":"_mb_substr( ${1:\\$str}${2:, \\$start}${3:, \\$length = null}${4:, \\$encoding = null} )"
"Set the localized direction for MCE plugin.":
"prefix":"_mce_set_direction"
"body":"_mce_set_direction( ${1:\\$mce_init} )"
"This was once used to display a media button.":
"prefix":"_media_button"
"body":"_media_button()"
"_media_states":
"prefix":"_media_states"
"body":"_media_states( ${1:\\$post} )"
"Translates and retrieves the singular or plural form based on the supplied number.":
"prefix":"_n"
"body":"_n( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$domain = 'default'} )"
"Registers plural strings in POT file, but does not translate them.":
"prefix":"_n_noop"
"body":"_n_noop( ${1:\\$singular}${2:, \\$plural}${3:, \\$domain = null} )"
"Prevents a menu item ID from being used more than once.":
"prefix":"_nav_menu_item_id_use_once"
"body":"_nav_menu_item_id_use_once( ${1:\\$id}${2:, \\$item} )"
"Wraps passed links in navigational markup.":
"prefix":"_navigation_markup"
"body":"_navigation_markup( ${1:\\$links}${2:, \\$class = 'posts-navigation'}${3:, \\$screen_reader_text = ''} )"
"Legacy version of _n(), which supports contexts.":
"prefix":"_nc"
"body":"_nc( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$domain = 'default'} )"
"Translates and retrieves the singular or plural form based on the supplied number, with gettext context.":
"prefix":"_nx"
"body":"_nx( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$context}${5:, \\$domain = 'default'} )"
"Registers plural strings with gettext context in POT file, but does not translate them.":
"prefix":"_nx_noop"
"body":"_nx_noop( ${1:\\$singular}${2:, \\$plural}${3:, \\$context}${4:, \\$domain = null} )"
"Creates an XML string from a given array.":
"prefix":"_oembed_create_xml"
"body":"_oembed_create_xml( ${1:\\$data}${2:, \\$node = null} )"
"Prepare the oembed HTML to be displayed in an RSS feed.":
"prefix":"_oembed_filter_feed_content"
"body":"_oembed_filter_feed_content( ${1:\\$content} )"
"Hooks into the REST API output to print XML instead of JSON.":
"prefix":"_oembed_rest_pre_serve_request"
"body":"_oembed_rest_pre_serve_request( ${1:\\$served}${2:, \\$result}${3:, \\$request}${4:, \\$server} )"
"Add count of children to parent count.":
"prefix":"_pad_term_counts"
"body":"_pad_term_counts( ${1:\\$terms}${2:, \\$taxonomy} )"
"Traverse and return all the nested children post names of a root page.":
"prefix":"_page_traverse_name"
"body":"_page_traverse_name( ${1:\\$page_id}${2:, \\$children}${3:, \\$result} )"
"Remove the post format prefix from the name property of the term object created by get_term().":
"prefix":"_post_format_get_term"
"body":"_post_format_get_term( ${1:\\$term} )"
"Remove the post format prefix from the name property of the term objects created by get_terms().":
"prefix":"_post_format_get_terms"
"body":"_post_format_get_terms( ${1:\\$terms}${2:, \\$taxonomies}${3:, \\$args} )"
"Filters the post format term link to remove the format prefix.":
"prefix":"_post_format_link"
"body":"_post_format_link( ${1:\\$link}${2:, \\$term}${3:, \\$taxonomy} )"
"Filters the request to allow for the format prefix.":
"prefix":"_post_format_request"
"body":"_post_format_request( ${1:\\$qvs} )"
"Remove the post format prefix from the name property of the term objects created by wp_get_object_terms().":
"prefix":"_post_format_wp_get_object_terms"
"body":"_post_format_wp_get_object_terms( ${1:\\$terms} )"
"_post_states":
"prefix":"_post_states"
"body":"_post_states( ${1:\\$post} )"
"Store or return a list of post type meta caps for map_meta_cap().":
"prefix":"_post_type_meta_capabilities"
"body":"_post_type_meta_capabilities( ${1:\\$capabilities = null} )"
"Private function to modify the current stylesheet when previewing a theme":
"prefix":"_preview_theme_stylesheet_filter"
"body":"_preview_theme_stylesheet_filter()"
"Private function to modify the current template when previewing a theme":
"prefix":"_preview_theme_template_filter"
"body":"_preview_theme_template_filter()"
"Adds any comments from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_comment_caches"
"body":"_prime_comment_caches( ${1:\\$comment_ids}${2:, \\$update_meta_cache = true} )"
"Adds any networks from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_network_caches"
"body":"_prime_network_caches( ${1:\\$network_ids} )"
"Adds any posts from the given ids to the cache that do not already exist in cache":
"prefix":"_prime_post_caches"
"body":"_prime_post_caches( ${1:\\$ids}${2:, \\$update_term_cache = true}${3:, \\$update_meta_cache = true} )"
"Adds any sites from the given ids to the cache that do not already exist in cache.":
"prefix":"_prime_site_caches"
"body":"_prime_site_caches( ${1:\\$ids} )"
"Adds any terms from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_term_caches"
"body":"_prime_term_caches( ${1:\\$term_ids}${2:, \\$update_meta_cache = true} )"
"Prints inline Emoji dection script":
"prefix":"_print_emoji_detection_script"
"body":"_print_emoji_detection_script()"
"Print scripts (internal use only)":
"prefix":"_print_scripts"
"body":"_print_scripts()"
"Print styles (internal use only)":
"prefix":"_print_styles"
"body":"_print_styles()"
"Hook to schedule pings and enclosures when a post is published.":
"prefix":"_publish_post_hook"
"body":"_publish_post_hook( ${1:\\$post_id} )"
"Redirect to the About WordPress page after a successful upgrade.":
"prefix":"_redirect_to_about_wordpress"
"body":"_redirect_to_about_wordpress( ${1:\\$new_version} )"
"Registers the form callback for a widget.":
"prefix":"_register_widget_form_callback"
"body":"_register_widget_form_callback( ${1:\\$id}${2:, \\$name}${3:, \\$form_callback}${4:, \\$options = array()} )"
"Registers the update callback for a widget.":
"prefix":"_register_widget_update_callback"
"body":"_register_widget_update_callback( ${1:\\$id_base}${2:, \\$update_callback}${3:, \\$options = array()} )"
"This was once used to move child posts to a new parent.":
"prefix":"_relocate_children"
"body":"_relocate_children( ${1:\\$old_ID}${2:, \\$new_ID} )"
"Removes arguments from a query string if they are not present in a URL
DO NOT use this in plugin code.":
"prefix":"_remove_qs_args_if_not_in_url"
"body":"_remove_qs_args_if_not_in_url( ${1:\\$query_string}${2:, \\$args_to_check}${3:, \\$url} )"
"Do not use. Removes theme support internally, ignorant of the blacklist.":
"prefix":"_remove_theme_support"
"body":"_remove_theme_support( ${1:\\$feature} )"
"Reset the page_on_front, show_on_front, and page_for_post settings when
a linked page is deleted or trashed.":
"prefix":"_reset_front_page_settings_for_post"
"body":"_reset_front_page_settings_for_post( ${1:\\$post_id} )"
"Retrieve":
"prefix":"_response_to_rss"
"body":"_response_to_rss( ${1:\\$resp} )"
"Returns an image resource. Internal use only.":
"prefix":"_rotate_image_resource"
"body":"_rotate_image_resource( ${1:\\$img}${2:, \\$angle} )"
"Internal helper function to sanitize a string from user input or from the db":
"prefix":"_sanitize_text_fields"
"body":"_sanitize_text_fields( ${1:\\$str}${2:, \\$keep_newlines = false} )"
"Callback formerly fired on the save_post hook. No longer needed.":
"prefix":"_save_post_hook"
"body":"_save_post_hook()"
"Kill WordPress execution.":
"prefix":"_scalar_wp_die_handler"
"body":"_scalar_wp_die_handler( ${1:\\$message = ''} )"
"Formerly used internally to tidy up the search terms.":
"prefix":"_search_terms_tidy"
"body":"_search_terms_tidy( ${1:\\$t} )"
"Updates the CRON option with the new CRON array.":
"prefix":"_set_cron_array"
"body":"_set_cron_array( ${1:\\$cron} )"
"Sets up the post object for preview based on the post autosave.":
"prefix":"_set_preview"
"body":"_set_preview( ${1:\\$post} )"
"Filters the latest content for preview from the post autosave.":
"prefix":"_show_post_preview"
"body":"_show_post_preview()"
"Callback to sort array by a 'name' key.":
"prefix":"_sort_name_callback"
"body":"_sort_name_callback()"
"Sort menu items by the desired key.":
"prefix":"_sort_nav_menu_items"
"body":"_sort_nav_menu_items( ${1:\\$a}${2:, \\$b} )"
"Callback to sort array by a 'Name' key.":
"prefix":"_sort_uname_callback"
"body":"_sort_uname_callback()"
"Create a new term for a term_taxonomy item that currently shares its term
with another term_taxonomy.":
"prefix":"_split_shared_term"
"body":"_split_shared_term( ${1:\\$term_id}${2:, \\$term_taxonomy_id}${3:, \\$record = true} )"
"Breaks a string into chunks by splitting at whitespace characters.":
"prefix":"_split_str_by_whitespace"
"body":"_split_str_by_whitespace( ${1:\\$string}${2:, \\$goal} )"
"Thickbox image paths for Network Admin.":
"prefix":"_thickbox_path_admin_subfolder"
"body":"_thickbox_path_admin_subfolder()"
"Hook for managing future post transitions to published.":
"prefix":"_transition_post_status"
"body":"_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Truncate a post slug.":
"prefix":"_truncate_post_slug"
"body":"_truncate_post_slug( ${1:\\$slug}${2:, \\$length = 200} )"
"This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the PclZip library.":
"prefix":"_unzip_file_pclzip"
"body":"_unzip_file_pclzip( ${1:\\$file}${2:, \\$to}${3:, \\$needed_dirs = array()} )"
"This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the ZipArchive class.":
"prefix":"_unzip_file_ziparchive"
"body":"_unzip_file_ziparchive( ${1:\\$file}${2:, \\$to}${3:, \\$needed_dirs = array()} )"
"Handler for updating the blog date when a published post is deleted.":
"prefix":"_update_blog_date_on_post_delete"
"body":"_update_blog_date_on_post_delete( ${1:\\$post_id} )"
"Handler for updating the blog date when a post is published or an already published post is changed.":
"prefix":"_update_blog_date_on_post_publish"
"body":"_update_blog_date_on_post_publish( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Will update term count based on number of objects.":
"prefix":"_update_generic_term_count"
"body":"_update_generic_term_count( ${1:\\$terms}${2:, \\$taxonomy} )"
"Will update term count based on object types of the current taxonomy.":
"prefix":"_update_post_term_count"
"body":"_update_post_term_count( ${1:\\$terms}${2:, \\$taxonomy} )"
"Handler for updating the blog posts count date when a post is deleted.":
"prefix":"_update_posts_count_on_delete"
"body":"_update_posts_count_on_delete( ${1:\\$post_id} )"
"Handler for updating the blog posts count date when a post status changes.":
"prefix":"_update_posts_count_on_transition_post_status"
"body":"_update_posts_count_on_transition_post_status( ${1:\\$new_status}${2:, \\$old_status} )"
"Update the custom taxonomies' term counts when a post's status is changed.":
"prefix":"_update_term_count_on_transition_post_status"
"body":"_update_term_count_on_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Recursively find Genericons example files in a given folder.":
"prefix":"_upgrade_422_find_genericons_files_in_folder"
"body":"_upgrade_422_find_genericons_files_in_folder( ${1:\\$directory} )"
"Cleans up Genericons example files.":
"prefix":"_upgrade_422_remove_genericons"
"body":"_upgrade_422_remove_genericons()"
"_upgrade_440_force_deactivate_incompatible_plugins":
"prefix":"_upgrade_440_force_deactivate_incompatible_plugins"
"body":"_upgrade_440_force_deactivate_incompatible_plugins()"
"Upgrade a Cron info array.":
"prefix":"_upgrade_cron_array"
"body":"_upgrade_cron_array( ${1:\\$cron} )"
"Sorts a multidimensional array by first member of each top level member":
"prefix":"_usort_by_first_member"
"body":"_usort_by_first_member( ${1:\\$a}${2:, \\$b} )"
"Sort categories by ID.":
"prefix":"_usort_terms_by_id"
"body":"_usort_terms_by_id( ${1:\\$a}${2:, \\$b} )"
"Sort categories by name.":
"prefix":"_usort_terms_by_name"
"body":"_usort_terms_by_name( ${1:\\$a}${2:, \\$b} )"
"The formatted output of a list of bookmarks.":
"prefix":"_walk_bookmarks"
"body":"_walk_bookmarks( ${1:\\$bookmarks}${2:, \\$args = ''} )"
"Helper function to add global attributes to a tag in the allowed html list.":
"prefix":"_wp_add_global_attributes"
"body":"_wp_add_global_attributes( ${1:\\$value} )"
"Instantiate the admin bar object and set it up as a global for access elsewhere.":
"prefix":"_wp_admin_bar_init"
"body":"_wp_admin_bar_init()"
"_wp_admin_html_begin":
"prefix":"_wp_admin_html_begin"
"body":"_wp_admin_html_begin()"
"Ajax handler for adding a hierarchical term.":
"prefix":"_wp_ajax_add_hierarchical_term"
"body":"_wp_ajax_add_hierarchical_term()"
"Sends back current comment total and new page links if they need to be updated.":
"prefix":"_wp_ajax_delete_comment_response"
"body":"_wp_ajax_delete_comment_response( ${1:\\$comment_id}${2:, \\$delta = -1} )"
"Prints the appropriate response to a menu quick search.":
"prefix":"_wp_ajax_menu_quick_search"
"body":"_wp_ajax_menu_quick_search( ${1:\\$request = array()} )"
"Automatically add newly published page objects to menus with that as an option.":
"prefix":"_wp_auto_add_pages_to_menu"
"body":"_wp_auto_add_pages_to_menu( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Splits a batch of shared taxonomy terms.":
"prefix":"_wp_batch_split_terms"
"body":"_wp_batch_split_terms()"
"Call the 'all' hook, which will process the functions hooked into it.":
"prefix":"_wp_call_all_hook"
"body":"_wp_call_all_hook( ${1:\\$args} )"
"Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.":
"prefix":"_wp_can_use_pcre_u"
"body":"_wp_can_use_pcre_u( ${1:\\$set = null} )"
"In order to avoid the _wp_batch_split_terms() job being accidentally removed,
check that it's still scheduled while we haven't finished splitting terms.":
"prefix":"_wp_check_for_scheduled_split_terms"
"body":"_wp_check_for_scheduled_split_terms()"
"Check default categories when a term gets split to see if any of them need to be updated.":
"prefix":"_wp_check_split_default_terms"
"body":"_wp_check_split_default_terms( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"If the term being split is a nav_menu, change associations.":
"prefix":"_wp_check_split_nav_menu_terms"
"body":"_wp_check_split_nav_menu_terms( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"Check menu items when a term gets split to see if any of them need to be updated.":
"prefix":"_wp_check_split_terms_in_menus"
"body":"_wp_check_split_terms_in_menus( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"Retrieve the link to a contributor's WordPress.org profile page.":
"prefix":"_wp_credits_add_profile_link"
"body":"_wp_credits_add_profile_link( ${1:\\$display_name}${2:, \\$username}${3:, \\$profiles} )"
"Retrieve the link to an external library used in WordPress.":
"prefix":"_wp_credits_build_object_link"
"body":"_wp_credits_build_object_link( ${1:\\$data} )"
"Filters changeset post data upon insert to ensure post_name is intact.":
"prefix":"_wp_customize_changeset_filter_insert_post_data"
"body":"_wp_customize_changeset_filter_insert_post_data( ${1:\\$post_data}${2:, \\$supplied_post_data} )"
"Includes and instantiates the WP_Customize_Manager class.":
"prefix":"_wp_customize_include"
"body":"_wp_customize_include()"
"Adds settings for the customize-loader script.":
"prefix":"_wp_customize_loader_settings"
"body":"_wp_customize_loader_settings()"
"Publish a snapshot's changes.":
"prefix":"_wp_customize_publish_changeset"
"body":"_wp_customize_publish_changeset( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$changeset_post} )"
"Outputs controls for the current dashboard widget.":
"prefix":"_wp_dashboard_control_callback"
"body":"_wp_dashboard_control_callback( ${1:\\$dashboard}${2:, \\$meta_box} )"
"Outputs a row for the Recent Comments widget.":
"prefix":"_wp_dashboard_recent_comments_row"
"body":"_wp_dashboard_recent_comments_row( ${1:\\$comment}${2:, \\$show_date = true} )"
"Delete auto-draft posts associated with the supplied changeset.":
"prefix":"_wp_delete_customize_changeset_dependent_auto_drafts"
"body":"_wp_delete_customize_changeset_dependent_auto_drafts( ${1:\\$post_id} )"
"Deletes orphaned draft menu items":
"prefix":"_wp_delete_orphaned_draft_menu_items"
"body":"_wp_delete_orphaned_draft_menu_items()"
"Callback for handling a menu item when its original object is deleted.":
"prefix":"_wp_delete_post_menu_item"
"body":"_wp_delete_post_menu_item( ${1:\\$object_id} )"
"Serves as a callback for handling a menu item when its original object is deleted.":
"prefix":"_wp_delete_tax_menu_item"
"body":"_wp_delete_tax_menu_item( ${1:\\$object_id}${2:, \\$tt_id}${3:, \\$taxonomy} )"
"If a JSON blob of navigation menu data is in POST data, expand it and inject
it into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.":
"prefix":"_wp_expand_nav_menu_post_data"
"body":"_wp_expand_nav_menu_post_data()"
"Build Unique ID for storage and retrieval.":
"prefix":"_wp_filter_build_unique_id"
"body":"_wp_filter_build_unique_id( ${1:\\$tag}${2:, \\$function}${3:, \\$priority} )"
"Filters the URL base for taxonomies.":
"prefix":"_wp_filter_taxonomy_base"
"body":"_wp_filter_taxonomy_base( ${1:\\$base} )"
"Private, for use in *_footer_scripts hooks":
"prefix":"_wp_footer_scripts"
"body":"_wp_footer_scripts()"
"Get the attachment path relative to the upload directory.":
"prefix":"_wp_get_attachment_relative_path"
"body":"_wp_get_attachment_relative_path( ${1:\\$file} )"
"Retrieves the current user object.":
"prefix":"_wp_get_current_user"
"body":"_wp_get_current_user()"
"Get the image size as array from its meta data.":
"prefix":"_wp_get_image_size_from_meta"
"body":"_wp_get_image_size_from_meta( ${1:\\$size_name}${2:, \\$image_meta} )"
"Gets the post revision version.":
"prefix":"_wp_get_post_revision_version"
"body":"_wp_get_post_revision_version( ${1:\\$revision} )"
"The old private function for setting up user contact methods.":
"prefix":"_wp_get_user_contactmethods"
"body":"_wp_get_user_contactmethods( ${1:\\$user = null} )"
"Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type,
and moving the file to the appropriate directory within the uploads directory.":
"prefix":"_wp_handle_upload"
"body":"_wp_handle_upload( ${1:\\$file}${2:, \\$overrides}${3:, \\$time}${4:, \\$action} )"
"Returns the initialized WP_Http Object":
"prefix":"_wp_http_get_object"
"body":"_wp_http_get_object()"
"Tests which editors are capable of supporting the request.":
"prefix":"_wp_image_editor_choose"
"body":"_wp_image_editor_choose( ${1:\\$args = array()} )"
"Helper function to convert hex encoded chars to ASCII":
"prefix":"_wp_iso_convert"
"body":"_wp_iso_convert( ${1:\\$match} )"
"Convert a string to UTF-8, so that it can be safely encoded to JSON.":
"prefix":"_wp_json_convert_string"
"body":"_wp_json_convert_string( ${1:\\$string} )"
"Prepares response data to be serialized to JSON.":
"prefix":"_wp_json_prepare_data"
"body":"_wp_json_prepare_data( ${1:\\$data} )"
"Perform sanity checks on data that shall be encoded to JSON.":
"prefix":"_wp_json_sanity_check"
"body":"_wp_json_sanity_check( ${1:\\$data}${2:, \\$depth} )"
"Make sure that auto-draft posts get their post_date bumped to prevent premature garbage-collection.":
"prefix":"_wp_keep_alive_customize_changeset_dependent_auto_drafts"
"body":"_wp_keep_alive_customize_changeset_dependent_auto_drafts( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Regex callback for wp_kses_decode_entities":
"prefix":"_wp_kses_decode_entities_chr"
"body":"_wp_kses_decode_entities_chr( ${1:\\$match} )"
"Regex callback for wp_kses_decode_entities()":
"prefix":"_wp_kses_decode_entities_chr_hexdec"
"body":"_wp_kses_decode_entities_chr_hexdec( ${1:\\$match} )"
"Callback for wp_kses_split.":
"prefix":"_wp_kses_split_callback"
"body":"_wp_kses_split_callback()"
"Helper function for wp_link_pages().":
"prefix":"_wp_link_page"
"body":"_wp_link_page( ${1:\\$i} )"
"Add the class property classes for the current context, if applicable.":
"prefix":"_wp_menu_item_classes_by_context"
"body":"_wp_menu_item_classes_by_context( ${1:\\$menu_items} )"
"Display menu.":
"prefix":"_wp_menu_output"
"body":"_wp_menu_output( ${1:\\$menu}${2:, \\$submenu}${3:, \\$submenu_as_parent = true} )"
"Return a MySQL expression for selecting the week number based on the start_of_week option.":
"prefix":"_wp_mysql_week"
"body":"_wp_mysql_week( ${1:\\$column} )"
"Adds custom arguments to some of the meta box object types.":
"prefix":"_wp_nav_menu_meta_box_object"
"body":"_wp_nav_menu_meta_box_object( ${1:\\$object = null} )"
"Serves as a callback for comparing objects based on count.":
"prefix":"_wp_object_count_sort_cb"
"body":"_wp_object_count_sort_cb( ${1:\\$a}${2:, \\$b} )"
"Serves as a callback for comparing objects based on name.":
"prefix":"_wp_object_name_sort_cb"
"body":"_wp_object_name_sort_cb( ${1:\\$a}${2:, \\$b} )"
"Returns the initialized WP_oEmbed object.":
"prefix":"_wp_oembed_get_object"
"body":"_wp_oembed_get_object()"
"Returns a post array ready to be inserted into the posts table as a post revision.":
"prefix":"_wp_post_revision_data"
"body":"_wp_post_revision_data( ${1:\\$post = array()}${2:, \\$autosave = false} )"
"Determines which fields of posts are to be saved in revisions.":
"prefix":"_wp_post_revision_fields"
"body":"_wp_post_revision_fields( ${1:\\$post = array()}${2:, \\$deprecated = false} )"
"Adds a 'wp-post-image' class to post thumbnails. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter"
"body":"_wp_post_thumbnail_class_filter( ${1:\\$attr} )"
"Adds '_wp_post_thumbnail_class_filter' callback to the 'wp_get_attachment_image_attributes'
filter hook. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter_add"
"body":"_wp_post_thumbnail_class_filter_add( ${1:\\$attr} )"
"Removes the '_wp_post_thumbnail_class_filter' callback from the 'wp_get_attachment_image_attributes'
filter hook. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter_remove"
"body":"_wp_post_thumbnail_class_filter_remove( ${1:\\$attr} )"
"Output HTML for the post thumbnail meta-box.":
"prefix":"_wp_post_thumbnail_html"
"body":"_wp_post_thumbnail_html( ${1:\\$thumbnail_id = null}${2:, \\$post = null} )"
"Output a notice when editing the page for posts (internal use only).":
"prefix":"_wp_posts_page_notice"
"body":"_wp_posts_page_notice()"
"Filters post thumbnail lookup to set the post thumbnail.":
"prefix":"_wp_preview_post_thumbnail_filter"
"body":"_wp_preview_post_thumbnail_filter( ${1:\\$value}${2:, \\$post_id}${3:, \\$meta_key} )"
"Filters terms lookup to set the post format.":
"prefix":"_wp_preview_terms_filter"
"body":"_wp_preview_terms_filter( ${1:\\$terms}${2:, \\$post_id}${3:, \\$taxonomy} )"
"Inserts post data into the posts table as a post revision.":
"prefix":"_wp_put_post_revision"
"body":"_wp_put_post_revision( ${1:\\$post = null}${2:, \\$autosave = false} )"
"Filter out `register_meta()` args based on a whitelist.":
"prefix":"_wp_register_meta_args_whitelist"
"body":"_wp_register_meta_args_whitelist( ${1:\\$args}${2:, \\$default_args} )"
"Return relative path to an uploaded file.":
"prefix":"_wp_relative_upload_path"
"body":"_wp_relative_upload_path( ${1:\\$path} )"
"Displays title tag with content.":
"prefix":"_wp_render_title_tag"
"body":"_wp_render_title_tag()"
"URL encode UTF-8 characters in a URL.":
"prefix":"_wp_sanitize_utf8_in_redirect"
"body":"_wp_sanitize_utf8_in_redirect( ${1:\\$matches} )"
"Helper function to output a _doing_it_wrong message when applicable.":
"prefix":"_wp_scripts_maybe_doing_it_wrong"
"body":"_wp_scripts_maybe_doing_it_wrong( ${1:\\$function} )"
"Handle sidebars config after theme change":
"prefix":"_wp_sidebars_changed"
"body":"_wp_sidebars_changed()"
"Converts a number of special characters into their HTML entities.":
"prefix":"_wp_specialchars"
"body":"_wp_specialchars( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES}${3:, \\$charset = false}${4:, \\$double_encode = false} )"
"Sort-helper for timezones.":
"prefix":"_wp_timezone_choice_usort_callback"
"body":"_wp_timezone_choice_usort_callback( ${1:\\$a}${2:, \\$b} )"
"Translate a PHP_URL_* constant to the named array keys PHP uses.":
"prefix":"_wp_translate_php_url_constant_to_key"
"body":"_wp_translate_php_url_constant_to_key( ${1:\\$constant} )"
"Rename $_POST data from form names to DB post columns.":
"prefix":"_wp_translate_postdata"
"body":"_wp_translate_postdata( ${1:\\$update = false}${2:, \\$post_data = null} )"
"Upgrade the revisions author, add the current post as a revision and set the revisions version to 1":
"prefix":"_wp_upgrade_revisions_of_post"
"body":"_wp_upgrade_revisions_of_post( ${1:\\$post}${2:, \\$revisions} )"
"A non-filtered, non-cached version of wp_upload_dir() that doesn't check the path.":
"prefix":"_wp_upload_dir"
"body":"_wp_upload_dir( ${1:\\$time = null} )"
"Search for disabled element tags. Push element to stack on tag open and pop
on tag close.":
"prefix":"_wptexturize_pushpop_element"
"body":"_wptexturize_pushpop_element( ${1:\\$text}${2:, \\$stack}${3:, \\$disabled_elements} )"
"Retrieve translated string with gettext context.":
"prefix":"_x"
"body":"_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Kill WordPress execution and display XML message with error message.":
"prefix":"_xmlrpc_wp_die_handler"
"body":"_xmlrpc_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Convert a value to non-negative integer.":
"prefix":"absint"
"body":"absint( ${1:\\$maybeint} )"
"Attempts activation of plugin in a "sandbox" and redirects on success.":
"prefix":"activate_plugin"
"body":"activate_plugin( ${1:\\$plugin}${2:, \\$redirect = ''}${3:, \\$network_wide = false}${4:, \\$silent = false} )"
"Activate multiple plugins.":
"prefix":"activate_plugins"
"body":"activate_plugins( ${1:\\$plugins}${2:, \\$redirect = ''}${3:, \\$network_wide = false}${4:, \\$silent = false} )"
"Deprecated functionality for activating a network-only plugin.":
"prefix":"activate_sitewide_plugin"
"body":"activate_sitewide_plugin()"
"Hooks a function on to a specific action.":
"prefix":"add_action"
"body":"add_action( ${1:\\$tag}${2:, \\$function_to_add}${3:, \\$priority = 10}${4:, \\$accepted_args = 1} )"
"Add a new option for a given blog id.":
"prefix":"add_blog_option"
"body":"add_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$value} )"
"Adds an index to a specified table.":
"prefix":"add_clean_index"
"body":"add_clean_index( ${1:\\$table}${2:, \\$index} )"
"Add meta data field to a comment.":
"prefix":"add_comment_meta"
"body":"add_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Add submenu page to the Comments main menu.":
"prefix":"add_comments_page"
"body":"add_comments_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add contextual help text for a page.":
"prefix":"add_contextual_help"
"body":"add_contextual_help( ${1:\\$screen}${2:, \\$help} )"
"add_cssclass":
"prefix":"add_cssclass"
"body":"add_cssclass( ${1:\\$add}${2:, \\$class} )"
"Add callbacks for background image display.":
"prefix":"add_custom_background"
"body":"add_custom_background( ${1:\\$wp_head_callback = ''}${2:, \\$admin_head_callback = ''}${3:, \\$admin_preview_callback = ''} )"
"Add callbacks for image header display.":
"prefix":"add_custom_image_header"
"body":"add_custom_image_header( ${1:\\$wp_head_callback}${2:, \\$admin_head_callback}${3:, \\$admin_preview_callback = ''} )"
"Add submenu page to the Dashboard main menu.":
"prefix":"add_dashboard_page"
"body":"add_dashboard_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add callback for custom TinyMCE editor stylesheets.":
"prefix":"add_editor_style"
"body":"add_editor_style( ${1:\\$stylesheet = 'editor-style.css'} )"
"Add a user to a blog based on details from maybe_add_existing_user_to_blog().":
"prefix":"add_existing_user_to_blog"
"body":"add_existing_user_to_blog( ${1:\\$details = false} )"
"Add a new feed type like /atom1/.":
"prefix":"add_feed"
"body":"add_feed( ${1:\\$feedname}${2:, \\$function} )"
"Hook a function or method to a specific filter action.":
"prefix":"add_filter"
"body":"add_filter( ${1:\\$tag}${2:, \\$function_to_add}${3:, \\$priority = 10}${4:, \\$accepted_args = 1} )"
"Register a new image size.":
"prefix":"add_image_size"
"body":"add_image_size( ${1:\\$name}${2:, \\$width}${3:, \\$height}${4:, \\$crop = false} )"
"Add a link to using values provided in $_POST.":
"prefix":"add_link"
"body":"add_link()"
"Add submenu page to the Links main menu.":
"prefix":"add_links_page"
"body":"add_links_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Walks the array while sanitizing the contents.":
"prefix":"add_magic_quotes"
"body":"add_magic_quotes( ${1:\\$array} )"
"Add submenu page to the Tools main menu.":
"prefix":"add_management_page"
"body":"add_management_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add submenu page to the Media main menu.":
"prefix":"add_media_page"
"body":"add_media_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"add_menu_classes":
"prefix":"add_menu_classes"
"body":"add_menu_classes( ${1:\\$menu} )"
"Add a top-level menu page.":
"prefix":"add_menu_page"
"body":"add_menu_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''}${7:, \\$position = null} )"
"Add post meta data defined in $_POST superglobal for post with given ID.":
"prefix":"add_meta"
"body":"add_meta( ${1:\\$post_ID} )"
"Adds a meta box to one or more screens.":
"prefix":"add_meta_box"
"body":"add_meta_box( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$screen = null}${5:, \\$context = 'advanced'}${6:, \\$priority = 'default'}${7:, \\$callback_args = null} )"
"Add metadata for the specified object.":
"prefix":"add_metadata"
"body":"add_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value}${5:, \\$unique = false} )"
"Add a new network option.":
"prefix":"add_network_option"
"body":"add_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$value} )"
"Adds a newly created user to the appropriate blog":
"prefix":"add_new_user_to_blog"
"body":"add_new_user_to_blog( ${1:\\$user_id}${2:, \\$password}${3:, \\$meta} )"
"Add a top-level menu page in the 'objects' section.":
"prefix":"add_object_page"
"body":"add_object_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''} )"
"Add a new option.":
"prefix":"add_option"
"body":"add_option( ${1:\\$option}${2:, \\$value = ''}${3:, \\$deprecated = ''}${4:, \\$autoload = 'yes'} )"
"Register a setting and its sanitization callback":
"prefix":"add_option_update_handler"
"body":"add_option_update_handler( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$sanitize_callback = ''} )"
"Adds an array of options to the options whitelist.":
"prefix":"add_option_whitelist"
"body":"add_option_whitelist( ${1:\\$new_options}${2:, \\$options = ''} )"
"Add submenu page to the Settings main menu.":
"prefix":"add_options_page"
"body":"add_options_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add submenu page to the Pages main menu.":
"prefix":"add_pages_page"
"body":"add_pages_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add permalink structure.":
"prefix":"add_permastruct"
"body":"add_permastruct( ${1:\\$name}${2:, \\$struct}${3:, \\$args = array()} )"
"Add a URL to those already pinged.":
"prefix":"add_ping"
"body":"add_ping( ${1:\\$post_id}${2:, \\$uri} )"
"Add submenu page to the Plugins main menu.":
"prefix":"add_plugins_page"
"body":"add_plugins_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add meta data field to a post.":
"prefix":"add_post_meta"
"body":"add_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Register support of certain features for a post type.":
"prefix":"add_post_type_support"
"body":"add_post_type_support( ${1:\\$post_type}${2:, \\$feature} )"
"Add submenu page to the Posts main menu.":
"prefix":"add_posts_page"
"body":"add_posts_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Retrieves a modified URL query string.":
"prefix":"add_query_arg"
"body":"add_query_arg( ${1:\\$key}${2:, \\$value}${3:, \\$url} )"
"Add an endpoint, like /trackback/.":
"prefix":"add_rewrite_endpoint"
"body":"add_rewrite_endpoint( ${1:\\$name}${2:, \\$places}${3:, \\$query_var = true} )"
"Adds a rewrite rule that transforms a URL structure to a set of query vars.":
"prefix":"add_rewrite_rule"
"body":"add_rewrite_rule( ${1:\\$regex}${2:, \\$query}${3:, \\$after = 'bottom'} )"
"Add a new rewrite tag (like %postname%).":
"prefix":"add_rewrite_tag"
"body":"add_rewrite_tag( ${1:\\$tag}${2:, \\$regex}${3:, \\$query = ''} )"
"Add role, if it does not exist.":
"prefix":"add_role"
"body":"add_role( ${1:\\$role}${2:, \\$display_name}${3:, \\$capabilities = array()} )"
"Register and configure an admin screen option":
"prefix":"add_screen_option"
"body":"add_screen_option( ${1:\\$option}${2:, \\$args = array()} )"
"Register a settings error to be displayed to the user":
"prefix":"add_settings_error"
"body":"add_settings_error( ${1:\\$setting}${2:, \\$code}${3:, \\$message}${4:, \\$type = 'error'} )"
"Add a new field to a section of a settings page":
"prefix":"add_settings_field"
"body":"add_settings_field( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$page}${5:, \\$section = 'default'}${6:, \\$args = array()} )"
"Add a new section to a settings page.":
"prefix":"add_settings_section"
"body":"add_settings_section( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$page} )"
"Add hook for shortcode tag.":
"prefix":"add_shortcode"
"body":"add_shortcode( ${1:\\$tag}${2:, \\$func} )"
"Add a new option for the current network.":
"prefix":"add_site_option"
"body":"add_site_option( ${1:\\$option}${2:, \\$value} )"
"Add a submenu page.":
"prefix":"add_submenu_page"
"body":"add_submenu_page( ${1:\\$parent_slug}${2:, \\$page_title}${3:, \\$menu_title}${4:, \\$capability}${5:, \\$menu_slug}${6:, \\$function = ''} )"
"Adds metadata to a term.":
"prefix":"add_term_meta"
"body":"add_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Add submenu page to the Appearance main menu.":
"prefix":"add_theme_page"
"body":"add_theme_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Registers theme support for a given feature.":
"prefix":"add_theme_support"
"body":"add_theme_support( ${1:\\$feature}${2:, \\$args,...} )"
"Enqueues the default ThickBox js and css.":
"prefix":"add_thickbox"
"body":"add_thickbox()"
"Creates a new user from the "Users" form using $_POST information.":
"prefix":"add_user"
"body":"add_user()"
"Add meta data field to a user.":
"prefix":"add_user_meta"
"body":"add_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Adds a user to a blog.":
"prefix":"add_user_to_blog"
"body":"add_user_to_blog( ${1:\\$blog_id}${2:, \\$user_id}${3:, \\$role} )"
"Add submenu page to the Users/Profile main menu.":
"prefix":"add_users_page"
"body":"add_users_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add a top-level menu page in the 'utility' section.":
"prefix":"add_utility_page"
"body":"add_utility_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''} )"
"Adds slashes to escape strings.":
"prefix":"addslashes_gpc"
"body":"addslashes_gpc( ${1:\\$gpc} )"
"Displays next or previous image link that has the same post parent.":
"prefix":"adjacent_image_link"
"body":"adjacent_image_link( ${1:\\$prev = true}${2:, \\$size = 'thumbnail'}${3:, \\$text = false} )"
"Displays the adjacent post link.":
"prefix":"adjacent_post_link"
"body":"adjacent_post_link( ${1:\\$format}${2:, \\$link}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$previous = true}${6:, \\$taxonomy = 'category'} )"
"Displays the relational links for the posts adjacent to the current post.":
"prefix":"adjacent_posts_rel_link"
"body":"adjacent_posts_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Displays relational links for the posts adjacent to the current post for single post pages.":
"prefix":"adjacent_posts_rel_link_wp_head"
"body":"adjacent_posts_rel_link_wp_head()"
"Display the default admin color scheme picker (Used in user-edit.php)":
"prefix":"admin_color_scheme_picker"
"body":"admin_color_scheme_picker( ${1:\\$user_id} )"
"admin_created_user_email":
"prefix":"admin_created_user_email"
"body":"admin_created_user_email( ${1:\\$text} )"
"Retrieves the URL to the admin area for the current site.":
"prefix":"admin_url"
"body":"admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Allow subdirectory install.":
"prefix":"allow_subdirectory_install"
"body":"allow_subdirectory_install()"
"Allow subdomain install":
"prefix":"allow_subdomain_install"
"body":"allow_subdomain_install()"
"Whitelists allowed redirect hosts for safe HTTP requests as well.":
"prefix":"allowed_http_request_hosts"
"body":"allowed_http_request_hosts( ${1:\\$is_external}${2:, \\$host} )"
"Display all of the allowed tags in HTML format with attributes.":
"prefix":"allowed_tags"
"body":"allowed_tags()"
"Converts email addresses characters to HTML entities to block spam bots.":
"prefix":"antispambot"
"body":"antispambot( ${1:\\$email_address}${2:, \\$hex_encoding} )"
"Does the specified module exist in the Apache config?":
"prefix":"apache_mod_loaded"
"body":"apache_mod_loaded( ${1:\\$mod}${2:, \\$default = false} )"
"Call the functions added to a filter hook.":
"prefix":"apply_filters"
"body":"apply_filters( ${1:\\$tag}${2:, \\$value}${3:, \\$var,...} )"
"Fires functions attached to a deprecated filter hook.":
"prefix":"apply_filters_deprecated"
"body":"apply_filters_deprecated( ${1:\\$tag}${2:, \\$args}${3:, \\$version}${4:, \\$replacement = false}${5:, \\$message = null} )"
"Execute functions hooked on a specific filter hook, specifying arguments in an array.":
"prefix":"apply_filters_ref_array"
"body":"apply_filters_ref_array( ${1:\\$tag}${2:, \\$args} )"
"PHP-agnostic version of {@link array_replace_recursive()}.":
"prefix":"array_replace_recursive"
"body":"array_replace_recursive( ${1:\\$base = array()}${2:, \\$replacements = array()} )"
"Display the atom enclosure for the current post.":
"prefix":"atom_enclosure"
"body":"atom_enclosure()"
"Displays Site Icon in atom feeds.":
"prefix":"atom_site_icon"
"body":"atom_site_icon()"
"Display fields for ID3 data":
"prefix":"attachment_id3_data_meta_box"
"body":"attachment_id3_data_meta_box( ${1:\\$post} )"
"Display attachment submit form fields.":
"prefix":"attachment_submit_meta_box"
"body":"attachment_submit_meta_box( ${1:\\$post} )"
"Displays non-editable attachment metadata in the publish meta box.":
"prefix":"attachment_submitbox_metadata"
"body":"attachment_submitbox_metadata()"
"Tries to convert an attachment URL into a post ID.":
"prefix":"attachment_url_to_postid"
"body":"attachment_url_to_postid( ${1:\\$url} )"
"Escaping for HTML attributes":
"prefix":"attribute_escape"
"body":"attribute_escape( ${1:\\$text} )"
"Checks if a user is logged in, if not it redirects them to the login page.":
"prefix":"auth_redirect"
"body":"auth_redirect()"
"Whether author of supplied post has capability or role.":
"prefix":"author_can"
"body":"author_can( ${1:\\$post}${2:, \\$capability} )"
"Enable/disable automatic general feed link outputting.":
"prefix":"automatic_feed_links"
"body":"automatic_feed_links( ${1:\\$add = true} )"
"Avoids a collision between a site slug and a permalink slug.":
"prefix":"avoid_blog_page_permalink_collision"
"body":"avoid_blog_page_permalink_collision( ${1:\\$data}${2:, \\$postarr} )"
"Display background color value.":
"prefix":"background_color"
"body":"background_color()"
"Display background image path.":
"prefix":"background_image"
"body":"background_image()"
"Adds backslashes before letters and before a number at the start of a string.":
"prefix":"backslashit"
"body":"backslashit( ${1:\\$string} )"
"Balances tags if forced to, or if the 'use_balanceTags' option is set to true.":
"prefix":"balancetags"
"body":"balancetags( ${1:\\$text}${2:, \\$force = false} )"
"Remove last item on a pipe-delimited string.":
"prefix":"before_last_bar"
"body":"before_last_bar( ${1:\\$string} )"
"Displays information about the current site.":
"prefix":"bloginfo"
"body":"bloginfo( ${1:\\$show = ''} )"
"Display RSS container for the bloginfo function.":
"prefix":"bloginfo_rss"
"body":"bloginfo_rss( ${1:\\$show = ''} )"
"Display the classes for the body element.":
"prefix":"body_class"
"body":"body_class( ${1:\\$class = ''} )"
"Whether input is yes or no.":
"prefix":"bool_from_yn"
"body":"bool_from_yn( ${1:\\$yn} )"
"Build URL query based on an associative and, or indexed array.":
"prefix":"build_query"
"body":"build_query( ${1:\\$data} )"
"Process the post data for the bulk editing of posts.":
"prefix":"bulk_edit_posts"
"body":"bulk_edit_posts( ${1:\\$post_data = null} )"
"Set the headers for caching for 10 days with JavaScript content type.":
"prefix":"cache_javascript_headers"
"body":"cache_javascript_headers()"
"Retrieve info for user lists to prevent multiple queries by get_userdata()":
"prefix":"cache_users"
"body":"cache_users( ${1:\\$user_ids} )"
"Get number of days since the start of the week.":
"prefix":"calendar_week_mod"
"body":"calendar_week_mod( ${1:\\$num} )"
"Whether or not we can edit this network from this page.":
"prefix":"can_edit_network"
"body":"can_edit_network( ${1:\\$site_id} )"
"Display HTML content for cancel comment reply link.":
"prefix":"cancel_comment_reply_link"
"body":"cancel_comment_reply_link( ${1:\\$text = ''} )"
"Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).":
"prefix":"capital_p_dangit"
"body":"capital_p_dangit( ${1:\\$text} )"
"Check if a category is an ancestor of another category.":
"prefix":"cat_is_ancestor_of"
"body":"cat_is_ancestor_of( ${1:\\$cat1}${2:, \\$cat2} )"
"Retrieve category description.":
"prefix":"category_description"
"body":"category_description( ${1:\\$category} )"
"Check whether a category exists.":
"prefix":"category_exists"
"body":"category_exists( ${1:\\$cat_name}${2:, \\$parent = null} )"
"Makes sure that a user was referred from another admin page.":
"prefix":"check_admin_referer"
"body":"check_admin_referer( ${1:\\$action = -1}${2:, \\$query_arg = '_wpnonce'} )"
"Verifies the Ajax request to prevent processing requests external of the blog.":
"prefix":"check_ajax_referer"
"body":"check_ajax_referer( ${1:\\$action = -1}${2:, \\$query_arg = false}${3:, \\$die = true} )"
"Publish future post and make sure post ID has future post status.":
"prefix":"check_and_publish_future_post"
"body":"check_and_publish_future_post( ${1:\\$post_id} )"
"Check column matches criteria.":
"prefix":"check_column"
"body":"check_column( ${1:\\$table_name}${2:, \\$col_name}${3:, \\$col_type}${4:, \\$is_null = null}${5:, \\$key = null}${6:, \\$default = null}${7:, \\$extra = null} )"
"Check whether a comment passes internal checks to be allowed to add.":
"prefix":"check_comment"
"body":"check_comment( ${1:\\$author}${2:, \\$email}${3:, \\$url}${4:, \\$comment}${5:, \\$user_ip}${6:, \\$user_agent}${7:, \\$comment_type} )"
"Hooks WP's native database-based comment-flood check.":
"prefix":"check_comment_flood_db"
"body":"check_comment_flood_db()"
"Checks if the current user has permissions to import new users.":
"prefix":"check_import_new_users"
"body":"check_import_new_users( ${1:\\$permission} )"
"Retrieves a user row based on password reset key and login":
"prefix":"check_password_reset_key"
"body":"check_password_reset_key( ${1:\\$key}${2:, \\$login} )"
"Checks if a theme has been changed and runs 'after_switch_theme' hook on the next WP load.":
"prefix":"check_theme_switched"
"body":"check_theme_switched()"
"Check an array of MIME types against a whitelist.":
"prefix":"check_upload_mimes"
"body":"check_upload_mimes( ${1:\\$mimes} )"
"Determine if uploaded file exceeds space quota.":
"prefix":"check_upload_size"
"body":"check_upload_size( ${1:\\$file} )"
"Outputs the html checked attribute.":
"prefix":"checked"
"body":"checked( ${1:\\$checked}${2:, \\$current = true}${3:, \\$echo = true} )"
"Handles the display of choosing a user's primary site.":
"prefix":"choose_primary_blog"
"body":"choose_primary_blog()"
"Will clean the attachment in the cache.":
"prefix":"clean_attachment_cache"
"body":"clean_attachment_cache( ${1:\\$id}${2:, \\$clean_terms = false} )"
"Clean the blog cache":
"prefix":"clean_blog_cache"
"body":"clean_blog_cache( ${1:\\$blog} )"
"Deletes the bookmark cache.":
"prefix":"clean_bookmark_cache"
"body":"clean_bookmark_cache( ${1:\\$bookmark_id} )"
"Remove the category cache data based on ID.":
"prefix":"clean_category_cache"
"body":"clean_category_cache( ${1:\\$id} )"
"Removes a comment from the object cache.":
"prefix":"clean_comment_cache"
"body":"clean_comment_cache( ${1:\\$ids} )"
"Removes a network from the object cache.":
"prefix":"clean_network_cache"
"body":"clean_network_cache( ${1:\\$ids} )"
"Removes the taxonomy relationship to terms from the cache.":
"prefix":"clean_object_term_cache"
"body":"clean_object_term_cache( ${1:\\$object_ids}${2:, \\$object_type} )"
"Will clean the page in the cache.":
"prefix":"clean_page_cache"
"body":"clean_page_cache( ${1:\\$id} )"
"Will clean the post in the cache.":
"prefix":"clean_post_cache"
"body":"clean_post_cache( ${1:\\$post} )"
"Accepts matches array from preg_replace_callback in wpautop() or a string.":
"prefix":"clean_pre"
"body":"clean_pre( ${1:\\$matches} )"
"Cleans the site details cache for a site.":
"prefix":"clean_site_details_cache"
"body":"clean_site_details_cache( ${1:\\$site_id} )"
"Clean the caches for a taxonomy.":
"prefix":"clean_taxonomy_cache"
"body":"clean_taxonomy_cache( ${1:\\$taxonomy} )"
"Will remove all of the term ids from the cache.":
"prefix":"clean_term_cache"
"body":"clean_term_cache( ${1:\\$ids}${2:, \\$taxonomy = ''}${3:, \\$clean_taxonomy = true} )"
"Checks and cleans a URLr":
"prefix":"clean_url"
"body":"clean_url( ${1:\\$url}${2:, \\$protocols = null}${3:, \\$context = 'display'} )"
"Clean all user caches":
"prefix":"clean_user_cache"
"body":"clean_user_cache( ${1:\\$user} )"
"Deprecated functionality to clear the global post cache.":
"prefix":"clear_global_post_cache"
"body":"clear_global_post_cache( ${1:\\$post_id} )"
"Adds JavaScript required to make CodePress work on the theme/plugin editors.":
"prefix":"codepress_footer_js"
"body":"codepress_footer_js()"
"Determines the language to use for CodePress syntax highlighting.":
"prefix":"codepress_get_lang"
"body":"codepress_get_lang( ${1:\\$filename} )"
"Displays the author of the current comment.":
"prefix":"comment_author"
"body":"comment_author( ${1:\\$comment_ID} )"
"Display the email of the author of the current global $comment.":
"prefix":"comment_author_email"
"body":"comment_author_email( ${1:\\$comment_ID} )"
"Display the html email link to the author of the current comment.":
"prefix":"comment_author_email_link"
"body":"comment_author_email_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment = null} )"
"Display the IP address of the author of the current comment.":
"prefix":"comment_author_ip"
"body":"comment_author_ip( ${1:\\$comment_ID} )"
"Display the html link to the url of the author of the current comment.":
"prefix":"comment_author_link"
"body":"comment_author_link( ${1:\\$comment_ID} )"
"Display the current comment author in the feed.":
"prefix":"comment_author_rss"
"body":"comment_author_rss()"
"Display the url of the author of the current comment.":
"prefix":"comment_author_url"
"body":"comment_author_url( ${1:\\$comment_ID} )"
"Displays the HTML link of the url of the author of the current comment.":
"prefix":"comment_author_url_link"
"body":"comment_author_url_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment} )"
"Generates semantic classes for each comment element.":
"prefix":"comment_class"
"body":"comment_class( ${1:\\$class = ''}${2:, \\$comment = null}${3:, \\$post_id = null}${4:, \\$echo = true} )"
"Display the comment date of the current comment.":
"prefix":"comment_date"
"body":"comment_date( ${1:\\$d = ''}${2:, \\$comment_ID} )"
"Display the excerpt of the current comment.":
"prefix":"comment_excerpt"
"body":"comment_excerpt( ${1:\\$comment_ID} )"
"Determine if a comment exists based on author and date.":
"prefix":"comment_exists"
"body":"comment_exists( ${1:\\$comment_author}${2:, \\$comment_date}${3:, \\$timezone = 'blog'} )"
"Display error message at bottom of comments.":
"prefix":"comment_footer_die"
"body":"comment_footer_die( ${1:\\$msg} )"
"Outputs a complete commenting form for use within a template.":
"prefix":"comment_form"
"body":"comment_form( ${1:\\$args = array()}${2:, \\$post_id = null} )"
"Display text based on comment reply status.":
"prefix":"comment_form_title"
"body":"comment_form_title( ${1:\\$noreplytext = false}${2:, \\$replytext = false}${3:, \\$linktoparent = true} )"
"Display the feed GUID for the current comment.":
"prefix":"comment_guid"
"body":"comment_guid( ${1:\\$comment_id = null} )"
"Display the comment id of the current comment.":
"prefix":"comment_id"
"body":"comment_id()"
"Output hidden input HTML for replying to comments.":
"prefix":"comment_id_fields"
"body":"comment_id_fields( ${1:\\$id} )"
"Display the link to the comments.":
"prefix":"comment_link"
"body":"comment_link( ${1:\\$comment = null} )"
"Displays the HTML content for reply to comment link.":
"prefix":"comment_reply_link"
"body":"comment_reply_link( ${1:\\$args = array()}${2:, \\$comment = null}${3:, \\$post = null} )"
"Display the text of the current comment.":
"prefix":"comment_text"
"body":"comment_text( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Display the current comment content for use in the feeds.":
"prefix":"comment_text_rss"
"body":"comment_text_rss()"
"Display the comment time of the current comment.":
"prefix":"comment_time"
"body":"comment_time( ${1:\\$d = ''} )"
"Display the comment type of the current comment.":
"prefix":"comment_type"
"body":"comment_type( ${1:\\$commenttxt = false}${2:, \\$trackbacktxt = false}${3:, \\$pingbacktxt = false} )"
"Display the link to the current post comments.":
"prefix":"comments_link"
"body":"comments_link( ${1:\\$deprecated = ''}${2:, \\$deprecated_2 = ''} )"
"Outputs the link to the comments for the current post in an xml safe way":
"prefix":"comments_link_feed"
"body":"comments_link_feed()"
"Display the language string for the number of comments the current post has.":
"prefix":"comments_number"
"body":"comments_number( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false}${4:, \\$deprecated = ''} )"
"Whether the current post is open for comments.":
"prefix":"comments_open"
"body":"comments_open( ${1:\\$post_id = null} )"
"Displays the link to the comments for the current post ID.":
"prefix":"comments_popup_link"
"body":"comments_popup_link( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false}${4:, \\$css_class = ''}${5:, \\$none = false} )"
"Display the JS popup script to show a comment.":
"prefix":"comments_popup_script"
"body":"comments_popup_script()"
"Return link to the post RSS feed.":
"prefix":"comments_rss"
"body":"comments_rss()"
"Print RSS comment feed link.":
"prefix":"comments_rss_link"
"body":"comments_rss_link( ${1:\\$link_text = 'Comments RSS'} )"
"Load the comment template specified in $file.":
"prefix":"comments_template"
"body":"comments_template( ${1:\\$file = '/comments.php'}${2:, \\$separate_comments = false} )"
"Test support for compressing JavaScript from PHP":
"prefix":"compression_test"
"body":"compression_test()"
"Confirm a new site signup.":
"prefix":"confirm_another_blog_signup"
"body":"confirm_another_blog_signup( ${1:\\$domain}${2:, \\$path}${3:, \\$blog_title}${4:, \\$user_name}${5:, \\$user_email = ''}${6:, \\$meta = array()}${7:, \\$blog_id} )"
"New site signup confirmation":
"prefix":"confirm_blog_signup"
"body":"confirm_blog_signup( ${1:\\$domain}${2:, \\$path}${3:, \\$blog_title}${4:, \\$user_name = ''}${5:, \\$user_email = ''}${6:, \\$meta = array()} )"
"confirm_delete_users":
"prefix":"confirm_delete_users"
"body":"confirm_delete_users( ${1:\\$users} )"
"New user signup confirmation":
"prefix":"confirm_user_signup"
"body":"confirm_user_signup( ${1:\\$user_name}${2:, \\$user_email} )"
"Retrieves the URL to the content directory.":
"prefix":"content_url"
"body":"content_url( ${1:\\$path = ''} )"
"Converts lone & characters into `&#038;` (a.k.a. `&amp;`)":
"prefix":"convert_chars"
"body":"convert_chars( ${1:\\$content}${2:, \\$deprecated = ''} )"
"Converts invalid Unicode references range to valid range.":
"prefix":"convert_invalid_entities"
"body":"convert_invalid_entities( ${1:\\$content} )"
"Convert text equivalent of smilies to images.":
"prefix":"convert_smilies"
"body":"convert_smilies( ${1:\\$text} )"
"Convert a screen string to a screen object":
"prefix":"convert_to_screen"
"body":"convert_to_screen( ${1:\\$hook_name} )"
"Copies a directory from one location to another via the WordPress Filesystem Abstraction.":
"prefix":"copy_dir"
"body":"copy_dir( ${1:\\$from}${2:, \\$to}${3:, \\$skip_list = array()} )"
"core_update_footer":
"prefix":"core_update_footer"
"body":"core_update_footer( ${1:\\$msg = ''} )"
"Display upgrade WordPress for downloading latest or upgrading automatically form.":
"prefix":"core_upgrade_preamble"
"body":"core_upgrade_preamble()"
"Number of posts written by a list of users.":
"prefix":"count_many_users_posts"
"body":"count_many_users_posts( ${1:\\$users}${2:, \\$post_type = 'post'}${3:, \\$public_only = false} )"
"Number of posts user has written.":
"prefix":"count_user_posts"
"body":"count_user_posts( ${1:\\$userid}${2:, \\$post_type = 'post'}${3:, \\$public_only = false} )"
"Count number of users who have each of the user roles.":
"prefix":"count_users"
"body":"count_users( ${1:\\$strategy = 'time'} )"
"Create an empty blog.":
"prefix":"create_empty_blog"
"body":"create_empty_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$weblog_title}${4:, \\$site_id = 1} )"
"Creates the initial post types when 'init' action is fired.":
"prefix":"create_initial_post_types"
"body":"create_initial_post_types()"
"Registers default REST API routes.":
"prefix":"create_initial_rest_routes"
"body":"create_initial_rest_routes()"
"Creates the initial taxonomies.":
"prefix":"create_initial_taxonomies"
"body":"create_initial_taxonomies()"
"An alias of wp_create_user().":
"prefix":"create_user"
"body":"create_user( ${1:\\$username}${2:, \\$password}${3:, \\$email} )"
"Retrieve the name of the current action.":
"prefix":"current_action"
"body":"current_action()"
"Retrieve the name of the current filter or action.":
"prefix":"current_filter"
"body":"current_filter()"
"Retrieves information on the current active theme.":
"prefix":"current_theme_info"
"body":"current_theme_info()"
"Checks a theme's support for a given feature":
"prefix":"current_theme_supports"
"body":"current_theme_supports( ${1:\\$feature} )"
"Retrieve the current time based on specified type.":
"prefix":"current_time"
"body":"current_time( ${1:\\$type}${2:, \\$gmt} )"
"Whether the current user has a specific capability.":
"prefix":"current_user_can"
"body":"current_user_can( ${1:\\$capability}${2:, \\$object_id} )"
"Whether current user has a capability or role for a given site.":
"prefix":"current_user_can_for_blog"
"body":"current_user_can_for_blog( ${1:\\$blog_id}${2:, \\$capability} )"
"Print JS templates for the theme-browsing UI in the Customizer.":
"prefix":"customize_themes_print_templates"
"body":"customize_themes_print_templates()"
"dashboard_browser_nag_class":
"prefix":"dashboard_browser_nag_class"
"body":"dashboard_browser_nag_class( ${1:\\$classes} )"
"Retrieve the date in localized format, based on timestamp.":
"prefix":"date_i18n"
"body":"date_i18n( ${1:\\$dateformatstring}${2:, \\$unixtimestamp = false}${3:, \\$gmt = false} )"
"Modifies the database based on specified SQL statements.":
"prefix":"dbdelta"
"body":"dbdelta( ${1:\\$queries = ''}${2:, \\$execute = true} )"
"Deactivate a single plugin or multiple plugins.":
"prefix":"deactivate_plugins"
"body":"deactivate_plugins( ${1:\\$plugins}${2:, \\$silent = false}${3:, \\$network_wide = null} )"
"Deprecated functionality for deactivating a network-only plugin.":
"prefix":"deactivate_sitewide_plugin"
"body":"deactivate_sitewide_plugin()"
"Load custom DB error or display WordPress DB error.":
"prefix":"dead_db"
"body":"dead_db()"
"Close the debugging file handle.":
"prefix":"debug_fclose"
"body":"debug_fclose( ${1:\\$fp} )"
"Open the file handle for debugging.":
"prefix":"debug_fopen"
"body":"debug_fopen( ${1:\\$filename}${2:, \\$mode} )"
"Write contents to the file used for debugging.":
"prefix":"debug_fwrite"
"body":"debug_fwrite( ${1:\\$fp}${2:, \\$string} )"
"default_password_nag":
"prefix":"default_password_nag"
"body":"default_password_nag()"
"default_password_nag_edit_user":
"prefix":"default_password_nag_edit_user"
"body":"default_password_nag_edit_user( ${1:\\$user_ID}${2:, \\$old_data} )"
"default_password_nag_handler":
"prefix":"default_password_nag_handler"
"body":"default_password_nag_handler( ${1:\\$errors = false} )"
"Default topic count scaling for tag links.":
"prefix":"default_topic_count_scale"
"body":"default_topic_count_scale( ${1:\\$count} )"
"Old callback for tag link tooltips.":
"prefix":"default_topic_count_text"
"body":"default_topic_count_text( ${1:\\$count} )"
"Delete the user settings of the current user.":
"prefix":"delete_all_user_settings"
"body":"delete_all_user_settings()"
"Removes option by name for a given blog id. Prevents removal of protected WordPress options.":
"prefix":"delete_blog_option"
"body":"delete_blog_option( ${1:\\$id}${2:, \\$option} )"
"Remove metadata matching criteria from a comment.":
"prefix":"delete_comment_meta"
"body":"delete_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Purge the cached results of get_calendar.":
"prefix":"delete_get_calendar_cache"
"body":"delete_get_calendar_cache()"
"Delete post meta data by meta ID.":
"prefix":"delete_meta"
"body":"delete_meta( ${1:\\$mid} )"
"Delete metadata for the specified object.":
"prefix":"delete_metadata"
"body":"delete_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value = ''}${5:, \\$delete_all = false} )"
"Delete meta data by meta ID":
"prefix":"delete_metadata_by_mid"
"body":"delete_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id} )"
"Removes a network option by name.":
"prefix":"delete_network_option"
"body":"delete_network_option( ${1:\\$network_id}${2:, \\$option} )"
"Removes option by name. Prevents removal of protected WordPress options.":
"prefix":"delete_option"
"body":"delete_option( ${1:\\$option} )"
"Remove directory and files of a plugin for a list of plugins.":
"prefix":"delete_plugins"
"body":"delete_plugins( ${1:\\$plugins}${2:, \\$deprecated = ''} )"
"Remove metadata matching criteria from a post.":
"prefix":"delete_post_meta"
"body":"delete_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Delete everything from post meta matching meta key.":
"prefix":"delete_post_meta_by_key"
"body":"delete_post_meta_by_key( ${1:\\$post_meta_key} )"
"Remove a post thumbnail.":
"prefix":"delete_post_thumbnail"
"body":"delete_post_thumbnail( ${1:\\$post} )"
"Removes a option by name for the current network.":
"prefix":"delete_site_option"
"body":"delete_site_option( ${1:\\$option} )"
"Delete a site transient.":
"prefix":"delete_site_transient"
"body":"delete_site_transient( ${1:\\$transient} )"
"Removes metadata matching criteria from a term.":
"prefix":"delete_term_meta"
"body":"delete_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Remove a theme":
"prefix":"delete_theme"
"body":"delete_theme( ${1:\\$stylesheet}${2:, \\$redirect = ''} )"
"Delete a transient.":
"prefix":"delete_transient"
"body":"delete_transient( ${1:\\$transient} )"
"Remove metadata matching criteria from a user.":
"prefix":"delete_user_meta"
"body":"delete_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Delete user option with global blog capability.":
"prefix":"delete_user_option"
"body":"delete_user_option( ${1:\\$user_id}${2:, \\$option_name}${3:, \\$global = false} )"
"Delete user interface settings.":
"prefix":"delete_user_setting"
"body":"delete_user_setting( ${1:\\$names} )"
"Remove user meta data.":
"prefix":"delete_usermeta"
"body":"delete_usermeta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"delete_users_add_js":
"prefix":"delete_users_add_js"
"body":"delete_users_add_js()"
"Filters for content to remove unnecessary slashes.":
"prefix":"deslash"
"body":"deslash( ${1:\\$content} )"
"Retrieve the number of times an action is fired.":
"prefix":"did_action"
"body":"did_action( ${1:\\$tag} )"
"Outputs the html disabled attribute.":
"prefix":"disabled"
"body":"disabled( ${1:\\$disabled}${2:, \\$current = true}${3:, \\$echo = true} )"
"Finds a pingback server URI based on the given URL.":
"prefix":"discover_pingback_server_uri"
"body":"discover_pingback_server_uri( ${1:\\$url}${2:, \\$deprecated = ''} )"
"dismiss_core_update":
"prefix":"dismiss_core_update"
"body":"dismiss_core_update( ${1:\\$update} )"
"dismissed_updates":
"prefix":"dismissed_updates"
"body":"dismissed_updates()"
"Display install header.":
"prefix":"display_header"
"body":"display_header( ${1:\\$body_classes = ''} )"
"Whether to display the header text.":
"prefix":"display_header_text"
"body":"display_header_text()"
"Display plugin content based on plugin list.":
"prefix":"display_plugins_table"
"body":"display_plugins_table()"
"Display installer setup form.":
"prefix":"display_setup_form"
"body":"display_setup_form( ${1:\\$error = null} )"
"Displays the amount of disk space used by the current site. Not used in core.":
"prefix":"display_space_usage"
"body":"display_space_usage()"
"Prints a theme on the Install Themes pages.":
"prefix":"display_theme"
"body":"display_theme( ${1:\\$theme} )"
"Display theme content based on theme list.":
"prefix":"display_themes"
"body":"display_themes()"
"Meta Box Accordion Template Function":
"prefix":"do_accordion_sections"
"body":"do_accordion_sections( ${1:\\$screen}${2:, \\$context}${3:, \\$object} )"
"Execute functions hooked on a specific action hook.":
"prefix":"do_action"
"body":"do_action( ${1:\\$tag}${2:, \\$arg,... = ''} )"
"Fires functions attached to a deprecated action hook.":
"prefix":"do_action_deprecated"
"body":"do_action_deprecated( ${1:\\$tag}${2:, \\$args}${3:, \\$version}${4:, \\$replacement = false}${5:, \\$message = null} )"
"Execute functions hooked on a specific action hook, specifying arguments in an array.":
"prefix":"do_action_ref_array"
"body":"do_action_ref_array( ${1:\\$tag}${2:, \\$args} )"
"Adds an action hook specific to this page.":
"prefix":"do_activate_header"
"body":"do_activate_header()"
"Perform all pingbacks, enclosures, trackbacks, and send to pingback services.":
"prefix":"do_all_pings"
"body":"do_all_pings()"
"Upgrade WordPress core display.":
"prefix":"do_core_upgrade"
"body":"do_core_upgrade( ${1:\\$reinstall = false} )"
"do_dismiss_core_update":
"prefix":"do_dismiss_core_update"
"body":"do_dismiss_core_update()"
"Check content for video and audio links to add as enclosures.":
"prefix":"do_enclose"
"body":"do_enclose( ${1:\\$content}${2:, \\$post_ID} )"
"Load the feed template from the use of an action hook.":
"prefix":"do_feed"
"body":"do_feed()"
"Load either Atom comment feed or Atom posts feed.":
"prefix":"do_feed_atom"
"body":"do_feed_atom( ${1:\\$for_comments} )"
"Load the RDF RSS 0.91 Feed template.":
"prefix":"do_feed_rdf"
"body":"do_feed_rdf()"
"Load the RSS 1.0 Feed Template.":
"prefix":"do_feed_rss"
"body":"do_feed_rss()"
"Load either the RSS2 comment feed or the RSS2 posts feed.":
"prefix":"do_feed_rss2"
"body":"do_feed_rss2( ${1:\\$for_comments} )"
"Meta-Box template function":
"prefix":"do_meta_boxes"
"body":"do_meta_boxes( ${1:\\$screen}${2:, \\$context}${3:, \\$object} )"
"Display the robots.txt file content.":
"prefix":"do_robots"
"body":"do_robots()"
"Print out the settings fields for a particular settings section":
"prefix":"do_settings_fields"
"body":"do_settings_fields( ${1:\\$page}${2:, \\$section} )"
"Prints out all settings sections added to a particular settings page":
"prefix":"do_settings_sections"
"body":"do_settings_sections( ${1:\\$page} )"
"Search content for shortcodes and filter shortcodes through their hooks.":
"prefix":"do_shortcode"
"body":"do_shortcode( ${1:\\$content}${2:, \\$ignore_html = false} )"
"Regular Expression callable for do_shortcode() for calling shortcode hook.":
"prefix":"do_shortcode_tag"
"body":"do_shortcode_tag( ${1:\\$m} )"
"Search only inside HTML elements for shortcodes and process them.":
"prefix":"do_shortcodes_in_html_tags"
"body":"do_shortcodes_in_html_tags( ${1:\\$content}${2:, \\$ignore_html}${3:, \\$tagnames} )"
"Prints signup_header via wp_head":
"prefix":"do_signup_header"
"body":"do_signup_header()"
"Perform trackbacks.":
"prefix":"do_trackbacks"
"body":"do_trackbacks( ${1:\\$post_id} )"
"do_undismiss_core_update":
"prefix":"do_undismiss_core_update"
"body":"do_undismiss_core_update()"
"Unused Admin function.":
"prefix":"documentation_link"
"body":"documentation_link()"
"Retrieve the name of an action currently being processed.":
"prefix":"doing_action"
"body":"doing_action( ${1:\\$action = null} )"
"Retrieve the name of a filter currently being processed.":
"prefix":"doing_filter"
"body":"doing_filter( ${1:\\$filter = null} )"
"Check whether a blogname is already taken.":
"prefix":"domain_exists"
"body":"domain_exists( ${1:\\$domain}${2:, \\$path}${3:, \\$site_id = 1} )"
"Downloads a URL to a local temporary file using the WordPress HTTP Class.":
"prefix":"download_url"
"body":"download_url( ${1:\\$url}${2:, \\$timeout = 300} )"
"Drops a specified index from a table.":
"prefix":"drop_index"
"body":"drop_index( ${1:\\$table}${2:, \\$index} )"
"Legacy function used to generate the categories checklist control.":
"prefix":"dropdown_categories"
"body":"dropdown_categories( ${1:\\$default}${2:, \\$parent}${3:, \\$popular_ids = array()} )"
"Deprecated method for generating a drop-down of categories.":
"prefix":"dropdown_cats"
"body":"dropdown_cats( ${1:\\$optionall = 1}${2:, \\$all = 'All'}${3:, \\$orderby = 'ID'}${4:, \\$order = 'asc'}${5:, \\$show_last_update}${6:, \\$show_count}${7:, \\$hide_empty = 1}${8:, \\$optionnone = false}${9:, \\$selected}${10:, \\$exclude} )"
"Legacy function used to generate a link categories checklist control.":
"prefix":"dropdown_link_categories"
"body":"dropdown_link_categories( ${1:\\$default} )"
"Display dynamic sidebar.":
"prefix":"dynamic_sidebar"
"body":"dynamic_sidebar( ${1:\\$index = 1} )"
"Displays the edit bookmark link anchor content.":
"prefix":"edit_bookmark_link"
"body":"edit_bookmark_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$bookmark = null} )"
"Update a comment with values provided in $_POST.":
"prefix":"edit_comment"
"body":"edit_comment()"
"Displays the edit comment link with formatting.":
"prefix":"edit_comment_link"
"body":"edit_comment_link( ${1:\\$text = null}${2:, \\$before = ''}${3:, \\$after = ''} )"
"Displays the image and editor in the post editor":
"prefix":"edit_form_image_editor"
"body":"edit_form_image_editor( ${1:\\$post} )"
"Updates or inserts a link using values provided in $_POST.":
"prefix":"edit_link"
"body":"edit_link( ${1:\\$link_id} )"
"Update an existing post with values provided in $_POST.":
"prefix":"edit_post"
"body":"edit_post( ${1:\\$post_data = null} )"
"Displays the edit post link for post.":
"prefix":"edit_post_link"
"body":"edit_post_link( ${1:\\$text = null}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$id}${5:, \\$class = 'post-edit-link'} )"
"Displays or retrieves the edit link for a tag with formatting.":
"prefix":"edit_tag_link"
"body":"edit_tag_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$tag = null} )"
"Displays or retrieves the edit term link with formatting.":
"prefix":"edit_term_link"
"body":"edit_term_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$term = null}${5:, \\$echo = true} )"
"Edit user settings based on contents of $_POST":
"prefix":"edit_user"
"body":"edit_user( ${1:\\$user_id} )"
"Checks whether the given email exists.":
"prefix":"email_exists"
"body":"email_exists( ${1:\\$email} )"
"XML callback function that is called at the end of a XML tag.":
"prefix":"endelement"
"body":"endelement( ${1:\\$parser}${2:, \\$tagName} )"
"enqueue_comment_hotkeys_js":
"prefix":"enqueue_comment_hotkeys_js"
"body":"enqueue_comment_hotkeys_js()"
"Enqueue embed iframe default CSS and JS & fire do_action('enqueue_embed_scripts')":
"prefix":"enqueue_embed_scripts"
"body":"enqueue_embed_scripts()"
"Converts named entities into numbered entities.":
"prefix":"ent2ncr"
"body":"ent2ncr( ${1:\\$text} )"
"Escaping for HTML attributes.":
"prefix":"esc_attr"
"body":"esc_attr( ${1:\\$text} )"
"Retrieve the translation of $text and escapes it for safe use in an attribute.":
"prefix":"esc_attr__"
"body":"esc_attr__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated text that has been escaped for safe use in an attribute.":
"prefix":"esc_attr_e"
"body":"esc_attr_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate string with gettext context, and escapes it for safe use in an attribute.":
"prefix":"esc_attr_x"
"body":"esc_attr_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Escaping for HTML blocks.":
"prefix":"esc_html"
"body":"esc_html( ${1:\\$text} )"
"Retrieve the translation of $text and escapes it for safe use in HTML output.":
"prefix":"esc_html__"
"body":"esc_html__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated text that has been escaped for safe use in HTML output.":
"prefix":"esc_html_e"
"body":"esc_html_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate string with gettext context, and escapes it for safe use in HTML output.":
"prefix":"esc_html_x"
"body":"esc_html_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Escape single quotes, htmlspecialchar " < > &, and fix line endings.":
"prefix":"esc_js"
"body":"esc_js( ${1:\\$text} )"
"Escapes data for use in a MySQL query.":
"prefix":"esc_sql"
"body":"esc_sql( ${1:\\$data} )"
"Escaping for textarea values.":
"prefix":"esc_textarea"
"body":"esc_textarea( ${1:\\$text} )"
"Checks and cleans a URL.":
"prefix":"esc_url"
"body":"esc_url( ${1:\\$url}${2:, \\$protocols = null}${3:, \\$_context = 'display'} )"
"Performs esc_url() for database usage.":
"prefix":"esc_url_raw"
"body":"esc_url_raw( ${1:\\$url}${2:, \\$protocols = null} )"
"Display JavaScript on the page.":
"prefix":"export_add_js"
"body":"export_add_js()"
"Create the date options fields for exporting a given post type.":
"prefix":"export_date_options"
"body":"export_date_options( ${1:\\$post_type = 'post'} )"
"Generates the WXR export file for download.":
"prefix":"export_wp"
"body":"export_wp( ${1:\\$args = array()} )"
"Extracts strings from between the BEGIN and END markers in the .htaccess file.":
"prefix":"extract_from_markers"
"body":"extract_from_markers( ${1:\\$filename}${2:, \\$marker} )"
"Favorite actions were deprecated in version 3.2. Use the admin bar instead.":
"prefix":"favorite_actions"
"body":"favorite_actions()"
"Return the content type for specified feed type.":
"prefix":"feed_content_type"
"body":"feed_content_type( ${1:\\$type = ''} )"
"Display the links to the general feeds.":
"prefix":"feed_links"
"body":"feed_links( ${1:\\$args = array()} )"
"Display the links to the extra feeds such as category feeds.":
"prefix":"feed_links_extra"
"body":"feed_links_extra( ${1:\\$args = array()} )"
"Build SimplePie object based on RSS or Atom feed from URL.":
"prefix":"fetch_feed"
"body":"fetch_feed( ${1:\\$url} )"
"Build Magpie object based on RSS from URL.":
"prefix":"fetch_rss"
"body":"fetch_rss( ${1:\\$url} )"
"Validate that file is suitable for displaying within a web page.":
"prefix":"file_is_displayable_image"
"body":"file_is_displayable_image( ${1:\\$path} )"
"Validate that file is an image.":
"prefix":"file_is_valid_image"
"body":"file_is_valid_image( ${1:\\$path} )"
"Filter the default value for the option.":
"prefix":"filter_default_option"
"body":"filter_default_option( ${1:\\$default}${2:, \\$option}${3:, \\$passed_default} )"
"Formats a URL to use https.":
"prefix":"filter_ssl"
"body":"filter_ssl( ${1:\\$url} )"
"Gets the best available (and enabled) Auto-Update for WordPress Core.":
"prefix":"find_core_auto_update"
"body":"find_core_auto_update()"
"find_core_update":
"prefix":"find_core_update"
"body":"find_core_update( ${1:\\$version}${2:, \\$locale} )"
"Outputs the modal window used for attaching media to posts or pages in the media-listing screen.":
"prefix":"find_posts_div"
"body":"find_posts_div( ${1:\\$found_action = ''} )"
"Get the remaining upload space for this site.":
"prefix":"fix_import_form_size"
"body":"fix_import_form_size( ${1:\\$size} )"
"Correct From host on outgoing mail to match the site domain":
"prefix":"fix_phpmailer_messageid"
"body":"fix_phpmailer_messageid( ${1:\\$phpmailer} )"
"Add avatars to relevant places in admin, or try to.":
"prefix":"floated_admin_avatar"
"body":"floated_admin_avatar( ${1:\\$name} )"
"Remove rewrite rules and then recreate rewrite rules.":
"prefix":"flush_rewrite_rules"
"body":"flush_rewrite_rules( ${1:\\$hard = true} )"
"Balances tags of string using a modified stack.":
"prefix":"force_balance_tags"
"body":"force_balance_tags( ${1:\\$text} )"
"Whether to force SSL used for the Administration Screens.":
"prefix":"force_ssl_admin"
"body":"force_ssl_admin( ${1:\\$force = null} )"
"Whether to force SSL on content.":
"prefix":"force_ssl_content"
"body":"force_ssl_content( ${1:\\$force = ''} )"
"Whether SSL login should be forced.":
"prefix":"force_ssl_login"
"body":"force_ssl_login( ${1:\\$force = null} )"
"Print option value after sanitizing for forms.":
"prefix":"form_option"
"body":"form_option( ${1:\\$option} )"
"Returns the language for a language code.":
"prefix":"format_code_lang"
"body":"format_code_lang( ${1:\\$code = ''} )"
"Formats text for the editor.":
"prefix":"format_for_editor"
"body":"format_for_editor( ${1:\\$text}${2:, \\$default_editor = null} )"
"Acts on text which is about to be edited.":
"prefix":"format_to_edit"
"body":"format_to_edit( ${1:\\$content}${2:, \\$rich_text = false} )"
"Formerly used to escape strings before inserting into the DB.":
"prefix":"format_to_post"
"body":"format_to_post( ${1:\\$content} )"
"Callback used to change %uXXXX to &#YYY; syntax":
"prefix":"funky_javascript_callback"
"body":"funky_javascript_callback( ${1:\\$matches} )"
"Fixes JavaScript bugs in browsers.":
"prefix":"funky_javascript_fix"
"body":"funky_javascript_fix( ${1:\\$text} )"
"Builds the Gallery shortcode output.":
"prefix":"gallery_shortcode"
"body":"gallery_shortcode( ${1:\\$attr} )"
"Check if the installed version of GD supports particular image type":
"prefix":"gd_edit_image_support"
"body":"gd_edit_image_support( ${1:\\$mime_type} )"
"Generates a random password.":
"prefix":"generate_random_password"
"body":"generate_random_password( ${1:\\$len = 8} )"
"Sends pings to all of the ping site services.":
"prefix":"generic_ping"
"body":"generic_ping( ${1:\\$post_id} )"
"Retrieve path of 404 template in current or parent template.":
"prefix":"get_404_template"
"body":"get_404_template()"
"Get one of a user's active blogs":
"prefix":"get_active_blog_for_user"
"body":"get_active_blog_for_user( ${1:\\$user_id} )"
"Retrieves the adjacent post.":
"prefix":"get_adjacent_post"
"body":"get_adjacent_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$previous = true}${4:, \\$taxonomy = 'category'} )"
"Retrieves the adjacent post link.":
"prefix":"get_adjacent_post_link"
"body":"get_adjacent_post_link( ${1:\\$format}${2:, \\$link}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$previous = true}${6:, \\$taxonomy = 'category'} )"
"Retrieves the adjacent post relational link.":
"prefix":"get_adjacent_post_rel_link"
"body":"get_adjacent_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$previous = true}${5:, \\$taxonomy = 'category'} )"
"get_admin_page_parent":
"prefix":"get_admin_page_parent"
"body":"get_admin_page_parent()"
"get_admin_page_title":
"prefix":"get_admin_page_title"
"body":"get_admin_page_title()"
"Retrieves the URL to the admin area for a given site.":
"prefix":"get_admin_url"
"body":"get_admin_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = 'admin'} )"
"Get the admin for a domain/path combination.":
"prefix":"get_admin_users_for_domain"
"body":"get_admin_users_for_domain( ${1:\\$sitedomain = ''}${2:, \\$path = ''} )"
"Retrieves all category IDs.":
"prefix":"get_all_category_ids"
"body":"get_all_category_ids()"
"Get a list of page IDs.":
"prefix":"get_all_page_ids"
"body":"get_all_page_ids()"
"Get all the post type features":
"prefix":"get_all_post_type_supports"
"body":"get_all_post_type_supports( ${1:\\$post_type} )"
"Retrieve all user interface settings.":
"prefix":"get_all_user_settings"
"body":"get_all_user_settings()"
"Retrieve all autoload options, or all options if no autoloaded ones exist.":
"prefix":"get_alloptions"
"body":"get_alloptions()"
"Retrieve all options as it was for 1.2.":
"prefix":"get_alloptions_110"
"body":"get_alloptions_110()"
"Retrieve list of allowed HTTP origins.":
"prefix":"get_allowed_http_origins"
"body":"get_allowed_http_origins()"
"Retrieve list of allowed mime types and file extensions.":
"prefix":"get_allowed_mime_types"
"body":"get_allowed_mime_types( ${1:\\$user = null} )"
"Get the allowed themes for the current site.":
"prefix":"get_allowed_themes"
"body":"get_allowed_themes()"
"Get an array of ancestor IDs for a given object.":
"prefix":"get_ancestors"
"body":"get_ancestors( ${1:\\$object_id}${2:, \\$object_type = ''}${3:, \\$resource_type = ''} )"
"Retrieve the approved comments for post $post_id.":
"prefix":"get_approved_comments"
"body":"get_approved_comments( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieve path of archive template in current or parent template.":
"prefix":"get_archive_template"
"body":"get_archive_template()"
"Retrieves a list of archives.":
"prefix":"get_archives"
"body":"get_archives( ${1:\\$type = ''}${2:, \\$limit = ''}${3:, \\$format = 'html'}${4:, \\$before = ''}${5:, \\$after = ''}${6:, \\$show_post_count = false} )"
"Retrieve archive link content based on predefined or custom code.":
"prefix":"get_archives_link"
"body":"get_archives_link( ${1:\\$url}${2:, \\$text}${3:, \\$format = 'html'}${4:, \\$before = ''}${5:, \\$after = ''} )"
"Retrieve attached file path based on attachment ID.":
"prefix":"get_attached_file"
"body":"get_attached_file( ${1:\\$attachment_id}${2:, \\$unfiltered = false} )"
"Retrieves media attached to the passed post.":
"prefix":"get_attached_media"
"body":"get_attached_media( ${1:\\$type}${2:, \\$post} )"
"Retrieves the attachment fields to edit form fields.":
"prefix":"get_attachment_fields_to_edit"
"body":"get_attachment_fields_to_edit( ${1:\\$post}${2:, \\$errors = null} )"
"Retrieve HTML content of icon attachment image element.":
"prefix":"get_attachment_icon"
"body":"get_attachment_icon( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false} )"
"Retrieve icon URL and Path.":
"prefix":"get_attachment_icon_src"
"body":"get_attachment_icon_src( ${1:\\$id}${2:, \\$fullsize = false} )"
"Retrieve HTML content of image element.":
"prefix":"get_attachment_innerhtml"
"body":"get_attachment_innerhtml( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false} )"
"Retrieves the permalink for an attachment.":
"prefix":"get_attachment_link"
"body":"get_attachment_link( ${1:\\$post = null}${2:, \\$leavename = false} )"
"Retrieves taxonomies attached to given the attachment.":
"prefix":"get_attachment_taxonomies"
"body":"get_attachment_taxonomies( ${1:\\$attachment}${2:, \\$output = 'names'} )"
"Retrieve path of attachment template in current or parent template.":
"prefix":"get_attachment_template"
"body":"get_attachment_template()"
"Retrieves the feed link for a given author.":
"prefix":"get_author_feed_link"
"body":"get_author_feed_link( ${1:\\$author_id}${2:, \\$feed = ''} )"
"Returns or Prints link to the author's posts.":
"prefix":"get_author_link"
"body":"get_author_link( ${1:\\$echo}${2:, \\$author_id}${3:, \\$author_nicename = ''} )"
"Retrieve the specified author's preferred display name.":
"prefix":"get_author_name"
"body":"get_author_name( ${1:\\$auth_id = false} )"
"Retrieve the URL to the author page for the user with the ID provided.":
"prefix":"get_author_posts_url"
"body":"get_author_posts_url( ${1:\\$author_id}${2:, \\$author_nicename = ''} )"
"Print/Return link to author RSS feed.":
"prefix":"get_author_rss_link"
"body":"get_author_rss_link( ${1:\\$echo = false}${2:, \\$author_id = 1} )"
"Retrieve path of author template in current or parent template.":
"prefix":"get_author_template"
"body":"get_author_template()"
"Get all user IDs.":
"prefix":"get_author_user_ids"
"body":"get_author_user_ids()"
"Gets the auto_toggle setting.":
"prefix":"get_autotoggle"
"body":"get_autotoggle( ${1:\\$id} )"
"Get all available languages based on the presence of *.mo files in a given directory.":
"prefix":"get_available_languages"
"body":"get_available_languages( ${1:\\$dir = null} )"
"Get all available post MIME types for a given post type.":
"prefix":"get_available_post_mime_types"
"body":"get_available_post_mime_types( ${1:\\$type = 'attachment'} )"
"Get all the possible statuses for a post_type":
"prefix":"get_available_post_statuses"
"body":"get_available_post_statuses( ${1:\\$type = 'post'} )"
"Retrieve the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post.":
"prefix":"get_avatar"
"body":"get_avatar( ${1:\\$id_or_email}${2:, \\$size = 96}${3:, \\$default = ''}${4:, \\$alt = ''}${5:, \\$args = null} )"
"Retrieves default data about the avatar.":
"prefix":"get_avatar_data"
"body":"get_avatar_data( ${1:\\$id_or_email}${2:, \\$args = null} )"
"Retrieves the avatar URL.":
"prefix":"get_avatar_url"
"body":"get_avatar_url( ${1:\\$id_or_email}${2:, \\$args = null} )"
"Retrieve value for custom background color.":
"prefix":"get_background_color"
"body":"get_background_color()"
"Retrieve background image for custom background.":
"prefix":"get_background_image"
"body":"get_background_image()"
"The number of active sites on your installation.":
"prefix":"get_blog_count"
"body":"get_blog_count( ${1:\\$network_id = null} )"
"Retrieve the details for a blog from the blogs table and blog options.":
"prefix":"get_blog_details"
"body":"get_blog_details( ${1:\\$fields = null}${2:, \\$get_all = true} )"
"Get a blog's numeric ID from its URL.":
"prefix":"get_blog_id_from_url"
"body":"get_blog_id_from_url( ${1:\\$domain}${2:, \\$path = '/'} )"
"Deprecated functionality to retrieve a list of all sites.":
"prefix":"get_blog_list"
"body":"get_blog_list( ${1:\\$start}${2:, \\$num = 10}${3:, \\$deprecated = ''} )"
"Retrieve option value for a given blog id based on name of option.":
"prefix":"get_blog_option"
"body":"get_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$default = false} )"
"Get the permalink for a post on another blog.":
"prefix":"get_blog_permalink"
"body":"get_blog_permalink( ${1:\\$blog_id}${2:, \\$post_id} )"
"Get a blog post from any site on the network.":
"prefix":"get_blog_post"
"body":"get_blog_post( ${1:\\$blog_id}${2:, \\$post_id} )"
"Get a blog details field.":
"prefix":"get_blog_status"
"body":"get_blog_status( ${1:\\$id}${2:, \\$pref} )"
"Get a full blog URL, given a domain and a path.":
"prefix":"get_blogaddress_by_domain"
"body":"get_blogaddress_by_domain( ${1:\\$domain}${2:, \\$path} )"
"Get a full blog URL, given a blog id.":
"prefix":"get_blogaddress_by_id"
"body":"get_blogaddress_by_id( ${1:\\$blog_id} )"
"Get a full blog URL, given a blog name.":
"prefix":"get_blogaddress_by_name"
"body":"get_blogaddress_by_name( ${1:\\$blogname} )"
"Retrieves information about the current site.":
"prefix":"get_bloginfo"
"body":"get_bloginfo( ${1:\\$show = ''}${2:, \\$filter = 'raw'} )"
"RSS container for the bloginfo function.":
"prefix":"get_bloginfo_rss"
"body":"get_bloginfo_rss( ${1:\\$show = ''} )"
"Get the sites a user belongs to.":
"prefix":"get_blogs_of_user"
"body":"get_blogs_of_user( ${1:\\$user_id}${2:, \\$all = false} )"
"Retrieve the classes for the body element as an array.":
"prefix":"get_body_class"
"body":"get_body_class( ${1:\\$class = ''} )"
"Retrieve Bookmark data":
"prefix":"get_bookmark"
"body":"get_bookmark( ${1:\\$bookmark}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve single bookmark data item or field.":
"prefix":"get_bookmark_field"
"body":"get_bookmark_field( ${1:\\$field}${2:, \\$bookmark}${3:, \\$context = 'display'} )"
"Retrieves the list of bookmarks":
"prefix":"get_bookmarks"
"body":"get_bookmarks( ${1:\\$args = ''} )"
"Retrieves the boundary post.":
"prefix":"get_boundary_post"
"body":"get_boundary_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$start = true}${4:, \\$taxonomy = 'category'} )"
"Get boundary post relational link.":
"prefix":"get_boundary_post_rel_link"
"body":"get_boundary_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_cat = false}${3:, \\$excluded_categories = ''}${4:, \\$start = true} )"
"Retrieves a list of broken themes.":
"prefix":"get_broken_themes"
"body":"get_broken_themes()"
"Display calendar with days that have posts as links.":
"prefix":"get_calendar"
"body":"get_calendar( ${1:\\$initial = true}${2:, \\$echo = true} )"
"Retrieve HTML content for cancel comment reply link.":
"prefix":"get_cancel_comment_reply_link"
"body":"get_cancel_comment_reply_link( ${1:\\$text = ''} )"
"Retrieve the ID of a category from its name.":
"prefix":"get_cat_id"
"body":"get_cat_id( ${1:\\$cat_name} )"
"Retrieve the name of a category from its ID.":
"prefix":"get_cat_name"
"body":"get_cat_name( ${1:\\$cat_id} )"
"Retrieve list of category objects.":
"prefix":"get_categories"
"body":"get_categories( ${1:\\$args = ''} )"
"Retrieves category data given a category ID or category object.":
"prefix":"get_category"
"body":"get_category( ${1:\\$category}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve category based on URL containing the category slug.":
"prefix":"get_category_by_path"
"body":"get_category_by_path( ${1:\\$category_path}${2:, \\$full_match = true}${3:, \\$output = OBJECT} )"
"Retrieve category object by category slug.":
"prefix":"get_category_by_slug"
"body":"get_category_by_slug( ${1:\\$slug} )"
"Retrieve category children list separated before and after the term IDs.":
"prefix":"get_category_children"
"body":"get_category_children( ${1:\\$id}${2:, \\$before = '/'}${3:, \\$after = ''}${4:, \\$visited = array()} )"
"Retrieves the feed link for a category.":
"prefix":"get_category_feed_link"
"body":"get_category_feed_link( ${1:\\$cat_id}${2:, \\$feed = ''} )"
"Retrieve category link URL.":
"prefix":"get_category_link"
"body":"get_category_link( ${1:\\$category} )"
"Retrieve category parents with separator.":
"prefix":"get_category_parents"
"body":"get_category_parents( ${1:\\$id}${2:, \\$link = false}${3:, \\$separator = '/'}${4:, \\$nicename = false}${5:, \\$deprecated = array()} )"
"Print/Return link to category RSS2 feed.":
"prefix":"get_category_rss_link"
"body":"get_category_rss_link( ${1:\\$echo = false}${2:, \\$cat_ID = 1} )"
"Retrieve path of category template in current or parent template.":
"prefix":"get_category_template"
"body":"get_category_template()"
"Get category object for given ID and 'edit' filter context.":
"prefix":"get_category_to_edit"
"body":"get_category_to_edit( ${1:\\$id} )"
"Retrieve the category name by the category ID.":
"prefix":"get_catname"
"body":"get_catname( ${1:\\$cat_ID} )"
"Retrieve all children of the post parent ID.":
"prefix":"get_children"
"body":"get_children( ${1:\\$args = ''}${2:, \\$output = OBJECT} )"
"Get base domain of network.":
"prefix":"get_clean_basedomain"
"body":"get_clean_basedomain()"
"Returns value of command line params.":
"prefix":"get_cli_args"
"body":"get_cli_args( ${1:\\$param}${2:, \\$required = false} )"
"Get the column headers for a screen":
"prefix":"get_column_headers"
"body":"get_column_headers( ${1:\\$screen} )"
"Retrieves comment data given a comment ID or comment object.":
"prefix":"get_comment"
"body":"get_comment( ${1:\\$comment = null}${2:, \\$output = OBJECT} )"
"Retrieve the author of the current comment.":
"prefix":"get_comment_author"
"body":"get_comment_author( ${1:\\$comment_ID} )"
"Retrieve the email of the author of the current comment.":
"prefix":"get_comment_author_email"
"body":"get_comment_author_email( ${1:\\$comment_ID} )"
"Return the html email link to the author of the current comment.":
"prefix":"get_comment_author_email_link"
"body":"get_comment_author_email_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment = null} )"
"Retrieve the IP address of the author of the current comment.":
"prefix":"get_comment_author_ip"
"body":"get_comment_author_ip( ${1:\\$comment_ID} )"
"Retrieve the HTML link to the URL of the author of the current comment.":
"prefix":"get_comment_author_link"
"body":"get_comment_author_link( ${1:\\$comment_ID} )"
"Retrieve the current comment author for use in the feeds.":
"prefix":"get_comment_author_rss"
"body":"get_comment_author_rss()"
"Retrieve the url of the author of the current comment.":
"prefix":"get_comment_author_url"
"body":"get_comment_author_url( ${1:\\$comment_ID} )"
"Retrieves the HTML link of the url of the author of the current comment.":
"prefix":"get_comment_author_url_link"
"body":"get_comment_author_url_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment} )"
"Returns the classes for the comment div as an array.":
"prefix":"get_comment_class"
"body":"get_comment_class( ${1:\\$class = ''}${2:, \\$comment_id = null}${3:, \\$post_id = null} )"
"The amount of comments in a post or total comments.":
"prefix":"get_comment_count"
"body":"get_comment_count( ${1:\\$post_id} )"
"Retrieve the comment date of the current comment.":
"prefix":"get_comment_date"
"body":"get_comment_date( ${1:\\$d = ''}${2:, \\$comment_ID} )"
"Retrieve the excerpt of the current comment.":
"prefix":"get_comment_excerpt"
"body":"get_comment_excerpt( ${1:\\$comment_ID} )"
"Retrieve the feed GUID for the current comment.":
"prefix":"get_comment_guid"
"body":"get_comment_guid( ${1:\\$comment_id = null} )"
"Retrieve the comment id of the current comment.":
"prefix":"get_comment_id"
"body":"get_comment_id()"
"Retrieve hidden input HTML for replying to comments.":
"prefix":"get_comment_id_fields"
"body":"get_comment_id_fields( ${1:\\$id} )"
"Retrieve the link to a given comment.":
"prefix":"get_comment_link"
"body":"get_comment_link( ${1:\\$comment = null}${2:, \\$args = array()} )"
"Retrieve comment meta field for a comment.":
"prefix":"get_comment_meta"
"body":"get_comment_meta( ${1:\\$comment_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Calculate the total number of comment pages.":
"prefix":"get_comment_pages_count"
"body":"get_comment_pages_count( ${1:\\$comments = null}${2:, \\$per_page = null}${3:, \\$threaded = null} )"
"Retrieve HTML content for reply to comment link.":
"prefix":"get_comment_reply_link"
"body":"get_comment_reply_link( ${1:\\$args = array()}${2:, \\$comment = null}${3:, \\$post = null} )"
"Retrieve all of the WordPress supported comment statuses.":
"prefix":"get_comment_statuses"
"body":"get_comment_statuses()"
"Retrieve the text of the current comment.":
"prefix":"get_comment_text"
"body":"get_comment_text( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Retrieve the comment time of the current comment.":
"prefix":"get_comment_time"
"body":"get_comment_time( ${1:\\$d = ''}${2:, \\$gmt = false}${3:, \\$translate = true} )"
"Returns a WP_Comment object based on comment ID.":
"prefix":"get_comment_to_edit"
"body":"get_comment_to_edit( ${1:\\$id} )"
"Retrieve the comment type of the current comment.":
"prefix":"get_comment_type"
"body":"get_comment_type( ${1:\\$comment_ID} )"
"Retrieve an array of comment data about comment $comment_ID.":
"prefix":"get_commentdata"
"body":"get_commentdata( ${1:\\$comment_ID}${2:, \\$no_cache}${3:, \\$include_unapproved = false} )"
"Retrieve a list of comments.":
"prefix":"get_comments"
"body":"get_comments( ${1:\\$args = ''} )"
"Retrieves the link to the current post comments.":
"prefix":"get_comments_link"
"body":"get_comments_link( ${1:\\$post_id} )"
"Retrieve the amount of comments a post has.":
"prefix":"get_comments_number"
"body":"get_comments_number( ${1:\\$post_id} )"
"Display the language string for the number of comments the current post has":
"prefix":"get_comments_number_text"
"body":"get_comments_number_text( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false} )"
"Retrieves the comments page number link.":
"prefix":"get_comments_pagenum_link"
"body":"get_comments_pagenum_link( ${1:\\$pagenum = 1}${2:, \\$max_page} )"
"Retrieve path of comment popup template in current or parent template.":
"prefix":"get_comments_popup_template"
"body":"get_comments_popup_template()"
"get_compat_media_markup":
"prefix":"get_compat_media_markup"
"body":"get_compat_media_markup( ${1:\\$attachment_id}${2:, \\$args = null} )"
"Gets and caches the checksums for the given version of WordPress.":
"prefix":"get_core_checksums"
"body":"get_core_checksums( ${1:\\$version}${2:, \\$locale} )"
"Get available core updates.":
"prefix":"get_core_updates"
"body":"get_core_updates( ${1:\\$options = array()} )"
"Retrieve the current site ID.":
"prefix":"get_current_blog_id"
"body":"get_current_blog_id()"
"Retrieves the current network ID.":
"prefix":"get_current_network_id"
"body":"get_current_network_id()"
"Get the current screen object":
"prefix":"get_current_screen"
"body":"get_current_screen()"
"Get the current network.":
"prefix":"get_current_site"
"body":"get_current_site()"
"This deprecated function formerly set the site_name property of the $current_site object.":
"prefix":"get_current_site_name"
"body":"get_current_site_name( ${1:\\$current_site} )"
"Retrieve current theme name.":
"prefix":"get_current_theme"
"body":"get_current_theme()"
"Get the current user's ID":
"prefix":"get_current_user_id"
"body":"get_current_user_id()"
"Populate global variables with information about the currently logged in user.":
"prefix":"get_currentuserinfo"
"body":"get_currentuserinfo()"
"Get the header image data.":
"prefix":"get_custom_header"
"body":"get_custom_header()"
"Retrieve the markup for a custom header.":
"prefix":"get_custom_header_markup"
"body":"get_custom_header_markup()"
"Returns a custom logo, linked to home.":
"prefix":"get_custom_logo"
"body":"get_custom_logo( ${1:\\$blog_id} )"
"Get the "dashboard blog", the blog where users without a blog edit their profile data.":
"prefix":"get_dashboard_blog"
"body":"get_dashboard_blog()"
"Retrieves the URL to the user's dashboard.":
"prefix":"get_dashboard_url"
"body":"get_dashboard_url( ${1:\\$user_id}${2:, \\$path = ''}${3:, \\$scheme = 'admin'} )"
"Converts a GMT date into the correct format for the blog.":
"prefix":"get_date_from_gmt"
"body":"get_date_from_gmt( ${1:\\$string}${2:, \\$format = 'Y-m-d H:i:s'} )"
"Retrieve path of date template in current or parent template.":
"prefix":"get_date_template"
"body":"get_date_template()"
"Retrieves the permalink for the day archives with year and month.":
"prefix":"get_day_link"
"body":"get_day_link( ${1:\\$year}${2:, \\$month}${3:, \\$day} )"
"Gets the default comment status for a post type.":
"prefix":"get_default_comment_status"
"body":"get_default_comment_status( ${1:\\$post_type = 'post'}${2:, \\$comment_type = 'comment'} )"
"Retrieve the default feed.":
"prefix":"get_default_feed"
"body":"get_default_feed()"
"Retrieves the default link for editing.":
"prefix":"get_default_link_to_edit"
"body":"get_default_link_to_edit()"
"Gets the default page information to use.":
"prefix":"get_default_page_to_edit"
"body":"get_default_page_to_edit()"
"Default post information to use when populating the "Write Post" form.":
"prefix":"get_default_post_to_edit"
"body":"get_default_post_to_edit( ${1:\\$post_type = 'post'}${2:, \\$create_in_db = false} )"
"Retrieves the delete posts link for post.":
"prefix":"get_delete_post_link"
"body":"get_delete_post_link( ${1:\\$id}${2:, \\$deprecated = ''}${3:, \\$force_delete = false} )"
"Get the size of a directory.":
"prefix":"get_dirsize"
"body":"get_dirsize( ${1:\\$directory} )"
"Check the wp-content directory and retrieve all drop-ins with any plugin data.":
"prefix":"get_dropins"
"body":"get_dropins()"
"Displays the edit bookmark link.":
"prefix":"get_edit_bookmark_link"
"body":"get_edit_bookmark_link( ${1:\\$link} )"
"Retrieves the edit comment link.":
"prefix":"get_edit_comment_link"
"body":"get_edit_comment_link( ${1:\\$comment_id} )"
"Retrieves the edit post link for post.":
"prefix":"get_edit_post_link"
"body":"get_edit_post_link( ${1:\\$id}${2:, \\$context = 'display'} )"
"Retrieves the URL to the user's profile editor.":
"prefix":"get_edit_profile_url"
"body":"get_edit_profile_url( ${1:\\$user_id}${2:, \\$scheme = 'admin'} )"
"Retrieves the edit link for a tag.":
"prefix":"get_edit_tag_link"
"body":"get_edit_tag_link( ${1:\\$tag_id}${2:, \\$taxonomy = 'post_tag'} )"
"Retrieves the URL for editing a given term.":
"prefix":"get_edit_term_link"
"body":"get_edit_term_link( ${1:\\$term_id}${2:, \\$taxonomy = ''}${3:, \\$object_type = ''} )"
"Retrieves the edit user link.":
"prefix":"get_edit_user_link"
"body":"get_edit_user_link( ${1:\\$user_id = null} )"
"Gets author users who can edit posts.":
"prefix":"get_editable_authors"
"body":"get_editable_authors( ${1:\\$user_id} )"
"Fetch a filtered list of user roles that the current user is
allowed to edit.":
"prefix":"get_editable_roles"
"body":"get_editable_roles()"
"Gets the IDs of any users who can edit posts.":
"prefix":"get_editable_user_ids"
"body":"get_editable_user_ids( ${1:\\$user_id}${2:, \\$exclude_zeros = true} )"
"Retrieve any registered editor stylesheets":
"prefix":"get_editor_stylesheets"
"body":"get_editor_stylesheets()"
"Retrieves an embed template path in the current or parent template.":
"prefix":"get_embed_template"
"body":"get_embed_template()"
"Retrieve enclosures already enclosed for a post.":
"prefix":"get_enclosed"
"body":"get_enclosed( ${1:\\$post_id} )"
"Get extended entry info (<!--more-->).":
"prefix":"get_extended"
"body":"get_extended( ${1:\\$post} )"
"Retrieves the permalink for the feed type.":
"prefix":"get_feed_link"
"body":"get_feed_link( ${1:\\$feed = ''} )"
"Retrieve metadata from a file.":
"prefix":"get_file_data"
"body":"get_file_data( ${1:\\$file}${2:, \\$default_headers}${3:, \\$context = ''} )"
"Get the description for standard WordPress theme files and other various standard
WordPress files":
"prefix":"get_file_description"
"body":"get_file_description( ${1:\\$file} )"
"Determines which method to use for reading, writing, modifying, or deleting
files on the filesystem.":
"prefix":"get_filesystem_method"
"body":"get_filesystem_method( ${1:\\$args = array()}${2:, \\$context = ''}${3:, \\$allow_relaxed_file_ownership = false} )"
"Load footer template.":
"prefix":"get_footer"
"body":"get_footer( ${1:\\$name = null} )"
"Retrieve path of front page template in current or parent template.":
"prefix":"get_front_page_template"
"body":"get_front_page_template()"
"Returns a date in the GMT equivalent.":
"prefix":"get_gmt_from_date"
"body":"get_gmt_from_date( ${1:\\$string}${2:, \\$format = 'Y-m-d H:i:s'} )"
"Load header template.":
"prefix":"get_header"
"body":"get_header( ${1:\\$name = null} )"
"Retrieve header image for custom header.":
"prefix":"get_header_image"
"body":"get_header_image()"
"Create image tag markup for a custom header image.":
"prefix":"get_header_image_tag"
"body":"get_header_image_tag( ${1:\\$attr = array()} )"
"Retrieves the custom header text color in 3- or 6-digit hexadecimal form.":
"prefix":"get_header_textcolor"
"body":"get_header_textcolor()"
"Retrieve header video settings.":
"prefix":"get_header_video_settings"
"body":"get_header_video_settings()"
"Retrieve header video URL for custom header.":
"prefix":"get_header_video_url"
"body":"get_header_video_url()"
"Get a list of hidden columns.":
"prefix":"get_hidden_columns"
"body":"get_hidden_columns( ${1:\\$screen} )"
"Get Hidden Meta Boxes":
"prefix":"get_hidden_meta_boxes"
"body":"get_hidden_meta_boxes( ${1:\\$screen} )"
"Get the absolute filesystem path to the root of the WordPress installation":
"prefix":"get_home_path"
"body":"get_home_path()"
"Retrieve path of home template in current or parent template.":
"prefix":"get_home_template"
"body":"get_home_template()"
"Retrieves the URL for a given site where the front end is accessible.":
"prefix":"get_home_url"
"body":"get_home_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = null} )"
"Retrieve the regular expression for an HTML element.":
"prefix":"get_html_split_regex"
"body":"get_html_split_regex()"
"Get the HTTP Origin of the current request.":
"prefix":"get_http_origin"
"body":"get_http_origin()"
"Retrieves a sites ID given its (subdomain or directory) slug.":
"prefix":"get_id_from_blogname"
"body":"get_id_from_blogname( ${1:\\$slug} )"
"Retrieves the image HTML to send to the editor.":
"prefix":"get_image_send_to_editor"
"body":"get_image_send_to_editor( ${1:\\$id}${2:, \\$caption}${3:, \\$title}${4:, \\$align}${5:, \\$url = ''}${6:, \\$rel = false}${7:, \\$size = 'medium'}${8:, \\$alt = ''} )"
"Gets an img tag for an image attachment, scaling it down if requested.":
"prefix":"get_image_tag"
"body":"get_image_tag( ${1:\\$id}${2:, \\$alt}${3:, \\$title}${4:, \\$align}${5:, \\$size = 'medium'} )"
"Retrieve list of importers.":
"prefix":"get_importers"
"body":"get_importers()"
"Get site index relational link.":
"prefix":"get_index_rel_link"
"body":"get_index_rel_link()"
"Retrieve path of index template in current or parent template.":
"prefix":"get_index_template"
"body":"get_index_template()"
"Adds hidden fields with the data for use in the inline editor for posts and pages.":
"prefix":"get_inline_data"
"body":"get_inline_data( ${1:\\$post} )"
"Gets the available intermediate image sizes.":
"prefix":"get_intermediate_image_sizes"
"body":"get_intermediate_image_sizes()"
"Gets the language attributes for the html tag.":
"prefix":"get_language_attributes"
"body":"get_language_attributes( ${1:\\$doctype = 'html'} )"
"Get a list of most recently updated blogs.":
"prefix":"get_last_updated"
"body":"get_last_updated( ${1:\\$deprecated = ''}${2:, \\$start}${3:, \\$quantity = 40} )"
"The date the last comment was modified.":
"prefix":"get_lastcommentmodified"
"body":"get_lastcommentmodified( ${1:\\$timezone = 'server'} )"
"Retrieve the date that the last post was published.":
"prefix":"get_lastpostdate"
"body":"get_lastpostdate( ${1:\\$timezone = 'server'}${2:, \\$post_type = 'any'} )"
"Get the timestamp of the last time any post was modified.":
"prefix":"get_lastpostmodified"
"body":"get_lastpostmodified( ${1:\\$timezone = 'server'}${2:, \\$post_type = 'any'} )"
"Retrieves bookmark data based on ID.":
"prefix":"get_link"
"body":"get_link( ${1:\\$bookmark_id}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves link data based on its ID.":
"prefix":"get_link_to_edit"
"body":"get_link_to_edit( ${1:\\$link} )"
"Gets the name of category by id.":
"prefix":"get_linkcatname"
"body":"get_linkcatname( ${1:\\$id} )"
"Gets an array of link objects associated with category n.":
"prefix":"get_linkobjects"
"body":"get_linkobjects( ${1:\\$category}${2:, \\$orderby = 'name'}${3:, \\$limit} )"
"Gets an array of link objects associated with category $cat_name.":
"prefix":"get_linkobjectsbyname"
"body":"get_linkobjectsbyname( ${1:\\$cat_name = 'noname'}${2:, \\$orderby = 'name'}${3:, \\$limit = -1} )"
"Legacy function that retrieved the value of a link's link_rating field.":
"prefix":"get_linkrating"
"body":"get_linkrating( ${1:\\$link} )"
"Gets the links associated with category by id.":
"prefix":"get_links"
"body":"get_links( ${1:\\$category = -1}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ' '}${5:, \\$show_images = true}${6:, \\$orderby = 'name'}${7:, \\$show_description = true}${8:, \\$show_rating = false}${9:, \\$limit = -1}${10:, \\$show_updated = 1}${11:, \\$echo = true} )"
"Output entire list of links by category.":
"prefix":"get_links_list"
"body":"get_links_list( ${1:\\$order = 'name'} )"
"Gets the links associated with category n and display rating stars/chars.":
"prefix":"get_links_withrating"
"body":"get_links_withrating( ${1:\\$category = -1}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$limit = -1}${9:, \\$show_updated} )"
"Gets the links associated with category $cat_name.":
"prefix":"get_linksbyname"
"body":"get_linksbyname( ${1:\\$cat_name = 'noname'}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$show_rating = false}${9:, \\$limit = -1}${10:, \\$show_updated} )"
"Gets the links associated with category 'cat_name' and display rating stars/chars.":
"prefix":"get_linksbyname_withrating"
"body":"get_linksbyname_withrating( ${1:\\$cat_name = 'noname'}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$limit = -1}${9:, \\$show_updated} )"
"Retrieves the current locale.":
"prefix":"get_locale"
"body":"get_locale()"
"Retrieves the localized stylesheet URI.":
"prefix":"get_locale_stylesheet_uri"
"body":"get_locale_stylesheet_uri()"
"Get the main network ID.":
"prefix":"get_main_network_id"
"body":"get_main_network_id()"
"Check the content blob for an audio, video, object, embed, or iframe tags.":
"prefix":"get_media_embedded_in_content"
"body":"get_media_embedded_in_content( ${1:\\$content}${2:, \\$types = null} )"
"Retrieve HTML form for modifying the image attachment.":
"prefix":"get_media_item"
"body":"get_media_item( ${1:\\$attachment_id}${2:, \\$args = null} )"
"Retrieve HTML for media items of post gallery.":
"prefix":"get_media_items"
"body":"get_media_items( ${1:\\$post_id}${2:, \\$errors} )"
"Get a list of previously defined keys.":
"prefix":"get_meta_keys"
"body":"get_meta_keys()"
"Given a meta query, generates SQL clauses to be appended to a main query.":
"prefix":"get_meta_sql"
"body":"get_meta_sql( ${1:\\$meta_query}${2:, \\$type}${3:, \\$primary_table}${4:, \\$primary_id_column}${5:, \\$context = null} )"
"Retrieve metadata for the specified object.":
"prefix":"get_metadata"
"body":"get_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key = ''}${4:, \\$single = false} )"
"Get meta data by meta ID":
"prefix":"get_metadata_by_mid"
"body":"get_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id} )"
"Retrieves the permalink for the month archives with year.":
"prefix":"get_month_link"
"body":"get_month_link( ${1:\\$year}${2:, \\$month} )"
"Deprecated functionality to retrieve a list of the most active sites.":
"prefix":"get_most_active_blogs"
"body":"get_most_active_blogs( ${1:\\$num = 10}${2:, \\$display = true} )"
"Get a user's most recent post.":
"prefix":"get_most_recent_post_of_user"
"body":"get_most_recent_post_of_user( ${1:\\$user_id} )"
"Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data.":
"prefix":"get_mu_plugins"
"body":"get_mu_plugins()"
"Retrieves all registered navigation menu locations and the menus assigned to them.":
"prefix":"get_nav_menu_locations"
"body":"get_nav_menu_locations()"
"Retrieves network data given a network ID or network object.":
"prefix":"get_network"
"body":"get_network( ${1:\\$network = null} )"
"Retrieve the closest matching network for a domain and path.":
"prefix":"get_network_by_path"
"body":"get_network_by_path( ${1:\\$domain}${2:, \\$path}${3:, \\$segments = null} )"
"Retrieve a network's option value based on the option name.":
"prefix":"get_network_option"
"body":"get_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$default = false} )"
"Retrieves a list of networks.":
"prefix":"get_networks"
"body":"get_networks( ${1:\\$args = array()} )"
"Retrieves the link to the next comments page.":
"prefix":"get_next_comments_link"
"body":"get_next_comments_link( ${1:\\$label = ''}${2:, \\$max_page} )"
"Retrieves the next post that is adjacent to the current post.":
"prefix":"get_next_post"
"body":"get_next_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$taxonomy = 'category'} )"
"Retrieves the next post link that is adjacent to the current post.":
"prefix":"get_next_post_link"
"body":"get_next_post_link( ${1:\\$format = '%link »'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Retrieves the next posts link.":
"prefix":"get_next_posts_link"
"body":"get_next_posts_link( ${1:\\$label = null}${2:, \\$max_page} )"
"Retrieves the next posts page link.":
"prefix":"get_next_posts_page_link"
"body":"get_next_posts_page_link( ${1:\\$max_page} )"
"Gets all users who are not authors.":
"prefix":"get_nonauthor_user_ids"
"body":"get_nonauthor_user_ids()"
"Retrieve the number of database queries during the WordPress execution.":
"prefix":"get_num_queries"
"body":"get_num_queries()"
"Return the names or objects of the taxonomies which are registered for the requested object or object type, such as
a post object or post type name.":
"prefix":"get_object_taxonomies"
"body":"get_object_taxonomies( ${1:\\$object}${2:, \\$output = 'names'} )"
"Retrieves the taxonomy relationship to the term object id.":
"prefix":"get_object_term_cache"
"body":"get_object_term_cache( ${1:\\$id}${2:, \\$taxonomy} )"
"Retrieve object_ids of valid taxonomy and term.":
"prefix":"get_objects_in_term"
"body":"get_objects_in_term( ${1:\\$term_ids}${2:, \\$taxonomies}${3:, \\$args = array()} )"
"Retrieves the oEmbed endpoint URL for a given permalink.":
"prefix":"get_oembed_endpoint_url"
"body":"get_oembed_endpoint_url( ${1:\\$permalink = ''}${2:, \\$format = 'json'} )"
"Retrieves the oEmbed response data for a given post.":
"prefix":"get_oembed_response_data"
"body":"get_oembed_response_data( ${1:\\$post}${2:, \\$width} )"
"Filters the oEmbed response data to return an iframe embed code.":
"prefix":"get_oembed_response_data_rich"
"body":"get_oembed_response_data_rich( ${1:\\$data}${2:, \\$post}${3:, \\$width}${4:, \\$height} )"
"Retrieves an option value based on an option name.":
"prefix":"get_option"
"body":"get_option( ${1:\\$option}${2:, \\$default = false} )"
"Retrieve drafts from other users.":
"prefix":"get_others_drafts"
"body":"get_others_drafts( ${1:\\$user_id} )"
"Retrieve pending review posts from other users.":
"prefix":"get_others_pending"
"body":"get_others_pending( ${1:\\$user_id} )"
"Retrieves editable posts from other users.":
"prefix":"get_others_unpublished_posts"
"body":"get_others_unpublished_posts( ${1:\\$user_id}${2:, \\$type = 'any'} )"
"Retrieves page data given a page ID or page object.":
"prefix":"get_page"
"body":"get_page( ${1:\\$page}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves a page given its path.":
"prefix":"get_page_by_path"
"body":"get_page_by_path( ${1:\\$page_path}${2:, \\$output = OBJECT}${3:, \\$post_type = 'page'} )"
"Retrieve a page given its title.":
"prefix":"get_page_by_title"
"body":"get_page_by_title( ${1:\\$page_title}${2:, \\$output = OBJECT}${3:, \\$post_type = 'page'} )"
"Identify descendants of a given page ID in a list of page objects.":
"prefix":"get_page_children"
"body":"get_page_children( ${1:\\$page_id}${2:, \\$pages} )"
"Order the pages with children under parents in a flat list.":
"prefix":"get_page_hierarchy"
"body":"get_page_hierarchy( ${1:\\$pages}${2:, \\$page_id} )"
"Retrieves the permalink for the current page or page ID.":
"prefix":"get_page_link"
"body":"get_page_link( ${1:\\$post = false}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Calculate what page number a comment will appear on for comment paging.":
"prefix":"get_page_of_comment"
"body":"get_page_of_comment( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Retrieve all of the WordPress support page statuses.":
"prefix":"get_page_statuses"
"body":"get_page_statuses()"
"Retrieve path of page template in current or parent template.":
"prefix":"get_page_template"
"body":"get_page_template()"
"Get the specific template name for a given post.":
"prefix":"get_page_template_slug"
"body":"get_page_template_slug( ${1:\\$post = null} )"
"Get the Page Templates available in this theme":
"prefix":"get_page_templates"
"body":"get_page_templates( ${1:\\$post = null}${2:, \\$post_type = 'page'} )"
"Build the URI path for a page.":
"prefix":"get_page_uri"
"body":"get_page_uri( ${1:\\$page} )"
"Retrieve path of paged template in current or parent template.":
"prefix":"get_paged_template"
"body":"get_paged_template()"
"Retrieves the link for a page number.":
"prefix":"get_pagenum_link"
"body":"get_pagenum_link( ${1:\\$pagenum = 1}${2:, \\$escape = true} )"
"Retrieve a list of pages (or hierarchical post type items).":
"prefix":"get_pages"
"body":"get_pages( ${1:\\$args = array()} )"
"Get parent post relational link.":
"prefix":"get_parent_post_rel_link"
"body":"get_parent_post_rel_link( ${1:\\$title = '%title'} )"
"Retrieves the path of a file in the parent theme.":
"prefix":"get_parent_theme_file_path"
"body":"get_parent_theme_file_path( ${1:\\$file = ''} )"
"Retrieves the URL of a file in the parent theme.":
"prefix":"get_parent_theme_file_uri"
"body":"get_parent_theme_file_uri( ${1:\\$file = ''} )"
"Creates, stores, then returns a password reset key for user.":
"prefix":"get_password_reset_key"
"body":"get_password_reset_key( ${1:\\$user} )"
"Get the number of pending comments on a post or posts":
"prefix":"get_pending_comments_num"
"body":"get_pending_comments_num( ${1:\\$post_id} )"
"Retrieves the full permalink for the current post or post ID.":
"prefix":"get_permalink"
"body":"get_permalink( ${1:\\$post}${2:, \\$leavename = false} )"
"Parses the plugin contents to retrieve plugin's metadata.":
"prefix":"get_plugin_data"
"body":"get_plugin_data( ${1:\\$plugin_file}${2:, \\$markup = true}${3:, \\$translate = true} )"
"Get a list of a plugin's files.":
"prefix":"get_plugin_files"
"body":"get_plugin_files( ${1:\\$plugin} )"
"get_plugin_page_hook":
"prefix":"get_plugin_page_hook"
"body":"get_plugin_page_hook( ${1:\\$plugin_page}${2:, \\$parent_page} )"
"get_plugin_page_hookname":
"prefix":"get_plugin_page_hookname"
"body":"get_plugin_page_hookname( ${1:\\$plugin_page}${2:, \\$parent_page} )"
"get_plugin_updates":
"prefix":"get_plugin_updates"
"body":"get_plugin_updates()"
"Check the plugins directory and retrieve all plugin files with plugin data.":
"prefix":"get_plugins"
"body":"get_plugins( ${1:\\$plugin_folder = ''} )"
"Retrieves post data given a post ID or post object.":
"prefix":"get_post"
"body":"get_post( ${1:\\$post = null}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve ancestors of a post.":
"prefix":"get_post_ancestors"
"body":"get_post_ancestors( ${1:\\$post} )"
"Retrieves the classes for the post div as an array.":
"prefix":"get_post_class"
"body":"get_post_class( ${1:\\$class = ''}${2:, \\$post_id = null} )"
"Retrieves the permalink for the post comments feed.":
"prefix":"get_post_comments_feed_link"
"body":"get_post_comments_feed_link( ${1:\\$post_id}${2:, \\$feed = ''} )"
"Retrieve post meta fields, based on post ID.":
"prefix":"get_post_custom"
"body":"get_post_custom( ${1:\\$post_id} )"
"Retrieve meta field names for a post.":
"prefix":"get_post_custom_keys"
"body":"get_post_custom_keys( ${1:\\$post_id} )"
"Retrieve values for a custom post field.":
"prefix":"get_post_custom_values"
"body":"get_post_custom_values( ${1:\\$key = ''}${2:, \\$post_id} )"
"Retrieves the embed code for a specific post.":
"prefix":"get_post_embed_html"
"body":"get_post_embed_html( ${1:\\$width}${2:, \\$height}${3:, \\$post = null} )"
"Retrieves the URL to embed a specific post in an iframe.":
"prefix":"get_post_embed_url"
"body":"get_post_embed_url( ${1:\\$post = null} )"
"Retrieve data from a post field based on Post ID.":
"prefix":"get_post_field"
"body":"get_post_field( ${1:\\$field}${2:, \\$post = null}${3:, \\$context = 'display'} )"
"Retrieve the format slug for a post":
"prefix":"get_post_format"
"body":"get_post_format( ${1:\\$post = null} )"
"Returns a link to a post format index.":
"prefix":"get_post_format_link"
"body":"get_post_format_link( ${1:\\$format} )"
"Retrieves an array of post format slugs.":
"prefix":"get_post_format_slugs"
"body":"get_post_format_slugs()"
"Returns a pretty, translated version of a post format slug":
"prefix":"get_post_format_string"
"body":"get_post_format_string( ${1:\\$slug} )"
"Returns an array of post format slugs to their translated and pretty display versions":
"prefix":"get_post_format_strings"
"body":"get_post_format_strings()"
"Retrieves galleries from the passed post's content.":
"prefix":"get_post_galleries"
"body":"get_post_galleries( ${1:\\$post}${2:, \\$html = true} )"
"Retrieve the image srcs from galleries from a post's content, if present":
"prefix":"get_post_galleries_images"
"body":"get_post_galleries_images( ${1:\\$post} )"
"Check a specified post's content for gallery and, if present, return the first":
"prefix":"get_post_gallery"
"body":"get_post_gallery( ${1:\\$post}${2:, \\$html = true} )"
"Checks a post's content for galleries and return the image srcs for the first found gallery":
"prefix":"get_post_gallery_images"
"body":"get_post_gallery_images( ${1:\\$post} )"
"Retrieve post meta field for a post.":
"prefix":"get_post_meta"
"body":"get_post_meta( ${1:\\$post_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Get post meta data by meta ID.":
"prefix":"get_post_meta_by_id"
"body":"get_post_meta_by_id( ${1:\\$mid} )"
"Retrieve the mime type of an attachment based on the ID.":
"prefix":"get_post_mime_type"
"body":"get_post_mime_type( ${1:\\$ID = ''} )"
"Get default post mime types.":
"prefix":"get_post_mime_types"
"body":"get_post_mime_types()"
"Retrieve the time at which the post was last modifiedre":
"prefix":"get_post_modified_time"
"body":"get_post_modified_time( ${1:\\$d = 'U'}${2:, \\$gmt = false}${3:, \\$post = null}${4:, \\$translate = false} )"
"Retrieves the permalink for a post of a custom post type.":
"prefix":"get_post_permalink"
"body":"get_post_permalink( ${1:\\$id}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Retrieve HTML content for reply to post link.":
"prefix":"get_post_reply_link"
"body":"get_post_reply_link( ${1:\\$args = array()}${2:, \\$post = null} )"
"Get a list of post statuses.":
"prefix":"get_post_stati"
"body":"get_post_stati( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieve the post status based on the Post ID.":
"prefix":"get_post_status"
"body":"get_post_status( ${1:\\$ID = ''} )"
"Retrieve a post status object by name.":
"prefix":"get_post_status_object"
"body":"get_post_status_object( ${1:\\$post_status} )"
"Retrieve all of the WordPress supported post statuses.":
"prefix":"get_post_statuses"
"body":"get_post_statuses()"
"Retrieve all taxonomies of a post with just the names.":
"prefix":"get_post_taxonomies"
"body":"get_post_taxonomies( ${1:\\$post} )"
"Retrieve post thumbnail ID.":
"prefix":"get_post_thumbnail_id"
"body":"get_post_thumbnail_id( ${1:\\$post = null} )"
"Retrieve the time at which the post was written.":
"prefix":"get_post_time"
"body":"get_post_time( ${1:\\$d = 'U'}${2:, \\$gmt = false}${3:, \\$post = null}${4:, \\$translate = false} )"
"Gets an existing post and format it for editing.":
"prefix":"get_post_to_edit"
"body":"get_post_to_edit( ${1:\\$id} )"
"Retrieves the post type of the current post or of a given post.":
"prefix":"get_post_type"
"body":"get_post_type( ${1:\\$post = null} )"
"Retrieves the permalink for a post type archive feed.":
"prefix":"get_post_type_archive_feed_link"
"body":"get_post_type_archive_feed_link( ${1:\\$post_type}${2:, \\$feed = ''} )"
"Retrieves the permalink for a post type archive.":
"prefix":"get_post_type_archive_link"
"body":"get_post_type_archive_link( ${1:\\$post_type} )"
"Retrieve path of post type archive template in current or parent template.":
"prefix":"get_post_type_archive_template"
"body":"get_post_type_archive_template()"
"Build an object with all post type capabilities out of a post type object":
"prefix":"get_post_type_capabilities"
"body":"get_post_type_capabilities( ${1:\\$args} )"
"Builds an object with all post type labels out of a post type object.":
"prefix":"get_post_type_labels"
"body":"get_post_type_labels( ${1:\\$post_type_object} )"
"Retrieves a post type object by name.":
"prefix":"get_post_type_object"
"body":"get_post_type_object( ${1:\\$post_type} )"
"Get a list of all registered post type objects.":
"prefix":"get_post_types"
"body":"get_post_types( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieves a list of post type names that support a specific feature.":
"prefix":"get_post_types_by_support"
"body":"get_post_types_by_support( ${1:\\$feature}${2:, \\$operator = 'and'} )"
"Retrieves all post data for a given post.":
"prefix":"get_postdata"
"body":"get_postdata( ${1:\\$postid} )"
"Retrieve list of latest posts or posts matching criteria.":
"prefix":"get_posts"
"body":"get_posts( ${1:\\$args = null} )"
"Retrieve the post SQL based on capability, author, and type.":
"prefix":"get_posts_by_author_sql"
"body":"get_posts_by_author_sql( ${1:\\$post_type}${2:, \\$full = true}${3:, \\$post_author = null}${4:, \\$public_only = false} )"
"Retrieves the post pages link navigation for previous and next pages.":
"prefix":"get_posts_nav_link"
"body":"get_posts_nav_link( ${1:\\$args = array()} )"
"Selects the first update version from the update_core option.":
"prefix":"get_preferred_from_update_core"
"body":"get_preferred_from_update_core()"
"Retrieves the URL used for the post preview.":
"prefix":"get_preview_post_link"
"body":"get_preview_post_link( ${1:\\$post = null}${2:, \\$query_args = array()}${3:, \\$preview_link = ''} )"
"Retrieves the link to the previous comments page.":
"prefix":"get_previous_comments_link"
"body":"get_previous_comments_link( ${1:\\$label = ''} )"
"Retrieves the previous post that is adjacent to the current post.":
"prefix":"get_previous_post"
"body":"get_previous_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$taxonomy = 'category'} )"
"Retrieves the previous post link that is adjacent to the current post.":
"prefix":"get_previous_post_link"
"body":"get_previous_post_link( ${1:\\$format = '« %link'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Retrieves the previous posts link.":
"prefix":"get_previous_posts_link"
"body":"get_previous_posts_link( ${1:\\$label = null} )"
"Retrieves the previous posts page link.":
"prefix":"get_previous_posts_page_link"
"body":"get_previous_posts_page_link()"
"Retrieve the private post SQL based on capability.":
"prefix":"get_private_posts_cap_sql"
"body":"get_private_posts_cap_sql( ${1:\\$post_type} )"
"Retrieve user data based on field.":
"prefix":"get_profile"
"body":"get_profile( ${1:\\$field}${2:, \\$user = false} )"
"Retrieve URLs already pinged for a post.":
"prefix":"get_pung"
"body":"get_pung( ${1:\\$post_id} )"
"Retrieve the currently-queried object.":
"prefix":"get_queried_object"
"body":"get_queried_object()"
"Retrieve ID of the current queried object.":
"prefix":"get_queried_object_id"
"body":"get_queried_object_id()"
"Retrieve path to a template":
"prefix":"get_query_template"
"body":"get_query_template( ${1:\\$type}${2:, \\$templates = array()} )"
"Retrieve variable in the WP_Query class.":
"prefix":"get_query_var"
"body":"get_query_var( ${1:\\$var}${2:, \\$default = ''} )"
"Get random header image url from registered images in theme.":
"prefix":"get_random_header_image"
"body":"get_random_header_image()"
"Get the raw theme root relative to the content directory with no filters applied.":
"prefix":"get_raw_theme_root"
"body":"get_raw_theme_root( ${1:\\$stylesheet_or_template}${2:, \\$skip_cache = false} )"
"Get the real filesystem path to a file to edit within the admin.":
"prefix":"get_real_file_to_edit"
"body":"get_real_file_to_edit( ${1:\\$file} )"
"Retrieves a list of registered meta keys for an object type.":
"prefix":"get_registered_meta_keys"
"body":"get_registered_meta_keys( ${1:\\$object_type} )"
"Retrieves registered metadata for a specified object.":
"prefix":"get_registered_metadata"
"body":"get_registered_metadata( ${1:\\$object_type}${2:, \\$object_id}${3:, \\$meta_key = ''} )"
"Retrieves all registered navigation menu locations in a theme.":
"prefix":"get_registered_nav_menus"
"body":"get_registered_nav_menus()"
"Retrieves an array of registered settings.":
"prefix":"get_registered_settings"
"body":"get_registered_settings()"
"Retrieves the URL to a REST endpoint on a site.":
"prefix":"get_rest_url"
"body":"get_rest_url( ${1:\\$blog_id = null}${2:, \\$path = '/'}${3:, \\$scheme = 'rest'} )"
"Retrieve role object.":
"prefix":"get_role"
"body":"get_role( ${1:\\$role} )"
"Display RSS items in HTML list items.":
"prefix":"get_rss"
"body":"get_rss( ${1:\\$url}${2:, \\$num_items = 5} )"
"Get a sample permalink based off of the post name.":
"prefix":"get_sample_permalink"
"body":"get_sample_permalink( ${1:\\$id}${2:, \\$title = null}${3:, \\$name = null} )"
"Returns the HTML of the sample permalink slug editor.":
"prefix":"get_sample_permalink_html"
"body":"get_sample_permalink_html( ${1:\\$id}${2:, \\$new_title = null}${3:, \\$new_slug = null} )"
"Retrieves the screen icon (no longer used in 3.8+).":
"prefix":"get_screen_icon"
"body":"get_screen_icon()"
"Retrieves the permalink for the search results comments feed.":
"prefix":"get_search_comments_feed_link"
"body":"get_search_comments_feed_link( ${1:\\$search_query = ''}${2:, \\$feed = ''} )"
"Retrieves the permalink for the search results feed.":
"prefix":"get_search_feed_link"
"body":"get_search_feed_link( ${1:\\$search_query = ''}${2:, \\$feed = ''} )"
"Display search form.":
"prefix":"get_search_form"
"body":"get_search_form( ${1:\\$echo = true} )"
"Retrieves the permalink for a search.":
"prefix":"get_search_link"
"body":"get_search_link( ${1:\\$query = ''} )"
"Retrieves the contents of the search WordPress query variable.":
"prefix":"get_search_query"
"body":"get_search_query( ${1:\\$escaped = true} )"
"Retrieve path of search template in current or parent template.":
"prefix":"get_search_template"
"body":"get_search_template()"
"Get value based on option.":
"prefix":"get_settings"
"body":"get_settings( ${1:\\$option} )"
"Fetch settings errors registered by add_settings_error()":
"prefix":"get_settings_errors"
"body":"get_settings_errors( ${1:\\$setting = ''}${2:, \\$sanitize = false} )"
"Retrieve the shortcode attributes regex.":
"prefix":"get_shortcode_atts_regex"
"body":"get_shortcode_atts_regex()"
"Retrieve the shortcode regular expression for searching.":
"prefix":"get_shortcode_regex"
"body":"get_shortcode_regex( ${1:\\$tagnames = null} )"
"Retrieves the Press This bookmarklet link.":
"prefix":"get_shortcut_link"
"body":"get_shortcut_link()"
"Load sidebar template.":
"prefix":"get_sidebar"
"body":"get_sidebar( ${1:\\$name = null} )"
"Retrieve path of single template in current or parent template. Applies to single Posts,
single Attachments, and single custom post types.":
"prefix":"get_single_template"
"body":"get_single_template()"
"Retrieves the path of the singular template in current or parent template.":
"prefix":"get_singular_template"
"body":"get_singular_template()"
"Retrieves site data given a site ID or site object.":
"prefix":"get_site"
"body":"get_site( ${1:\\$site = null} )"
"Deprecated functionality for getting themes network-enabled themes.":
"prefix":"get_site_allowed_themes"
"body":"get_site_allowed_themes()"
"Retrieves the closest matching site object by its domain and path.":
"prefix":"get_site_by_path"
"body":"get_site_by_path( ${1:\\$domain}${2:, \\$path}${3:, \\$segments = null} )"
"Returns the Site Icon URL.":
"prefix":"get_site_icon_url"
"body":"get_site_icon_url( ${1:\\$size = 512}${2:, \\$url = ''}${3:, \\$blog_id} )"
"Retrieve an option value for the current network based on name of option.":
"prefix":"get_site_option"
"body":"get_site_option( ${1:\\$option}${2:, \\$default = false}${3:, \\$deprecated = true} )"
"Get the value of a site transient.":
"prefix":"get_site_transient"
"body":"get_site_transient( ${1:\\$transient} )"
"Retrieves the URL for a given site where WordPress application files
(e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.":
"prefix":"get_site_url"
"body":"get_site_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = null} )"
"Retrieves a list of sites matching requested arguments.":
"prefix":"get_sites"
"body":"get_sites( ${1:\\$args = array()} )"
"Gets the network's site and user counts.":
"prefix":"get_sitestats"
"body":"get_sitestats()"
"Returns the upload quota for the current blog.":
"prefix":"get_space_allowed"
"body":"get_space_allowed()"
"Returns the space used by the current blog.":
"prefix":"get_space_used"
"body":"get_space_used()"
"Retrieve the description for the HTTP status.":
"prefix":"get_status_header_desc"
"body":"get_status_header_desc( ${1:\\$code} )"
"Retrieve name of the current stylesheet.":
"prefix":"get_stylesheet"
"body":"get_stylesheet()"
"Retrieve stylesheet directory path for current theme.":
"prefix":"get_stylesheet_directory"
"body":"get_stylesheet_directory()"
"Retrieve stylesheet directory URI.":
"prefix":"get_stylesheet_directory_uri"
"body":"get_stylesheet_directory_uri()"
"Retrieves the URI of current theme stylesheet.":
"prefix":"get_stylesheet_uri"
"body":"get_stylesheet_uri()"
"Retrieves a list of reserved site on a sub-directory Multisite install.":
"prefix":"get_subdirectory_reserved_names"
"body":"get_subdirectory_reserved_names()"
"Returns a submit button, with provided text and appropriate class":
"prefix":"get_submit_button"
"body":"get_submit_button( ${1:\\$text = ''}${2:, \\$type = 'primary large'}${3:, \\$name = 'submit'}${4:, \\$wrap = true}${5:, \\$other_attributes = ''} )"
"Retrieve a list of super admins.":
"prefix":"get_super_admins"
"body":"get_super_admins()"
"Retrieve post tag by tag ID or tag object.":
"prefix":"get_tag"
"body":"get_tag( ${1:\\$tag}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves the permalink for a tag feed.":
"prefix":"get_tag_feed_link"
"body":"get_tag_feed_link( ${1:\\$tag_id}${2:, \\$feed = ''} )"
"Retrieve the link to the tag.":
"prefix":"get_tag_link"
"body":"get_tag_link( ${1:\\$tag} )"
"Return RegEx body to liberally match an opening HTML tag.":
"prefix":"get_tag_regex"
"body":"get_tag_regex( ${1:\\$tag} )"
"Retrieve path of tag template in current or parent template.":
"prefix":"get_tag_template"
"body":"get_tag_template()"
"Retrieves all post tags.":
"prefix":"get_tags"
"body":"get_tags( ${1:\\$args = ''} )"
"Get comma-separated list of tags available to edit.":
"prefix":"get_tags_to_edit"
"body":"get_tags_to_edit( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'} )"
"Given a taxonomy query, generates SQL to be appended to a main query.":
"prefix":"get_tax_sql"
"body":"get_tax_sql( ${1:\\$tax_query}${2:, \\$primary_table}${3:, \\$primary_id_column} )"
"Retrieves a list of registered taxonomy names or objects.":
"prefix":"get_taxonomies"
"body":"get_taxonomies( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieves all of the taxonomy names that are registered for attachments.":
"prefix":"get_taxonomies_for_attachments"
"body":"get_taxonomies_for_attachments( ${1:\\$output = 'names'} )"
"Retrieves the taxonomy object of $taxonomy.":
"prefix":"get_taxonomy"
"body":"get_taxonomy( ${1:\\$taxonomy} )"
"Builds an object with all taxonomy labels out of a taxonomy object.":
"prefix":"get_taxonomy_labels"
"body":"get_taxonomy_labels( ${1:\\$tax} )"
"Retrieve path of custom taxonomy term template in current or parent template.":
"prefix":"get_taxonomy_template"
"body":"get_taxonomy_template()"
"Determine a writable directory for temporary files.":
"prefix":"get_temp_dir"
"body":"get_temp_dir()"
"Retrieve name of the current theme.":
"prefix":"get_template"
"body":"get_template()"
"Retrieve current theme directory.":
"prefix":"get_template_directory"
"body":"get_template_directory()"
"Retrieve theme directory URI.":
"prefix":"get_template_directory_uri"
"body":"get_template_directory_uri()"
"Loads a template part into a template.":
"prefix":"get_template_part"
"body":"get_template_part( ${1:\\$slug}${2:, \\$name = null} )"
"Get all Term data from database by Term ID.":
"prefix":"get_term"
"body":"get_term( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$output = OBJECT}${4:, \\$filter = 'raw'} )"
"Get all Term data from database by Term field and data.":
"prefix":"get_term_by"
"body":"get_term_by( ${1:\\$field}${2:, \\$value}${3:, \\$taxonomy = ''}${4:, \\$output = OBJECT}${5:, \\$filter = 'raw'} )"
"Merge all term children into a single array of their IDs.":
"prefix":"get_term_children"
"body":"get_term_children( ${1:\\$term_id}${2:, \\$taxonomy} )"
"Retrieves the feed link for a term.":
"prefix":"get_term_feed_link"
"body":"get_term_feed_link( ${1:\\$term_id}${2:, \\$taxonomy = 'category'}${3:, \\$feed = ''} )"
"Get sanitized Term field.":
"prefix":"get_term_field"
"body":"get_term_field( ${1:\\$field}${2:, \\$term}${3:, \\$taxonomy = ''}${4:, \\$context = 'display'} )"
"Generate a permalink for a taxonomy term archive.":
"prefix":"get_term_link"
"body":"get_term_link( ${1:\\$term}${2:, \\$taxonomy = ''} )"
"Retrieves metadata for a term.":
"prefix":"get_term_meta"
"body":"get_term_meta( ${1:\\$term_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Retrieve term parents with separator.":
"prefix":"get_term_parents_list"
"body":"get_term_parents_list( ${1:\\$term_id}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Sanitizes Term for editing.":
"prefix":"get_term_to_edit"
"body":"get_term_to_edit( ${1:\\$id}${2:, \\$taxonomy} )"
"Retrieve the terms in a given taxonomy or list of taxonomies.":
"prefix":"get_terms"
"body":"get_terms( ${1:\\$args = array()}${2:, \\$deprecated = ''} )"
"Get comma-separated list of terms available to edit for the given post ID.":
"prefix":"get_terms_to_edit"
"body":"get_terms_to_edit( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'} )"
"Retrieves the description for an author, post type, or term archive.":
"prefix":"get_the_archive_description"
"body":"get_the_archive_description()"
"Retrieve the archive title based on the queried object.":
"prefix":"get_the_archive_title"
"body":"get_the_archive_title()"
"Retrieve HTML content of attachment image with link.":
"prefix":"get_the_attachment_link"
"body":"get_the_attachment_link( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false}${4:, \\$permalink = false} )"
"Retrieve the author of the current post.":
"prefix":"get_the_author"
"body":"get_the_author( ${1:\\$deprecated = ''} )"
"Retrieve the AIM address of the author of the current post.":
"prefix":"get_the_author_aim"
"body":"get_the_author_aim()"
"Retrieve the description of the author of the current post.":
"prefix":"get_the_author_description"
"body":"get_the_author_description()"
"Retrieve the email of the author of the current post.":
"prefix":"get_the_author_email"
"body":"get_the_author_email()"
"Retrieve the first name of the author of the current post.":
"prefix":"get_the_author_firstname"
"body":"get_the_author_firstname()"
"Retrieve the ICQ number of the author of the current post.":
"prefix":"get_the_author_icq"
"body":"get_the_author_icq()"
"Retrieve the ID of the author of the current post.":
"prefix":"get_the_author_id"
"body":"get_the_author_id()"
"Retrieve the last name of the author of the current post.":
"prefix":"get_the_author_lastname"
"body":"get_the_author_lastname()"
"Retrieve either author's link or author's name.":
"prefix":"get_the_author_link"
"body":"get_the_author_link()"
"Retrieve the login name of the author of the current post.":
"prefix":"get_the_author_login"
"body":"get_the_author_login()"
"Retrieves the requested data of the author of the current post.":
"prefix":"get_the_author_meta"
"body":"get_the_author_meta( ${1:\\$field = ''}${2:, \\$user_id = false} )"
"Retrieve the MSN address of the author of the current post.":
"prefix":"get_the_author_msn"
"body":"get_the_author_msn()"
"Retrieve the nickname of the author of the current post.":
"prefix":"get_the_author_nickname"
"body":"get_the_author_nickname()"
"Retrieve the number of posts by the author of the current post.":
"prefix":"get_the_author_posts"
"body":"get_the_author_posts()"
"Retrieves an HTML link to the author page of the current post's author.":
"prefix":"get_the_author_posts_link"
"body":"get_the_author_posts_link()"
"Retrieve the URL to the home page of the author of the current post.":
"prefix":"get_the_author_url"
"body":"get_the_author_url()"
"Retrieve the Yahoo! IM name of the author of the current post.":
"prefix":"get_the_author_yim"
"body":"get_the_author_yim()"
"Retrieve post categories.":
"prefix":"get_the_category"
"body":"get_the_category( ${1:\\$id = false} )"
"Retrieve category name based on category ID.":
"prefix":"get_the_category_by_id"
"body":"get_the_category_by_id( ${1:\\$cat_ID} )"
"Retrieve category list for a post in either HTML list or custom format.":
"prefix":"get_the_category_list"
"body":"get_the_category_list( ${1:\\$separator = ''}${2:, \\$parents = ''}${3:, \\$post_id = false} )"
"Retrieve all of the post categories, formatted for use in feeds.":
"prefix":"get_the_category_rss"
"body":"get_the_category_rss( ${1:\\$type = null} )"
"Retrieves navigation to next/previous set of comments, when applicable.":
"prefix":"get_the_comments_navigation"
"body":"get_the_comments_navigation( ${1:\\$args = array()} )"
"Retrieves a paginated navigation to next/previous set of comments, when applicable.":
"prefix":"get_the_comments_pagination"
"body":"get_the_comments_pagination( ${1:\\$args = array()} )"
"Retrieve the post content.":
"prefix":"get_the_content"
"body":"get_the_content( ${1:\\$more_link_text = null}${2:, \\$strip_teaser = false} )"
"Retrieve the post content for feeds.":
"prefix":"get_the_content_feed"
"body":"get_the_content_feed( ${1:\\$feed_type = null} )"
"Retrieve the date on which the post was written.":
"prefix":"get_the_date"
"body":"get_the_date( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieves the post excerpt.":
"prefix":"get_the_excerpt"
"body":"get_the_excerpt( ${1:\\$post = null} )"
"Creates the generator XML or Comment for RSS, ATOM, etc.":
"prefix":"get_the_generator"
"body":"get_the_generator( ${1:\\$type = ''} )"
"Retrieve the Post Global Unique Identifier (guid).":
"prefix":"get_the_guid"
"body":"get_the_guid( ${1:\\$post} )"
"Retrieve the ID of the current item in the WordPress Loop.":
"prefix":"get_the_id"
"body":"get_the_id()"
"Retrieve the author who last edited the current post.":
"prefix":"get_the_modified_author"
"body":"get_the_modified_author()"
"Retrieve the date on which the post was last modified.":
"prefix":"get_the_modified_date"
"body":"get_the_modified_date( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve the time at which the post was last modified.":
"prefix":"get_the_modified_time"
"body":"get_the_modified_time( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve protected post password form content.":
"prefix":"get_the_password_form"
"body":"get_the_password_form( ${1:\\$post} )"
"Retrieves the full permalink for the current post or post ID":
"prefix":"get_the_permalink"
"body":"get_the_permalink( ${1:\\$post}${2:, \\$leavename = false} )"
"Retrieves the navigation to next/previous post, when applicable.":
"prefix":"get_the_post_navigation"
"body":"get_the_post_navigation( ${1:\\$args = array()} )"
"Retrieve the post thumbnail.":
"prefix":"get_the_post_thumbnail"
"body":"get_the_post_thumbnail( ${1:\\$post = null}${2:, \\$size = 'post-thumbnail'}${3:, \\$attr = ''} )"
"Returns the post thumbnail caption.":
"prefix":"get_the_post_thumbnail_caption"
"body":"get_the_post_thumbnail_caption( ${1:\\$post = null} )"
"Return the post thumbnail URL.":
"prefix":"get_the_post_thumbnail_url"
"body":"get_the_post_thumbnail_url( ${1:\\$post = null}${2:, \\$size = 'post-thumbnail'} )"
"Returns the navigation to next/previous set of posts, when applicable.":
"prefix":"get_the_posts_navigation"
"body":"get_the_posts_navigation( ${1:\\$args = array()} )"
"Retrieves a paginated navigation to next/previous set of posts, when applicable.":
"prefix":"get_the_posts_pagination"
"body":"get_the_posts_pagination( ${1:\\$args = array()} )"
"Retrieve the tags for a post formatted as a string.":
"prefix":"get_the_tag_list"
"body":"get_the_tag_list( ${1:\\$before = ''}${2:, \\$sep = ''}${3:, \\$after = ''}${4:, \\$id} )"
"Retrieve the tags for a post. get_the_tags":
"prefix":"get_the_tags"
"body":"get_the_tags( ${1:\\$id} )"
"Retrieve all taxonomies associated with a post.":
"prefix":"get_the_taxonomies"
"body":"get_the_taxonomies( ${1:\\$post}${2:, \\$args = array()} )"
"Retrieve a post's terms as a list with specified format.":
"prefix":"get_the_term_list"
"body":"get_the_term_list( ${1:\\$id}${2:, \\$taxonomy}${3:, \\$before = ''}${4:, \\$sep = ''}${5:, \\$after = ''} )"
"Retrieve the terms of the taxonomy that are attached to the post.":
"prefix":"get_the_terms"
"body":"get_the_terms( ${1:\\$post}${2:, \\$taxonomy} )"
"Retrieve the time at which the post was written":
"prefix":"get_the_time"
"body":"get_the_time( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve post title.":
"prefix":"get_the_title"
"body":"get_the_title( ${1:\\$post} )"
"Retrieve the current post title for the feed.":
"prefix":"get_the_title_rss"
"body":"get_the_title_rss()"
"Retrieve theme data.":
"prefix":"get_theme"
"body":"get_theme( ${1:\\$theme} )"
"Retrieve theme data from parsed theme file.":
"prefix":"get_theme_data"
"body":"get_theme_data( ${1:\\$theme_file} )"
"Retrieve list of WordPress theme features (aka theme tags)":
"prefix":"get_theme_feature_list"
"body":"get_theme_feature_list( ${1:\\$api = true} )"
"Retrieves the path of a file in the theme.":
"prefix":"get_theme_file_path"
"body":"get_theme_file_path( ${1:\\$file = ''} )"
"Retrieves the URL of a file in the theme.":
"prefix":"get_theme_file_uri"
"body":"get_theme_file_uri( ${1:\\$file = ''} )"
"Retrieve theme modification value for the current theme.":
"prefix":"get_theme_mod"
"body":"get_theme_mod( ${1:\\$name}${2:, \\$default = false} )"
"Retrieve all theme modifications.":
"prefix":"get_theme_mods"
"body":"get_theme_mods()"
"Retrieve path to themes directory.":
"prefix":"get_theme_root"
"body":"get_theme_root( ${1:\\$stylesheet_or_template = false} )"
"Retrieve URI for themes directory.":
"prefix":"get_theme_root_uri"
"body":"get_theme_root_uri( ${1:\\$stylesheet_or_template = false}${2:, \\$theme_root = false} )"
"Retrieve theme roots.":
"prefix":"get_theme_roots"
"body":"get_theme_roots()"
"Expand a theme's starter content configuration using core-provided data.":
"prefix":"get_theme_starter_content"
"body":"get_theme_starter_content()"
"Gets the theme support arguments passed when registering that support":
"prefix":"get_theme_support"
"body":"get_theme_support( ${1:\\$feature} )"
"Retrieve the update link if there is a theme update available.":
"prefix":"get_theme_update_available"
"body":"get_theme_update_available( ${1:\\$theme} )"
"get_theme_updates":
"prefix":"get_theme_updates"
"body":"get_theme_updates()"
"Retrieve list of themes with theme data in theme directory.":
"prefix":"get_themes"
"body":"get_themes()"
"Retrieve URLs that need to be pinged.":
"prefix":"get_to_ping"
"body":"get_to_ping( ${1:\\$post_id} )"
"Retrieve The current post's trackback URL.":
"prefix":"get_trackback_url"
"body":"get_trackback_url()"
"Get the value of a transient.":
"prefix":"get_transient"
"body":"get_transient( ${1:\\$transient} )"
"Return the Translations instance for a text domain.":
"prefix":"get_translations_for_domain"
"body":"get_translations_for_domain( ${1:\\$domain} )"
"Calculated the new dimensions for a downsampled image.":
"prefix":"get_udims"
"body":"get_udims( ${1:\\$width}${2:, \\$height} )"
"get_upload_iframe_src":
"prefix":"get_upload_iframe_src"
"body":"get_upload_iframe_src( ${1:\\$type = null}${2:, \\$post_id = null}${3:, \\$tab = null} )"
"Determines if there is any upload space left in the current blog's quota":
"prefix":"get_upload_space_available"
"body":"get_upload_space_available()"
"Get the header images uploaded for the current theme.":
"prefix":"get_uploaded_header_images"
"body":"get_uploaded_header_images()"
"Extract and return the first URL from passed content.":
"prefix":"get_url_in_content"
"body":"get_url_in_content( ${1:\\$content} )"
"Retrieve user info by a given field":
"prefix":"get_user_by"
"body":"get_user_by( ${1:\\$field}${2:, \\$value} )"
"Retrieve user info by email.":
"prefix":"get_user_by_email"
"body":"get_user_by_email( ${1:\\$email} )"
"The number of active users in your installation.":
"prefix":"get_user_count"
"body":"get_user_count( ${1:\\$network_id = null} )"
"Deprecated functionality to retrieve user information.":
"prefix":"get_user_details"
"body":"get_user_details( ${1:\\$username} )"
"Get a numeric user ID from either an email address or a login.":
"prefix":"get_user_id_from_string"
"body":"get_user_id_from_string( ${1:\\$string} )"
"Retrieves the locale of a user.":
"prefix":"get_user_locale"
"body":"get_user_locale( ${1:\\$user_id} )"
"Retrieve user meta field for a user.":
"prefix":"get_user_meta"
"body":"get_user_meta( ${1:\\$user_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users":
"prefix":"get_user_metavalues"
"body":"get_user_metavalues( ${1:\\$ids} )"
"Retrieve user option that can be either per Site or per Network.":
"prefix":"get_user_option"
"body":"get_user_option( ${1:\\$option}${2:, \\$user}${3:, \\$deprecated = ''} )"
"Retrieve user interface setting value based on setting name.":
"prefix":"get_user_setting"
"body":"get_user_setting( ${1:\\$name}${2:, \\$default = false} )"
"Retrieve user data and filter it.":
"prefix":"get_user_to_edit"
"body":"get_user_to_edit( ${1:\\$user_id} )"
"Retrieve user info by user ID.":
"prefix":"get_userdata"
"body":"get_userdata( ${1:\\$user_id} )"
"Retrieve user info by login name.":
"prefix":"get_userdatabylogin"
"body":"get_userdatabylogin( ${1:\\$user_login} )"
"Retrieve user metadata.":
"prefix":"get_usermeta"
"body":"get_usermeta( ${1:\\$user_id}${2:, \\$meta_key = ''} )"
"Retrieves the number of posts a user has written.":
"prefix":"get_usernumposts"
"body":"get_usernumposts( ${1:\\$userid} )"
"Retrieve list of users matching criteria.":
"prefix":"get_users"
"body":"get_users( ${1:\\$args = array()} )"
"Retrieve the user's drafts.":
"prefix":"get_users_drafts"
"body":"get_users_drafts( ${1:\\$user_id} )"
"Get users for the site.":
"prefix":"get_users_of_blog"
"body":"get_users_of_blog( ${1:\\$id = ''} )"
"Get the week start and end from the datetime or date string from MySQL.":
"prefix":"get_weekstartend"
"body":"get_weekstartend( ${1:\\$mysqlstring}${2:, \\$start_of_week = ''} )"
"Retrieve the blog title for the feed title.":
"prefix":"get_wp_title_rss"
"body":"get_wp_title_rss( ${1:\\$deprecated = '–'} )"
"Retrieves the permalink for the year archives.":
"prefix":"get_year_link"
"body":"get_year_link( ${1:\\$year} )"
"Maintains a canonical list of terms by syncing terms created for each blog with the global terms table.":
"prefix":"global_terms"
"body":"global_terms( ${1:\\$term_id}${2:, \\$deprecated = ''} )"
"Determine whether global terms are enabled.":
"prefix":"global_terms_enabled"
"body":"global_terms_enabled()"
"Returns whether the server is running Apache with the mod_rewrite module loaded.":
"prefix":"got_mod_rewrite"
"body":"got_mod_rewrite()"
"Returns whether the server supports URL rewriting.":
"prefix":"got_url_rewrite"
"body":"got_url_rewrite()"
"Deprecated functionality to gracefully fail.":
"prefix":"graceful_fail"
"body":"graceful_fail()"
"Grants Super Admin privileges.":
"prefix":"grant_super_admin"
"body":"grant_super_admin( ${1:\\$user_id} )"
"Unused function.":
"prefix":"gzip_compression"
"body":"gzip_compression()"
"Check if any action has been registered for a hook.":
"prefix":"has_action"
"body":"has_action( ${1:\\$tag}${2:, \\$function_to_check = false} )"
"Check if the current post has any of given category.":
"prefix":"has_category"
"body":"has_category( ${1:\\$category = ''}${2:, \\$post = null} )"
"Check whether a custom header is set or not.":
"prefix":"has_custom_header"
"body":"has_custom_header()"
"Determines whether the site has a custom logo.":
"prefix":"has_custom_logo"
"body":"has_custom_logo( ${1:\\$blog_id} )"
"Whether the post has a custom excerpt.":
"prefix":"has_excerpt"
"body":"has_excerpt( ${1:\\$post} )"
"Check if any filter has been registered for a hook.":
"prefix":"has_filter"
"body":"has_filter( ${1:\\$tag}${2:, \\$function_to_check = false} )"
"Check whether a header image is set or not.":
"prefix":"has_header_image"
"body":"has_header_image()"
"Check whether a header video is set or not.":
"prefix":"has_header_video"
"body":"has_header_video()"
"Check if an image size exists.":
"prefix":"has_image_size"
"body":"has_image_size( ${1:\\$name} )"
"Get meta data for the given post ID.":
"prefix":"has_meta"
"body":"has_meta( ${1:\\$postid} )"
"Determines whether a registered nav menu location has a menu assigned to it.":
"prefix":"has_nav_menu"
"body":"has_nav_menu( ${1:\\$location} )"
"Check if a post has any of the given formats, or any format.":
"prefix":"has_post_format"
"body":"has_post_format( ${1:\\$format = array()}${2:, \\$post = null} )"
"Check if post has an image attached.":
"prefix":"has_post_thumbnail"
"body":"has_post_thumbnail( ${1:\\$post = null} )"
"Whether the passed content contains the specified shortcode":
"prefix":"has_shortcode"
"body":"has_shortcode( ${1:\\$content}${2:, \\$tag} )"
"Whether the site has a Site Icon.":
"prefix":"has_site_icon"
"body":"has_site_icon( ${1:\\$blog_id} )"
"Check if the current post has any of given tags.":
"prefix":"has_tag"
"body":"has_tag( ${1:\\$tag = ''}${2:, \\$post = null} )"
"Check if the current post has any of given terms.":
"prefix":"has_term"
"body":"has_term( ${1:\\$term = ''}${2:, \\$taxonomy = ''}${3:, \\$post = null} )"
"Get all meta data, including meta IDs, for the given term ID.":
"prefix":"has_term_meta"
"body":"has_term_meta( ${1:\\$term_id} )"
"Timing attack safe string comparison":
"prefix":"hash_equals"
"body":"hash_equals( ${1:\\$a}${2:, \\$b} )"
"Whether there are comments to loop over.":
"prefix":"have_comments"
"body":"have_comments()"
"Whether current WordPress query has results to loop over.":
"prefix":"have_posts"
"body":"have_posts()"
"Display header image URL.":
"prefix":"header_image"
"body":"header_image()"
"Displays the custom header text color in 3- or 6-digit hexadecimal form (minus the hash symbol).":
"prefix":"header_textcolor"
"body":"header_textcolor()"
"Autosave with heartbeat":
"prefix":"heartbeat_autosave"
"body":"heartbeat_autosave( ${1:\\$response}${2:, \\$data} )"
"Retrieves the URL for the current site where the front end is accessible.":
"prefix":"home_url"
"body":"home_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Display the HTML type based on the blog setting.":
"prefix":"html_type_rss"
"body":"html_type_rss()"
"Convert entities, while preserving already-encoded entities.":
"prefix":"htmlentities2"
"body":"htmlentities2( ${1:\\$myHTML} )"
"Determines the difference between two timestamps.":
"prefix":"human_time_diff"
"body":"human_time_diff( ${1:\\$from}${2:, \\$to = ''} )"
"Generic Iframe footer for use with Thickbox":
"prefix":"iframe_footer"
"body":"iframe_footer()"
"Generic Iframe header for use with Thickbox":
"prefix":"iframe_header"
"body":"iframe_header( ${1:\\$title = ''}${2:, \\$deprecated = false} )"
"Add WordPress rewrite rule to the IIS 7+ configuration file.":
"prefix":"iis7_add_rewrite_rule"
"body":"iis7_add_rewrite_rule( ${1:\\$filename}${2:, \\$rewrite_rule} )"
"Delete WordPress rewrite rule from web.config file if it exists there":
"prefix":"iis7_delete_rewrite_rule"
"body":"iis7_delete_rewrite_rule( ${1:\\$filename} )"
"Check if rewrite rule for WordPress already exists in the IIS 7+ configuration file":
"prefix":"iis7_rewrite_rule_exists"
"body":"iis7_rewrite_rule_exists( ${1:\\$filename} )"
"Updates the IIS web.config file with the current rules if it is writable.":
"prefix":"iis7_save_url_rewrite_rules"
"body":"iis7_save_url_rewrite_rules()"
"Check if IIS 7+ supports pretty permalinks.":
"prefix":"iis7_supports_permalinks"
"body":"iis7_supports_permalinks()"
"Adds image shortcode with caption to editor":
"prefix":"image_add_caption"
"body":"image_add_caption( ${1:\\$html}${2:, \\$id}${3:, \\$caption}${4:, \\$title}${5:, \\$align}${6:, \\$url}${7:, \\$size}${8:, \\$alt = ''} )"
"Retrieve HTML for the image alignment radio buttons with the specified one checked.":
"prefix":"image_align_input_fields"
"body":"image_align_input_fields( ${1:\\$post}${2:, \\$checked = ''} )"
"Retrieves the image attachment fields to edit form fields.":
"prefix":"image_attachment_fields_to_edit"
"body":"image_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Filters input from media_upload_form_handler() and assigns a default
post_title from the file name if none supplied.":
"prefix":"image_attachment_fields_to_save"
"body":"image_attachment_fields_to_save( ${1:\\$post}${2:, \\$attachment} )"
"Scale down the default size of an image.":
"prefix":"image_constrain_size_for_editor"
"body":"image_constrain_size_for_editor( ${1:\\$width}${2:, \\$height}${3:, \\$size = 'medium'}${4:, \\$context = null} )"
"Scale an image to fit a particular size (such as 'thumb' or 'medium').":
"prefix":"image_downsize"
"body":"image_downsize( ${1:\\$id}${2:, \\$size = 'medium'} )"
"Performs group of changes on Editor specified.":
"prefix":"image_edit_apply_changes"
"body":"image_edit_apply_changes( ${1:\\$image}${2:, \\$changes} )"
"Retrieves the image's intermediate size (resized) path, width, and height.":
"prefix":"image_get_intermediate_size"
"body":"image_get_intermediate_size( ${1:\\$post_id}${2:, \\$size = 'thumbnail'} )"
"Retrieve width and height attributes using given width and height values.":
"prefix":"image_hwstring"
"body":"image_hwstring( ${1:\\$width}${2:, \\$height} )"
"Retrieve HTML for the Link URL buttons with the default link type as specified.":
"prefix":"image_link_input_fields"
"body":"image_link_input_fields( ${1:\\$post}${2:, \\$url_type = ''} )"
"Resizes an image to make a thumbnail or intermediate size.":
"prefix":"image_make_intermediate_size"
"body":"image_make_intermediate_size( ${1:\\$file}${2:, \\$width}${3:, \\$height}${4:, \\$crop = false} )"
"Retrieves the media element HTML to send to the editor.":
"prefix":"image_media_send_to_editor"
"body":"image_media_send_to_editor( ${1:\\$html}${2:, \\$attachment_id}${3:, \\$attachment} )"
"Scale down an image to fit a particular size and save a new copy of the image.":
"prefix":"image_resize"
"body":"image_resize( ${1:\\$file}${2:, \\$max_w}${3:, \\$max_h}${4:, \\$crop = false}${5:, \\$suffix = null}${6:, \\$dest_path = null}${7:, \\$jpeg_quality = 90} )"
"Retrieves calculated resize dimensions for use in WP_Image_Editor.":
"prefix":"image_resize_dimensions"
"body":"image_resize_dimensions( ${1:\\$orig_w}${2:, \\$orig_h}${3:, \\$dest_w}${4:, \\$dest_h}${5:, \\$crop = false} )"
"Retrieve HTML for the size radio buttons with the specified one checked.":
"prefix":"image_size_input_fields"
"body":"image_size_input_fields( ${1:\\$post}${2:, \\$check = ''} )"
"Builds the Caption shortcode output.":
"prefix":"img_caption_shortcode"
"body":"img_caption_shortcode( ${1:\\$attr}${2:, \\$content = null} )"
"Check if the current post is within any of the given categories.":
"prefix":"in_category"
"body":"in_category( ${1:\\$category}${2:, \\$post = null} )"
"Whether the caller is in the Loop.":
"prefix":"in_the_loop"
"body":"in_the_loop()"
"Retrieves the URL to the includes directory.":
"prefix":"includes_url"
"body":"includes_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Display relational link for the site index.":
"prefix":"index_rel_link"
"body":"index_rel_link()"
"Store basic site info in the blogs table.":
"prefix":"insert_blog"
"body":"insert_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$site_id} )"
"Inserts an array of strings into a file (.htaccess ), placing it between
BEGIN and END markers.":
"prefix":"insert_with_markers"
"body":"insert_with_markers( ${1:\\$filename}${2:, \\$marker}${3:, \\$insertion} )"
"Install an empty blog.":
"prefix":"install_blog"
"body":"install_blog( ${1:\\$blog_id}${2:, \\$blog_title = ''} )"
"Set blog defaults.":
"prefix":"install_blog_defaults"
"body":"install_blog_defaults( ${1:\\$blog_id}${2:, \\$user_id} )"
"install_dashboard":
"prefix":"install_dashboard"
"body":"install_dashboard()"
"Install global terms.":
"prefix":"install_global_terms"
"body":"install_global_terms()"
"Install Network.":
"prefix":"install_network"
"body":"install_network()"
"Display plugin information in dialog box form.":
"prefix":"install_plugin_information"
"body":"install_plugin_information()"
"Determine the status we can perform on a plugin.":
"prefix":"install_plugin_install_status"
"body":"install_plugin_install_status( ${1:\\$api}${2:, \\$loop = false} )"
"Show a username form for the favorites page":
"prefix":"install_plugins_favorites_form"
"body":"install_plugins_favorites_form()"
"Upload from zip":
"prefix":"install_plugins_upload"
"body":"install_plugins_upload()"
"Retrieve popular WordPress plugin tags.":
"prefix":"install_popular_tags"
"body":"install_popular_tags( ${1:\\$args = array()} )"
"Displays a search form for searching plugins.":
"prefix":"install_search_form"
"body":"install_search_form( ${1:\\$deprecated = true} )"
"Display theme information in dialog box form.":
"prefix":"install_theme_information"
"body":"install_theme_information()"
"Display search form for searching themes.":
"prefix":"install_theme_search_form"
"body":"install_theme_search_form( ${1:\\$type_selector = true} )"
"Display tags filter for themes.":
"prefix":"install_themes_dashboard"
"body":"install_themes_dashboard()"
"Retrieve list of WordPress theme features (aka theme tags).":
"prefix":"install_themes_feature_list"
"body":"install_themes_feature_list()"
"install_themes_upload":
"prefix":"install_themes_upload"
"body":"install_themes_upload()"
"Is the query a 404 (returns no results)?":
"prefix":"is_404"
"body":"is_404()"
"Whether a sidebar is in use.":
"prefix":"is_active_sidebar"
"body":"is_active_sidebar( ${1:\\$index} )"
"Whether widget is displayed on the front end.":
"prefix":"is_active_widget"
"body":"is_active_widget( ${1:\\$callback = false}${2:, \\$widget_id = false}${3:, \\$id_base = false}${4:, \\$skip_inactive = true} )"
"Whether the current request is for an administrative interface page.":
"prefix":"is_admin"
"body":"is_admin()"
"Determine whether the admin bar should be showing.":
"prefix":"is_admin_bar_showing"
"body":"is_admin_bar_showing()"
"Determines if the HTTP origin is an authorized one.":
"prefix":"is_allowed_http_origin"
"body":"is_allowed_http_origin( ${1:\\$origin = null} )"
"Is the query for an existing archive page?":
"prefix":"is_archive"
"body":"is_archive()"
"Check if a particular blog is archived.":
"prefix":"is_archived"
"body":"is_archived( ${1:\\$id} )"
"Is the query for an existing attachment page?":
"prefix":"is_attachment"
"body":"is_attachment( ${1:\\$attachment = ''} )"
"Is the query for an existing author archive page?":
"prefix":"is_author"
"body":"is_author( ${1:\\$author = ''} )"
"Whether the current request is for a site's admininstrative interface.":
"prefix":"is_blog_admin"
"body":"is_blog_admin()"
"Test whether WordPress is already installed.":
"prefix":"is_blog_installed"
"body":"is_blog_installed()"
"Checks if the current user belong to a given site.":
"prefix":"is_blog_user"
"body":"is_blog_user( ${1:\\$blog_id} )"
"Is the query for an existing category archive page?":
"prefix":"is_category"
"body":"is_category( ${1:\\$category = ''} )"
"Whether a child theme is in use.":
"prefix":"is_child_theme"
"body":"is_child_theme()"
"is_client_error":
"prefix":"is_client_error"
"body":"is_client_error()"
"Is the query for a comments feed?":
"prefix":"is_comment_feed"
"body":"is_comment_feed()"
"Whether the current URL is within the comments popup window.":
"prefix":"is_comments_popup"
"body":"is_comments_popup()"
"Whether the site is being previewed in the Customizer.":
"prefix":"is_customize_preview"
"body":"is_customize_preview()"
"Is the query for an existing date archive?":
"prefix":"is_date"
"body":"is_date()"
"Is the query for an existing day archive?":
"prefix":"is_day"
"body":"is_day()"
"Whether the dynamic sidebar is enabled and used by theme.":
"prefix":"is_dynamic_sidebar"
"body":"is_dynamic_sidebar()"
"Verifies that an email is valid.":
"prefix":"is_email"
"body":"is_email( ${1:\\$email}${2:, \\$deprecated = false} )"
"Checks an email address against a list of banned domains.":
"prefix":"is_email_address_unsafe"
"body":"is_email_address_unsafe( ${1:\\$user_email} )"
"Is the query for an embedded post?":
"prefix":"is_embed"
"body":"is_embed()"
"is_error":
"prefix":"is_error"
"body":"is_error()"
"Is the query for a feed?":
"prefix":"is_feed"
"body":"is_feed( ${1:\\$feeds = ''} )"
"Is the query for the front page of the site?":
"prefix":"is_front_page"
"body":"is_front_page()"
"Checks whether the custom header video is eligible to show on the current page.":
"prefix":"is_header_video_active"
"body":"is_header_video_active()"
"Determines if the query is for the blog homepage.":
"prefix":"is_home"
"body":"is_home()"
"is_info":
"prefix":"is_info"
"body":"is_info()"
"Is the server running earlier than 1.5.0 version of lighttpd?":
"prefix":"is_lighttpd_before_150"
"body":"is_lighttpd_before_150()"
"Check if the attachment URI is local one and is really an attachment.":
"prefix":"is_local_attachment"
"body":"is_local_attachment( ${1:\\$url} )"
"Whether switch_to_locale() is in effect.":
"prefix":"is_locale_switched"
"body":"is_locale_switched()"
"Deprecated functionality to determin if the current site is the main site.":
"prefix":"is_main_blog"
"body":"is_main_blog()"
"Determine whether a network is the main network of the Multisite install.":
"prefix":"is_main_network"
"body":"is_main_network( ${1:\\$network_id = null} )"
"Is the query the main query?":
"prefix":"is_main_query"
"body":"is_main_query()"
"Determine whether a site is the main site of the current network.":
"prefix":"is_main_site"
"body":"is_main_site( ${1:\\$site_id = null} )"
"Is the query for an existing month archive?":
"prefix":"is_month"
"body":"is_month()"
"Does this site have more than one author":
"prefix":"is_multi_author"
"body":"is_multi_author()"
"If Multisite is enabled.":
"prefix":"is_multisite"
"body":"is_multisite()"
"Check if the given ID is a navigation menu.":
"prefix":"is_nav_menu"
"body":"is_nav_menu( ${1:\\$menu} )"
"Determines whether the given ID is a nav menu item.":
"prefix":"is_nav_menu_item"
"body":"is_nav_menu_item( ${1:\\$menu_item_id} )"
"Whether the current request is for the network administrative interface.":
"prefix":"is_network_admin"
"body":"is_network_admin()"
"Checks for "Network: true" in the plugin header to see if this should
be activated only as a network wide plugin. The plugin would also work
when Multisite is not enabled.":
"prefix":"is_network_only_plugin"
"body":"is_network_only_plugin( ${1:\\$plugin} )"
"Whether the publish date of the current post in the loop is different from the
publish date of the previous post in the loop.":
"prefix":"is_new_day"
"body":"is_new_day()"
"Determine if the given object type is associated with the given taxonomy.":
"prefix":"is_object_in_taxonomy"
"body":"is_object_in_taxonomy( ${1:\\$object_type}${2:, \\$taxonomy} )"
"Determine if the given object is associated with any of the given terms.":
"prefix":"is_object_in_term"
"body":"is_object_in_term( ${1:\\$object_id}${2:, \\$taxonomy}${3:, \\$terms = null} )"
"Is the query for an existing single page?":
"prefix":"is_page"
"body":"is_page( ${1:\\$page = ''} )"
"Whether currently in a page template.":
"prefix":"is_page_template"
"body":"is_page_template( ${1:\\$template = ''} )"
"Is the query for paged result and not for the first page?":
"prefix":"is_paged"
"body":"is_paged()"
"Check whether a plugin is active.":
"prefix":"is_plugin_active"
"body":"is_plugin_active( ${1:\\$plugin} )"
"Check whether the plugin is active for the entire network.":
"prefix":"is_plugin_active_for_network"
"body":"is_plugin_active_for_network( ${1:\\$plugin} )"
"Check whether the plugin is inactive.":
"prefix":"is_plugin_inactive"
"body":"is_plugin_inactive( ${1:\\$plugin} )"
"Is the current admin page generated by a plugin?":
"prefix":"is_plugin_page"
"body":"is_plugin_page()"
"Is the query for an existing post type archive page?":
"prefix":"is_post_type_archive"
"body":"is_post_type_archive( ${1:\\$post_types = ''} )"
"Whether the post type is hierarchical.":
"prefix":"is_post_type_hierarchical"
"body":"is_post_type_hierarchical( ${1:\\$post_type} )"
"Determines whether a post type is considered "viewable".":
"prefix":"is_post_type_viewable"
"body":"is_post_type_viewable( ${1:\\$post_type} )"
"Is the query for a post or page preview?":
"prefix":"is_preview"
"body":"is_preview()"
"Determine whether a meta key is protected.":
"prefix":"is_protected_meta"
"body":"is_protected_meta( ${1:\\$meta_key}${2:, \\$meta_type = null} )"
"Check if random header image is in use.":
"prefix":"is_random_header_image"
"body":"is_random_header_image( ${1:\\$type = 'any'} )"
"is_redirect":
"prefix":"is_redirect"
"body":"is_redirect()"
"Checks if a sidebar is registered.":
"prefix":"is_registered_sidebar"
"body":"is_registered_sidebar( ${1:\\$sidebar_id} )"
"Is the query for the robots file?":
"prefix":"is_robots"
"body":"is_robots()"
"Checks if current locale is RTL.":
"prefix":"is_rtl"
"body":"is_rtl()"
"Is the query for a search?":
"prefix":"is_search"
"body":"is_search()"
"Check value to find if it was serialized.":
"prefix":"is_serialized"
"body":"is_serialized( ${1:\\$data}${2:, \\$strict = true} )"
"Check whether serialized data is of string type.":
"prefix":"is_serialized_string"
"body":"is_serialized_string( ${1:\\$data} )"
"is_server_error":
"prefix":"is_server_error"
"body":"is_server_error()"
"Is the query for an existing single post?":
"prefix":"is_single"
"body":"is_single( ${1:\\$post = ''} )"
"Is the query for an existing single post of any post type (post, attachment, page,
custom post types)?":
"prefix":"is_singular"
"body":"is_singular( ${1:\\$post_types = ''} )"
"Determine if user is a site admin.":
"prefix":"is_site_admin"
"body":"is_site_admin( ${1:\\$user_login = ''} )"
"Determines if SSL is used.":
"prefix":"is_ssl"
"body":"is_ssl()"
"Check if post is sticky.":
"prefix":"is_sticky"
"body":"is_sticky( ${1:\\$post_id} )"
"Whether a subdomain configuration is enabled.":
"prefix":"is_subdomain_install"
"body":"is_subdomain_install()"
"is_success":
"prefix":"is_success"
"body":"is_success()"
"Determine if user is a site admin":
"prefix":"is_super_admin"
"body":"is_super_admin( ${1:\\$user_id = false} )"
"Is the query for an existing tag archive page?":
"prefix":"is_tag"
"body":"is_tag( ${1:\\$tag = ''} )"
"Is the query for an existing custom taxonomy archive page?":
"prefix":"is_tax"
"body":"is_tax( ${1:\\$taxonomy = ''}${2:, \\$term = ''} )"
"Checks that the taxonomy name exists.":
"prefix":"is_taxonomy"
"body":"is_taxonomy( ${1:\\$taxonomy} )"
"Whether the taxonomy object is hierarchical.":
"prefix":"is_taxonomy_hierarchical"
"body":"is_taxonomy_hierarchical( ${1:\\$taxonomy} )"
"Check if Term exists.":
"prefix":"is_term"
"body":"is_term( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$parent} )"
"Whether there are translations for the text domain.":
"prefix":"is_textdomain_loaded"
"body":"is_textdomain_loaded( ${1:\\$domain} )"
"Is the query for a specific time?":
"prefix":"is_time"
"body":"is_time()"
"Is the query for a trackback endpoint call?":
"prefix":"is_trackback"
"body":"is_trackback()"
"Whether the plugin can be uninstalled.":
"prefix":"is_uninstallable_plugin"
"body":"is_uninstallable_plugin( ${1:\\$plugin} )"
"Determines if there is any upload space left in the current blog's quota.":
"prefix":"is_upload_space_available"
"body":"is_upload_space_available()"
"Whether the current request is for a user admin screen.":
"prefix":"is_user_admin"
"body":"is_user_admin()"
"Checks if the current visitor is a logged in user.":
"prefix":"is_user_logged_in"
"body":"is_user_logged_in()"
"Find out whether a user is a member of a given blog.":
"prefix":"is_user_member_of_blog"
"body":"is_user_member_of_blog( ${1:\\$user_id}${2:, \\$blog_id} )"
"Check whether a usermeta key has to do with the current blog.":
"prefix":"is_user_option_local"
"body":"is_user_option_local( ${1:\\$key}${2:, \\$user_id}${3:, \\$blog_id} )"
"Check to see whether a user is marked as a spammer, based on user login.":
"prefix":"is_user_spammy"
"body":"is_user_spammy( ${1:\\$user = null} )"
"Check whether variable is a WordPress Error.":
"prefix":"is_wp_error"
"body":"is_wp_error( ${1:\\$thing} )"
"Deprecated functionality for determining if the current plugin is network-only.":
"prefix":"is_wpmu_sitewide_plugin"
"body":"is_wpmu_sitewide_plugin()"
"Is the query for an existing year archive?":
"prefix":"is_year"
"body":"is_year()"
"Computes an offset in seconds from an iso8601 timezone.":
"prefix":"iso8601_timezone_to_offset"
"body":"iso8601_timezone_to_offset( ${1:\\$timezone} )"
"Converts an iso8601 date to MySQL DateTime format used by post_date[_gmt].":
"prefix":"iso8601_to_datetime"
"body":"iso8601_to_datetime( ${1:\\$date_string}${2:, \\$timezone = 'user'} )"
"Escape single quotes, specialchar double quotes, and fix line endings.":
"prefix":"js_escape"
"body":"js_escape( ${1:\\$text} )"
"Retrieves the error string of the last json_encode() or json_decode() call.":
"prefix":"json_last_error_msg"
"body":"json_last_error_msg()"
"Sets up most of the Kses filters for input form content.":
"prefix":"kses_init"
"body":"kses_init()"
"Adds all Kses input form content filters.":
"prefix":"kses_init_filters"
"body":"kses_init_filters()"
"Removes all Kses input form content filters.":
"prefix":"kses_remove_filters"
"body":"kses_remove_filters()"
"Displays the language attributes for the html tag.":
"prefix":"language_attributes"
"body":"language_attributes( ${1:\\$doctype = 'html'} )"
"Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described.":
"prefix":"like_escape"
"body":"like_escape( ${1:\\$text} )"
"Display advanced link options form fields.":
"prefix":"link_advanced_meta_box"
"body":"link_advanced_meta_box( ${1:\\$link} )"
"Display link categories form fields.":
"prefix":"link_categories_meta_box"
"body":"link_categories_meta_box( ${1:\\$link} )"
"Print list of pages based on arguments.":
"prefix":"link_pages"
"body":"link_pages( ${1:\\$before = ''}${2:, \\$after = ''}${3:, \\$next_or_number = 'number'}${4:, \\$nextpagelink = 'next page'}${5:, \\$previouspagelink = 'previous page'}${6:, \\$pagelink = '%'}${7:, \\$more_file = ''} )"
"Display link create form fields.":
"prefix":"link_submit_meta_box"
"body":"link_submit_meta_box( ${1:\\$link} )"
"Display form fields for changing link target.":
"prefix":"link_target_meta_box"
"body":"link_target_meta_box( ${1:\\$link} )"
"Display xfn form fields.":
"prefix":"link_xfn_meta_box"
"body":"link_xfn_meta_box( ${1:\\$link} )"
"Add a Base url to relative links in passed content.":
"prefix":"links_add_base_url"
"body":"links_add_base_url( ${1:\\$content}${2:, \\$base}${3:, \\$attrs = array('src', 'href')} )"
"Adds a Target attribute to all links in passed content.":
"prefix":"links_add_target"
"body":"links_add_target( ${1:\\$content}${2:, \\$target = '_blank'}${3:, \\$tags = array('a')} )"
"Show the link to the links popup and the number of links.":
"prefix":"links_popup_script"
"body":"links_popup_script( ${1:\\$text = 'Links'}${2:, \\$width = 400}${3:, \\$height = 400}${4:, \\$file = 'links.all.php'}${5:, \\$count = true} )"
"Lists authors.":
"prefix":"list_authors"
"body":"list_authors( ${1:\\$optioncount = false}${2:, \\$exclude_admin = true}${3:, \\$show_fullname = false}${4:, \\$hide_empty = true}${5:, \\$feed = ''}${6:, \\$feed_image = ''} )"
"Lists categories. list_cats":
"prefix":"list_cats"
"body":"list_cats( ${1:\\$optionall = 1}${2:, \\$all = 'All'}${3:, \\$sort_column = 'ID'}${4:, \\$sort_order = 'asc'}${5:, \\$file = ''}${6:, \\$list = true}${7:, \\$optiondates}${8:, \\$optioncount}${9:, \\$hide_empty = 1}${10:, \\$use_desc_for_title = 1}${11:, \\$children = false}${12:, \\$child_of}${13:, \\$categories}${14:, \\$recurse}${15:, \\$feed = ''}${16:, \\$feed_image = ''}${17:, \\$exclude = ''}${18:, \\$hierarchical = false} )"
"list_core_update":
"prefix":"list_core_update"
"body":"list_core_update( ${1:\\$update} )"
"Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.":
"prefix":"list_files"
"body":"list_files( ${1:\\$folder = ''}${2:, \\$levels = 100} )"
"Outputs a post's public meta data in the Custom Fields meta box.":
"prefix":"list_meta"
"body":"list_meta( ${1:\\$meta} )"
"list_plugin_updates":
"prefix":"list_plugin_updates"
"body":"list_plugin_updates()"
"list_theme_updates":
"prefix":"list_theme_updates"
"body":"list_theme_updates()"
"list_translation_updates":
"prefix":"list_translation_updates"
"body":"list_translation_updates()"
"Load the child themes translated strings.":
"prefix":"load_child_theme_textdomain"
"body":"load_child_theme_textdomain( ${1:\\$domain}${2:, \\$path = false} )"
"Load default translated strings based on locale.":
"prefix":"load_default_textdomain"
"body":"load_default_textdomain( ${1:\\$locale = null} )"
"Load an image resource for editing.":
"prefix":"load_image_to_edit"
"body":"load_image_to_edit( ${1:\\$attachment_id}${2:, \\$mime_type}${3:, \\$size = 'full'} )"
"Load the translated strings for a plugin residing in the mu-plugins directory.":
"prefix":"load_muplugin_textdomain"
"body":"load_muplugin_textdomain( ${1:\\$domain}${2:, \\$mu_plugin_rel_path = ''} )"
"Loads a plugin's translated strings.":
"prefix":"load_plugin_textdomain"
"body":"load_plugin_textdomain( ${1:\\$domain}${2:, \\$deprecated = false}${3:, \\$plugin_rel_path = false} )"
"Require the template file with WordPress environment.":
"prefix":"load_template"
"body":"load_template( ${1:\\$_template_file}${2:, \\$require_once = true} )"
"Load a .mo file into the text domain $domain.":
"prefix":"load_textdomain"
"body":"load_textdomain( ${1:\\$domain}${2:, \\$mofile} )"
"Load the theme's translated strings.":
"prefix":"load_theme_textdomain"
"body":"load_theme_textdomain( ${1:\\$domain}${2:, \\$path = false} )"
"Display localized stylesheet link element.":
"prefix":"locale_stylesheet"
"body":"locale_stylesheet()"
"Retrieve the name of the highest priority template file that exists.":
"prefix":"locate_template"
"body":"locate_template( ${1:\\$template_names}${2:, \\$load = false}${3:, \\$require_once = true} )"
"Outputs the footer for the login page.":
"prefix":"login_footer"
"body":"login_footer( ${1:\\$input_id = ''} )"
"Output the login page header.":
"prefix":"login_header"
"body":"login_header( ${1:\\$title = 'Log In'}${2:, \\$message = ''}${3:, \\$wp_error = ''} )"
"logIO() - Writes logging info to a file.":
"prefix":"logio"
"body":"logio( ${1:\\$io}${2:, \\$msg} )"
"maintenance_nag":
"prefix":"maintenance_nag"
"body":"maintenance_nag()"
"Convert plaintext URI to HTML links.":
"prefix":"make_clickable"
"body":"make_clickable( ${1:\\$text} )"
"Updates the database tables to a new schema.":
"prefix":"make_db_current"
"body":"make_db_current( ${1:\\$tables = 'all'} )"
"Updates the database tables to a new schema, but without displaying results.":
"prefix":"make_db_current_silent"
"body":"make_db_current_silent( ${1:\\$tables = 'all'} )"
"Creates a site theme.":
"prefix":"make_site_theme"
"body":"make_site_theme()"
"Creates a site theme from the default theme.":
"prefix":"make_site_theme_from_default"
"body":"make_site_theme_from_default( ${1:\\$theme_name}${2:, \\$template} )"
"Creates a site theme from an existing theme.":
"prefix":"make_site_theme_from_oldschool"
"body":"make_site_theme_from_oldschool( ${1:\\$theme_name}${2:, \\$template} )"
"Strip HTML and put links at the bottom of stripped content.":
"prefix":"make_url_footnote"
"body":"make_url_footnote( ${1:\\$content} )"
"Maps a function to all non-iterable elements of an array or an object.":
"prefix":"map_deep"
"body":"map_deep( ${1:\\$value}${2:, \\$callback} )"
"Map meta capabilities to primitive capabilities.":
"prefix":"map_meta_cap"
"body":"map_meta_cap( ${1:\\$cap}${2:, \\$user_id}${3:, \\$object_id} )"
"Add column to database table, if column doesn't already exist in table.":
"prefix":"maybe_add_column"
"body":"maybe_add_column( ${1:\\$table_name}${2:, \\$column_name}${3:, \\$create_ddl} )"
"Add a new user to a blog by visiting /newbloguser/username/.":
"prefix":"maybe_add_existing_user_to_blog"
"body":"maybe_add_existing_user_to_blog()"
"If a table only contains utf8 or utf8mb4 columns, convert it to utf8mb4.":
"prefix":"maybe_convert_table_to_utf8mb4"
"body":"maybe_convert_table_to_utf8mb4( ${1:\\$table} )"
"Create database table, if it doesn't already exist.":
"prefix":"maybe_create_table"
"body":"maybe_create_table( ${1:\\$table_name}${2:, \\$create_ddl} )"
"Disables the Automattic widgets plugin, which was merged into core.":
"prefix":"maybe_disable_automattic_widgets"
"body":"maybe_disable_automattic_widgets()"
"Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.":
"prefix":"maybe_disable_link_manager"
"body":"maybe_disable_link_manager()"
"Drop column from database table, if it exists.":
"prefix":"maybe_drop_column"
"body":"maybe_drop_column( ${1:\\$table_name}${2:, \\$column_name}${3:, \\$drop_ddl} )"
"Ensures that any hex color is properly hashed.":
"prefix":"maybe_hash_hex_color"
"body":"maybe_hash_hex_color( ${1:\\$color} )"
"Correct 404 redirects when NOBLOGREDIRECT is defined.":
"prefix":"maybe_redirect_404"
"body":"maybe_redirect_404()"
"Serialize data, if needed.":
"prefix":"maybe_serialize"
"body":"maybe_serialize( ${1:\\$data} )"
"Unserialize value only if it was serialized.":
"prefix":"maybe_unserialize"
"body":"maybe_unserialize( ${1:\\$original} )"
"Compat function to mimic mb_strlen().":
"prefix":"mb_strlen"
"body":"mb_strlen( ${1:\\$str}${2:, \\$encoding = null} )"
"Set the mbstring internal encoding to a binary safe encoding when func_overload
is enabled.":
"prefix":"mbstring_binary_safe_encoding"
"body":"mbstring_binary_safe_encoding( ${1:\\$reset = false} )"
"Adds the media button to the editor":
"prefix":"media_buttons"
"body":"media_buttons( ${1:\\$editor_id = 'content'} )"
"Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload().":
"prefix":"media_handle_sideload"
"body":"media_handle_sideload( ${1:\\$file_array}${2:, \\$post_id}${3:, \\$desc = null}${4:, \\$post_data = array()} )"
"Save a file submitted from a POST request and create an attachment post for it.":
"prefix":"media_handle_upload"
"body":"media_handle_upload( ${1:\\$file_id}${2:, \\$post_id}${3:, \\$post_data = array()}${4:, \\$overrides = array( 'test_form' => false )} )"
"Retrieves the post non-image attachment fields to edito form fields.":
"prefix":"media_post_single_attachment_fields_to_edit"
"body":"media_post_single_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Adds image html to editor":
"prefix":"media_send_to_editor"
"body":"media_send_to_editor( ${1:\\$html} )"
"Downloads an image from the specified URL and attaches it to a post.":
"prefix":"media_sideload_image"
"body":"media_sideload_image( ${1:\\$file}${2:, \\$post_id}${3:, \\$desc = null}${4:, \\$return = 'html'} )"
"Retrieves the single non-image attachment fields to edit form fields.":
"prefix":"media_single_attachment_fields_to_edit"
"body":"media_single_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Handles uploading an audio file.":
"prefix":"media_upload_audio"
"body":"media_upload_audio()"
"Handles uploading a generic file.":
"prefix":"media_upload_file"
"body":"media_upload_file()"
"Displays the multi-file uploader message.":
"prefix":"media_upload_flash_bypass"
"body":"media_upload_flash_bypass()"
"Outputs the legacy media upload form.":
"prefix":"media_upload_form"
"body":"media_upload_form( ${1:\\$errors = null} )"
"Handles form submissions for the legacy media uploader.":
"prefix":"media_upload_form_handler"
"body":"media_upload_form_handler()"
"Retrieves the legacy media uploader form in an iframe.":
"prefix":"media_upload_gallery"
"body":"media_upload_gallery()"
"Adds gallery form to upload iframe":
"prefix":"media_upload_gallery_form"
"body":"media_upload_gallery_form( ${1:\\$errors} )"
"Outputs the legacy media upload header.":
"prefix":"media_upload_header"
"body":"media_upload_header()"
"Displays the browser's built-in uploader message.":
"prefix":"media_upload_html_bypass"
"body":"media_upload_html_bypass()"
"Handles uploading an image.":
"prefix":"media_upload_image"
"body":"media_upload_image()"
"Retrieves the legacy media library form in an iframe.":
"prefix":"media_upload_library"
"body":"media_upload_library()"
"Outputs the legacy media upload form for the media library.":
"prefix":"media_upload_library_form"
"body":"media_upload_library_form( ${1:\\$errors} )"
"Displays the checkbox to scale images.":
"prefix":"media_upload_max_image_resize"
"body":"media_upload_max_image_resize()"
"Defines the default media upload tabs":
"prefix":"media_upload_tabs"
"body":"media_upload_tabs()"
"Used to display a "After a file has been uploaded..." help message.":
"prefix":"media_upload_text_after"
"body":"media_upload_text_after()"
"Outputs the legacy media upload form for a given media type.":
"prefix":"media_upload_type_form"
"body":"media_upload_type_form( ${1:\\$type = 'file'}${2:, \\$errors = null}${3:, \\$id = null} )"
"Outputs the legacy media upload form for external media.":
"prefix":"media_upload_type_url_form"
"body":"media_upload_type_url_form( ${1:\\$type = null}${2:, \\$errors = null}${3:, \\$id = null} )"
"Handles uploading a video file.":
"prefix":"media_upload_video"
"body":"media_upload_video()"
"Get the url to access a particular menu page based on the slug it was registered with.":
"prefix":"menu_page_url"
"body":"menu_page_url( ${1:\\$menu_slug}${2:, \\$echo = true} )"
"Prints the meta box preferences for screen meta.":
"prefix":"meta_box_prefs"
"body":"meta_box_prefs( ${1:\\$screen} )"
"Prints the form in the Custom Fields meta box.":
"prefix":"meta_form"
"body":"meta_form( ${1:\\$post = null} )"
"Determine if a meta key is set for a given object":
"prefix":"metadata_exists"
"body":"metadata_exists( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key} )"
"Whitelists any domain in a multisite installation for safe HTTP requests.":
"prefix":"ms_allowed_http_request_hosts"
"body":"ms_allowed_http_request_hosts( ${1:\\$is_external}${2:, \\$host} )"
"Defines Multisite cookie constants.":
"prefix":"ms_cookie_constants"
"body":"ms_cookie_constants()"
"Deprecated functionality for determining whether a file is deprecated.":
"prefix":"ms_deprecated_blogs_file"
"body":"ms_deprecated_blogs_file()"
"Defines Multisite file constants.":
"prefix":"ms_file_constants"
"body":"ms_file_constants()"
"Determines if switch_to_blog() is in effect":
"prefix":"ms_is_switched"
"body":"ms_is_switched()"
"Identifies the network and site of a requested domain and path and populates the
corresponding network and site global objects as part of the multisite bootstrap process.":
"prefix":"ms_load_current_site_and_network"
"body":"ms_load_current_site_and_network( ${1:\\$domain}${2:, \\$path}${3:, \\$subdomain = false} )"
"Displays a failure message.":
"prefix":"ms_not_installed"
"body":"ms_not_installed( ${1:\\$domain}${2:, \\$path} )"
"Checks status of current blog.":
"prefix":"ms_site_check"
"body":"ms_site_check()"
"Defines Multisite subdomain constants and handles warnings and notices.":
"prefix":"ms_subdomain_constants"
"body":"ms_subdomain_constants()"
"Defines Multisite upload constants.":
"prefix":"ms_upload_constants"
"body":"ms_upload_constants()"
"Generates and displays a drop-down of available languages.":
"prefix":"mu_dropdown_languages"
"body":"mu_dropdown_languages( ${1:\\$lang_files = array()}${2:, \\$current = ''} )"
"WPMU options.":
"prefix":"mu_options"
"body":"mu_options()"
"Displays the out of storage quota message in Multisite.":
"prefix":"multisite_over_quota_message"
"body":"multisite_over_quota_message()"
"Convert given date string into a different format.":
"prefix":"mysql2date"
"body":"mysql2date( ${1:\\$format}${2:, \\$date}${3:, \\$translate = true} )"
"Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601/RFC3339.":
"prefix":"mysql_to_rfc3339"
"body":"mysql_to_rfc3339( ${1:\\$date_string} )"
"Retrieves the URL to the admin area for the network.":
"prefix":"network_admin_url"
"body":"network_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Check for an existing network.":
"prefix":"network_domain_check"
"body":"network_domain_check()"
"Outputs the HTML for a network's "Edit Site" tabular interface.":
"prefix":"network_edit_site_nav"
"body":"network_edit_site_nav( ${1:\\$args = array()} )"
"Retrieves the home URL for the current network.":
"prefix":"network_home_url"
"body":"network_home_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Print JavaScript in the header on the Network Settings screen.":
"prefix":"network_settings_add_js"
"body":"network_settings_add_js()"
"Retrieves the site URL for the current network.":
"prefix":"network_site_url"
"body":"network_site_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Prints step 1 for Network installation process.":
"prefix":"network_step1"
"body":"network_step1( ${1:\\$errors = false} )"
"Prints step 2 for Network installation process.":
"prefix":"network_step2"
"body":"network_step2( ${1:\\$errors = false} )"
"Adds an admin notice alerting the user to check for confirmation email
after email address change.":
"prefix":"new_user_email_admin_notice"
"body":"new_user_email_admin_notice()"
"Notifies the network admin that a new site has been activated.":
"prefix":"newblog_notify_siteadmin"
"body":"newblog_notify_siteadmin( ${1:\\$blog_id}${2:, \\$deprecated = ''} )"
"Notifies the network admin that a new user has been activated.":
"prefix":"newuser_notify_siteadmin"
"body":"newuser_notify_siteadmin( ${1:\\$user_id} )"
"Displays the link to the next comments page.":
"prefix":"next_comments_link"
"body":"next_comments_link( ${1:\\$label = ''}${2:, \\$max_page} )"
"Displays next image link that has the same post parent.":
"prefix":"next_image_link"
"body":"next_image_link( ${1:\\$size = 'thumbnail'}${2:, \\$text = false} )"
"Prints link to the next post.":
"prefix":"next_post"
"body":"next_post( ${1:\\$format = '%'}${2:, \\$next = 'next post: '}${3:, \\$title = 'yes'}${4:, \\$in_same_cat = 'no'}${5:, \\$limitnext = 1}${6:, \\$excluded_categories = ''} )"
"Displays the next post link that is adjacent to the current post.":
"prefix":"next_post_link"
"body":"next_post_link( ${1:\\$format = '%link »'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Displays the relational link for the next post adjacent to the current post.":
"prefix":"next_post_rel_link"
"body":"next_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Displays or retrieves the next posts page link.":
"prefix":"next_posts"
"body":"next_posts( ${1:\\$max_page}${2:, \\$echo = true} )"
"Displays the next posts page link.":
"prefix":"next_posts_link"
"body":"next_posts_link( ${1:\\$label = null}${2:, \\$max_page} )"
"next_widget_id_number":
"prefix":"next_widget_id_number"
"body":"next_widget_id_number( ${1:\\$id_base} )"
"Set the headers to prevent caching for the different browsers.":
"prefix":"nocache_headers"
"body":"nocache_headers()"
"Displays a noindex meta tag if required by the blog configuration.":
"prefix":"noindex"
"body":"noindex()"
"Normalize EOL characters and strip duplicate whitespace.":
"prefix":"normalize_whitespace"
"body":"normalize_whitespace( ${1:\\$str} )"
"Convert float number to format based on the locale.":
"prefix":"number_format_i18n"
"body":"number_format_i18n( ${1:\\$number}${2:, \\$decimals} )"
"Refreshes the value of the options whitelist available via the 'whitelist_options' hook.":
"prefix":"option_update_filter"
"body":"option_update_filter( ${1:\\$options} )"
"Output JavaScript to toggle display of additional settings if avatars are disabled.":
"prefix":"options_discussion_add_js"
"body":"options_discussion_add_js()"
"Display JavaScript on the page options_general_add_js.":
"prefix":"options_general_add_js"
"body":"options_general_add_js()"
"Display JavaScript on the page options_permalink_add_js.":
"prefix":"options_permalink_add_js"
"body":"options_permalink_add_js()"
"Display JavaScript on the page options_reading_add_js.":
"prefix":"options_reading_add_js"
"body":"options_reading_add_js()"
"Render the site charset setting.":
"prefix":"options_reading_blog_charset"
"body":"options_reading_blog_charset()"
"Display page attributes form fields.":
"prefix":"page_attributes_meta_box"
"body":"page_attributes_meta_box( ${1:\\$post} )"
"Print out option HTML elements for the page templates drop-down.":
"prefix":"page_template_dropdown"
"body":"page_template_dropdown( ${1:\\$default = ''}${2:, \\$post_type = 'page'} )"
"Displays or retrieves pagination links for the comments on the current post.":
"prefix":"paginate_comments_links"
"body":"paginate_comments_links( ${1:\\$args = array()} )"
"Retrieve paginated link for archive post pages.":
"prefix":"paginate_links"
"body":"paginate_links( ${1:\\$args = ''} )"
"Print out option HTML elements for the page parents drop-down.":
"prefix":"parent_dropdown"
"body":"parent_dropdown( ${1:\\$default}${2:, \\$parent}${3:, \\$level}${4:, \\$post = null} )"
"Display relational link for parent item":
"prefix":"parent_post_rel_link"
"body":"parent_post_rel_link( ${1:\\$title = '%title'} )"
"parse_w3cdtf":
"prefix":"parse_w3cdtf"
"body":"parse_w3cdtf()"
"Test if a give filesystem path is absolute.":
"prefix":"path_is_absolute"
"body":"path_is_absolute( ${1:\\$path} )"
"Join two filesystem paths together.":
"prefix":"path_join"
"body":"path_join( ${1:\\$base}${2:, \\$path} )"
"pclziputilcopyblock":
"prefix":"pclziputilcopyblock"
"body":"pclziputilcopyblock()"
"pclziputiloptiontext":
"prefix":"pclziputiloptiontext"
"body":"pclziputiloptiontext()"
"pclziputilpathinclusion":
"prefix":"pclziputilpathinclusion"
"body":"pclziputilpathinclusion()"
"pclziputilpathreduction":
"prefix":"pclziputilpathreduction"
"body":"pclziputilpathreduction()"
"pclziputilrename":
"prefix":"pclziputilrename"
"body":"pclziputilrename()"
"pclziputiltranslatewinpath":
"prefix":"pclziputiltranslatewinpath"
"body":"pclziputiltranslatewinpath()"
"Displays the permalink anchor for the current post.":
"prefix":"permalink_anchor"
"body":"permalink_anchor( ${1:\\$mode = 'id'} )"
"Print the permalink of the current post in the loop.":
"prefix":"permalink_link"
"body":"permalink_link()"
"Print the permalink to the RSS feed.":
"prefix":"permalink_single_rss"
"body":"permalink_single_rss( ${1:\\$deprecated = ''} )"
"Pings back the links found in a post.":
"prefix":"pingback"
"body":"pingback( ${1:\\$content}${2:, \\$post_id} )"
"Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI":
"prefix":"pingback_ping_source_uri"
"body":"pingback_ping_source_uri( ${1:\\$source_uri} )"
"Whether the current post is open for pings.":
"prefix":"pings_open"
"body":"pings_open( ${1:\\$post_id = null} )"
"Gets the basename of a plugin.":
"prefix":"plugin_basename"
"body":"plugin_basename( ${1:\\$file} )"
"Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in.":
"prefix":"plugin_dir_path"
"body":"plugin_dir_path( ${1:\\$file} )"
"Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in.":
"prefix":"plugin_dir_url"
"body":"plugin_dir_url( ${1:\\$file} )"
"plugin_sandbox_scrape":
"prefix":"plugin_sandbox_scrape"
"body":"plugin_sandbox_scrape( ${1:\\$plugin} )"
"Retrieves plugin installer pages from the WordPress.org Plugins API.":
"prefix":"plugins_api"
"body":"plugins_api( ${1:\\$action}${2:, \\$args = array()} )"
"Retrieves a URL within the plugins or mu-plugins directory.":
"prefix":"plugins_url"
"body":"plugins_url( ${1:\\$path = ''}${2:, \\$plugin = ''} )"
"Populate network settings.":
"prefix":"populate_network"
"body":"populate_network( ${1:\\$network_id = 1}${2:, \\$domain = ''}${3:, \\$email = ''}${4:, \\$site_name = ''}${5:, \\$path = '/'}${6:, \\$subdomain_install = false} )"
"Create WordPress options and set the default values.":
"prefix":"populate_options"
"body":"populate_options()"
"Execute WordPress role creation for the various WordPress versions.":
"prefix":"populate_roles"
"body":"populate_roles()"
"Create the roles for WordPress 2.0":
"prefix":"populate_roles_160"
"body":"populate_roles_160()"
"Create and modify WordPress roles for WordPress 2.1.":
"prefix":"populate_roles_210"
"body":"populate_roles_210()"
"Create and modify WordPress roles for WordPress 2.3.":
"prefix":"populate_roles_230"
"body":"populate_roles_230()"
"Create and modify WordPress roles for WordPress 2.5.":
"prefix":"populate_roles_250"
"body":"populate_roles_250()"
"Create and modify WordPress roles for WordPress 2.6.":
"prefix":"populate_roles_260"
"body":"populate_roles_260()"
"Create and modify WordPress roles for WordPress 2.7.":
"prefix":"populate_roles_270"
"body":"populate_roles_270()"
"Create and modify WordPress roles for WordPress 2.8.":
"prefix":"populate_roles_280"
"body":"populate_roles_280()"
"Create and modify WordPress roles for WordPress 3.0.":
"prefix":"populate_roles_300"
"body":"populate_roles_300()"
"Adds element attributes to open links in new windows.":
"prefix":"popuplinks"
"body":"popuplinks( ${1:\\$text} )"
"Display form field with list of authors.":
"prefix":"post_author_meta_box"
"body":"post_author_meta_box( ${1:\\$post} )"
"Display post categories form fields.":
"prefix":"post_categories_meta_box"
"body":"post_categories_meta_box( ${1:\\$post}${2:, \\$box} )"
"Display the classes for the post div.":
"prefix":"post_class"
"body":"post_class( ${1:\\$class = ''}${2:, \\$post_id = null} )"
"Display comments for post.":
"prefix":"post_comment_meta_box"
"body":"post_comment_meta_box( ${1:\\$post} )"
"Display comments for post table header":
"prefix":"post_comment_meta_box_thead"
"body":"post_comment_meta_box_thead( ${1:\\$result} )"
"Display comments status form fields.":
"prefix":"post_comment_status_meta_box"
"body":"post_comment_status_meta_box( ${1:\\$post} )"
"Displays the comment feed link for a post.":
"prefix":"post_comments_feed_link"
"body":"post_comments_feed_link( ${1:\\$link_text = ''}${2:, \\$post_id = ''}${3:, \\$feed = ''} )"
"Retrieve post custom meta data field.":
"prefix":"post_custom"
"body":"post_custom( ${1:\\$key = ''} )"
"Display custom fields form fields.":
"prefix":"post_custom_meta_box"
"body":"post_custom_meta_box( ${1:\\$post} )"
"Display post excerpt form fields.":
"prefix":"post_excerpt_meta_box"
"body":"post_excerpt_meta_box( ${1:\\$post} )"
"Determine if a post exists based on title, content, and date":
"prefix":"post_exists"
"body":"post_exists( ${1:\\$title}${2:, \\$content = ''}${3:, \\$date = ''} )"
"Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
as they disregard the autocomplete setting on the editor textarea. That can break the editor
when the user navigates to it with the browser's Back button. See #28037":
"prefix":"post_form_autocomplete_off"
"body":"post_form_autocomplete_off()"
"Display post format form elements.":
"prefix":"post_format_meta_box"
"body":"post_format_meta_box( ${1:\\$post}${2:, \\$box} )"
"Whether post requires password and correct password has been provided.":
"prefix":"post_password_required"
"body":"post_password_required( ${1:\\$post = null} )"
"Retrieve permalink from post ID.":
"prefix":"post_permalink"
"body":"post_permalink( ${1:\\$post_id} )"
"Save draft or manually autosave for showing preview.":
"prefix":"post_preview"
"body":"post_preview()"
"Displays the HTML content for reply to post link.":
"prefix":"post_reply_link"
"body":"post_reply_link( ${1:\\$args = array()}${2:, \\$post = null} )"
"Display list of revisions.":
"prefix":"post_revisions_meta_box"
"body":"post_revisions_meta_box( ${1:\\$post} )"
"Display slug form fields.":
"prefix":"post_slug_meta_box"
"body":"post_slug_meta_box( ${1:\\$post} )"
"Displays post submit form fields.":
"prefix":"post_submit_meta_box"
"body":"post_submit_meta_box( ${1:\\$post}${2:, \\$args = array()} )"
"Display post tags form fields.":
"prefix":"post_tags_meta_box"
"body":"post_tags_meta_box( ${1:\\$post}${2:, \\$box} )"
"Display post thumbnail meta box.":
"prefix":"post_thumbnail_meta_box"
"body":"post_thumbnail_meta_box( ${1:\\$post} )"
"Display trackback links form fields.":
"prefix":"post_trackback_meta_box"
"body":"post_trackback_meta_box( ${1:\\$post} )"
"Display or retrieve title for a post type archive.":
"prefix":"post_type_archive_title"
"body":"post_type_archive_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Check if a post type is registered.":
"prefix":"post_type_exists"
"body":"post_type_exists( ${1:\\$post_type} )"
"Check a post type's support for a given feature.":
"prefix":"post_type_supports"
"body":"post_type_supports( ${1:\\$post_type}${2:, \\$feature} )"
"Returns the list of classes to be used by a meta box.":
"prefix":"postbox_classes"
"body":"postbox_classes( ${1:\\$id}${2:, \\$page} )"
"Displays the post pages link navigation for previous and next pages.":
"prefix":"posts_nav_link"
"body":"posts_nav_link( ${1:\\$sep = ''}${2:, \\$prelabel = ''}${3:, \\$nxtlabel = ''} )"
"Runs before the schema is upgraded.":
"prefix":"pre_schema_upgrade"
"body":"pre_schema_upgrade()"
"Determine the type of a string of data with the data formatted.":
"prefix":"prep_atom_text_construct"
"body":"prep_atom_text_construct( ${1:\\$data} )"
"Wrap attachment in paragraph tag before content.":
"prefix":"prepend_attachment"
"body":"prepend_attachment( ${1:\\$content} )"
"Displays the relational link for the previous post adjacent to the current post.":
"prefix":"prev_post_rel_link"
"body":"prev_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Start preview theme output buffer.":
"prefix":"preview_theme"
"body":"preview_theme()"
"Callback function for ob_start() to capture all links in the theme.":
"prefix":"preview_theme_ob_filter"
"body":"preview_theme_ob_filter( ${1:\\$content} )"
"Manipulates preview theme links in order to control and maintain location.":
"prefix":"preview_theme_ob_filter_callback"
"body":"preview_theme_ob_filter_callback( ${1:\\$matches} )"
"Displays the link to the previous comments page.":
"prefix":"previous_comments_link"
"body":"previous_comments_link( ${1:\\$label = ''} )"
"Displays previous image link that has the same post parent.":
"prefix":"previous_image_link"
"body":"previous_image_link( ${1:\\$size = 'thumbnail'}${2:, \\$text = false} )"
"Prints a link to the previous post.":
"prefix":"previous_post"
"body":"previous_post( ${1:\\$format = '%'}${2:, \\$previous = 'previous post: '}${3:, \\$title = 'yes'}${4:, \\$in_same_cat = 'no'}${5:, \\$limitprev = 1}${6:, \\$excluded_categories = ''} )"
"Displays the previous post link that is adjacent to the current post.":
"prefix":"previous_post_link"
"body":"previous_post_link( ${1:\\$format = '« %link'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Displays or retrieves the previous posts page link.":
"prefix":"previous_posts"
"body":"previous_posts( ${1:\\$echo = true} )"
"Displays the previous posts page link.":
"prefix":"previous_posts_link"
"body":"previous_posts_link( ${1:\\$label = null} )"
"Prints the styles queue in the HTML head on admin pages.":
"prefix":"print_admin_styles"
"body":"print_admin_styles()"
"Prints column headers for a particular screen.":
"prefix":"print_column_headers"
"body":"print_column_headers( ${1:\\$screen}${2:, \\$with_id = true} )"
"Prints the necessary markup for the embed comments button.":
"prefix":"print_embed_comments_button"
"body":"print_embed_comments_button()"
"Prints the JavaScript in the embed iframe header.":
"prefix":"print_embed_scripts"
"body":"print_embed_scripts()"
"Prints the necessary markup for the embed sharing button.":
"prefix":"print_embed_sharing_button"
"body":"print_embed_sharing_button()"
"Prints the necessary markup for the embed sharing dialog.":
"prefix":"print_embed_sharing_dialog"
"body":"print_embed_sharing_dialog()"
"Prints the CSS in the embed iframe header.":
"prefix":"print_embed_styles"
"body":"print_embed_styles()"
"Print the inline Emoji detection script if it is not already printed.":
"prefix":"print_emoji_detection_script"
"body":"print_emoji_detection_script()"
"Print the important emoji-related styles.":
"prefix":"print_emoji_styles"
"body":"print_emoji_styles()"
"Prints the scripts that were queued for the footer or too late for the HTML head.":
"prefix":"print_footer_scripts"
"body":"print_footer_scripts()"
"Prints the script queue in the HTML head on admin pages.":
"prefix":"print_head_scripts"
"body":"print_head_scripts()"
"Prints the styles that were queued too late for the HTML head.":
"prefix":"print_late_styles"
"body":"print_late_styles()"
"Check whether blog is public before returning sites.":
"prefix":"privacy_ping_filter"
"body":"privacy_ping_filter( ${1:\\$sites} )"
"Sets up The Loop with query parameters.":
"prefix":"query_posts"
"body":"query_posts( ${1:\\$query} )"
"Unless open_basedir is enabled, use /dev/urandom for
random numbers in accordance with best practices":
"prefix":"random_bytes"
"body":"random_bytes( ${1:\\$bytes} )"
"Fetch a random integer between $min and $max inclusive":
"prefix":"random_int"
"body":"random_int( ${1:\\$min}${2:, \\$max} )"
"Cast to an integer if we can, safely.":
"prefix":"randomcompat_intval"
"body":"randomcompat_intval( ${1:\\$number}${2:, \\$fail_open = false} )"
"strlen() implementation that isn't brittle to mbstring.func_overload":
"prefix":"randomcompat_strlen"
"body":"randomcompat_strlen( ${1:\\$binary_string} )"
"substr() implementation that isn't brittle to mbstring.func_overload":
"prefix":"randomcompat_substr"
"body":"randomcompat_substr( ${1:\\$binary_string}${2:, \\$start}${3:, \\$length = null} )"
"Navigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.":
"prefix":"rawurlencode_deep"
"body":"rawurlencode_deep( ${1:\\$value} )"
"Get the size of a directory recursively.":
"prefix":"recurse_dirsize"
"body":"recurse_dirsize( ${1:\\$directory}${2:, \\$exclude = null} )"
"Redirects incoming links to the proper URL based on the site url.":
"prefix":"redirect_canonical"
"body":"redirect_canonical( ${1:\\$requested_url = null}${2:, \\$do_redirect = true} )"
"Attempts to guess the correct URL based on query vars":
"prefix":"redirect_guess_404_permalink"
"body":"redirect_guess_404_permalink()"
"Redirect to previous page.":
"prefix":"redirect_post"
"body":"redirect_post( ${1:\\$post_id = ''} )"
"Ensure that the current site's domain is listed in the allowed redirect host list.":
"prefix":"redirect_this_site"
"body":"redirect_this_site( ${1:\\$deprecated = ''} )"
"Clear the blog details cache.":
"prefix":"refresh_blog_details"
"body":"refresh_blog_details( ${1:\\$blog_id} )"
"Cleans the user cache for a specific user.":
"prefix":"refresh_user_details"
"body":"refresh_user_details( ${1:\\$id} )"
"Set the activation hook for a plugin.":
"prefix":"register_activation_hook"
"body":"register_activation_hook( ${1:\\$file}${2:, \\$function} )"
"Registers the default Admin color schemes":
"prefix":"register_admin_color_schemes"
"body":"register_admin_color_schemes()"
"Register column headers for a particular screen.":
"prefix":"register_column_headers"
"body":"register_column_headers( ${1:\\$screen}${2:, \\$columns} )"
"Set the deactivation hook for a plugin.":
"prefix":"register_deactivation_hook"
"body":"register_deactivation_hook( ${1:\\$file}${2:, \\$function} )"
"Register a selection of default headers to be displayed by the custom header admin UI.":
"prefix":"register_default_headers"
"body":"register_default_headers( ${1:\\$headers} )"
"Register importer for WordPress.":
"prefix":"register_importer"
"body":"register_importer( ${1:\\$id}${2:, \\$name}${3:, \\$description}${4:, \\$callback} )"
"Register default settings available in WordPress.":
"prefix":"register_initial_settings"
"body":"register_initial_settings()"
"Registers a meta key.":
"prefix":"register_meta"
"body":"register_meta( ${1:\\$object_type}${2:, \\$meta_key}${3:, \\$args}${4:, \\$deprecated = null} )"
"Registers a navigation menu location for a theme.":
"prefix":"register_nav_menu"
"body":"register_nav_menu( ${1:\\$location}${2:, \\$description} )"
"Registers navigation menu locations for a theme.":
"prefix":"register_nav_menus"
"body":"register_nav_menus( ${1:\\$locations = array()} )"
"Handles registering a new user.":
"prefix":"register_new_user"
"body":"register_new_user( ${1:\\$user_login}${2:, \\$user_email} )"
"Register a post status. Do not use before init.":
"prefix":"register_post_status"
"body":"register_post_status( ${1:\\$post_status}${2:, \\$args = array()} )"
"Registers a post type.":
"prefix":"register_post_type"
"body":"register_post_type( ${1:\\$post_type}${2:, \\$args = array()} )"
"Registers a new field on an existing WordPress object type.":
"prefix":"register_rest_field"
"body":"register_rest_field( ${1:\\$object_type}${2:, \\$attribute}${3:, \\$args = array()} )"
"Registers a REST API route.":
"prefix":"register_rest_route"
"body":"register_rest_route( ${1:\\$namespace}${2:, \\$route}${3:, \\$args = array()}${4:, \\$override = false} )"
"Register a setting and its data.":
"prefix":"register_setting"
"body":"register_setting( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$args = array()} )"
"Builds the definition for a single sidebar and returns the ID.":
"prefix":"register_sidebar"
"body":"register_sidebar( ${1:\\$args = array()} )"
"Register widget for sidebar with backward compatibility.":
"prefix":"register_sidebar_widget"
"body":"register_sidebar_widget( ${1:\\$name}${2:, \\$output_callback}${3:, \\$classname = ''}${4:, \\$params} )"
"Creates multiple sidebars.":
"prefix":"register_sidebars"
"body":"register_sidebars( ${1:\\$number = 1}${2:, \\$args = array()} )"
"Creates or modifies a taxonomy object.":
"prefix":"register_taxonomy"
"body":"register_taxonomy( ${1:\\$taxonomy}${2:, \\$object_type}${3:, \\$args = array()} )"
"Add an already registered taxonomy to an object type.":
"prefix":"register_taxonomy_for_object_type"
"body":"register_taxonomy_for_object_type( ${1:\\$taxonomy}${2:, \\$object_type} )"
"Register a directory that contains themes.":
"prefix":"register_theme_directory"
"body":"register_theme_directory( ${1:\\$directory} )"
"Set the uninstallation hook for a plugin.":
"prefix":"register_uninstall_hook"
"body":"register_uninstall_hook( ${1:\\$file}${2:, \\$callback} )"
"Register a widget":
"prefix":"register_widget"
"body":"register_widget( ${1:\\$widget_class} )"
"Registers widget control callback for customizing options. register_widget_control":
"prefix":"register_widget_control"
"body":"register_widget_control( ${1:\\$name}${2:, \\$control_callback}${3:, \\$width = ''}${4:, \\$height = ''} )"
"Checks if a meta key is registered.":
"prefix":"registered_meta_key_exists"
"body":"registered_meta_key_exists( ${1:\\$object_type}${2:, \\$meta_key} )"
"Outputs rel=canonical for singular queries.":
"prefix":"rel_canonical"
"body":"rel_canonical()"
"Converts all accent characters to ASCII characters.":
"prefix":"remove_accents"
"body":"remove_accents( ${1:\\$string} )"
"Removes a function from a specified action hook.":
"prefix":"remove_action"
"body":"remove_action( ${1:\\$tag}${2:, \\$function_to_remove}${3:, \\$priority = 10} )"
"Remove all of the hooks from an action.":
"prefix":"remove_all_actions"
"body":"remove_all_actions( ${1:\\$tag}${2:, \\$priority = false} )"
"Remove all of the hooks from a filter.":
"prefix":"remove_all_filters"
"body":"remove_all_filters( ${1:\\$tag}${2:, \\$priority = false} )"
"Clear all shortcodes.":
"prefix":"remove_all_shortcodes"
"body":"remove_all_shortcodes()"
"Remove custom background support.":
"prefix":"remove_custom_background"
"body":"remove_custom_background()"
"Remove image header support.":
"prefix":"remove_custom_image_header"
"body":"remove_custom_image_header()"
"Removes all visual editor stylesheets.":
"prefix":"remove_editor_styles"
"body":"remove_editor_styles()"
"Removes a function from a specified filter hook.":
"prefix":"remove_filter"
"body":"remove_filter( ${1:\\$tag}${2:, \\$function_to_remove}${3:, \\$priority = 10} )"
"Remove a new image size.":
"prefix":"remove_image_size"
"body":"remove_image_size( ${1:\\$name} )"
"Remove a top-level admin menu.":
"prefix":"remove_menu_page"
"body":"remove_menu_page( ${1:\\$menu_slug} )"
"Removes a meta box from one or more screens.":
"prefix":"remove_meta_box"
"body":"remove_meta_box( ${1:\\$id}${2:, \\$screen}${3:, \\$context} )"
"Unregister a setting":
"prefix":"remove_option_update_handler"
"body":"remove_option_update_handler( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$sanitize_callback = ''} )"
"Removes a list of options from the options whitelist.":
"prefix":"remove_option_whitelist"
"body":"remove_option_whitelist( ${1:\\$del_options}${2:, \\$options = ''} )"
"Removes a permalink structure.":
"prefix":"remove_permastruct"
"body":"remove_permastruct( ${1:\\$name} )"
"Remove support for a feature from a post type.":
"prefix":"remove_post_type_support"
"body":"remove_post_type_support( ${1:\\$post_type}${2:, \\$feature} )"
"Removes an item or items from a query string.":
"prefix":"remove_query_arg"
"body":"remove_query_arg( ${1:\\$key}${2:, \\$query = false} )"
"Removes an existing rewrite tag (like %postname%).":
"prefix":"remove_rewrite_tag"
"body":"remove_rewrite_tag( ${1:\\$tag} )"
"Remove role, if it exists.":
"prefix":"remove_role"
"body":"remove_role( ${1:\\$role} )"
"Removes hook for shortcode.":
"prefix":"remove_shortcode"
"body":"remove_shortcode( ${1:\\$tag} )"
"Remove an admin submenu.":
"prefix":"remove_submenu_page"
"body":"remove_submenu_page( ${1:\\$menu_slug}${2:, \\$submenu_slug} )"
"Remove theme modification name from current theme list.":
"prefix":"remove_theme_mod"
"body":"remove_theme_mod( ${1:\\$name} )"
"Remove theme modifications option for current theme.":
"prefix":"remove_theme_mods"
"body":"remove_theme_mods()"
"Allows a theme to de-register its support of a certain feature":
"prefix":"remove_theme_support"
"body":"remove_theme_support( ${1:\\$feature} )"
"Remove a user from a blog.":
"prefix":"remove_user_from_blog"
"body":"remove_user_from_blog( ${1:\\$user_id}${2:, \\$blog_id = ''}${3:, \\$reassign = ''} )"
"Displays a form to the user to request for their FTP/SSH details in order
to connect to the filesystem.":
"prefix":"request_filesystem_credentials"
"body":"request_filesystem_credentials( ${1:\\$form_post}${2:, \\$type = ''}${3:, \\$error = false}${4:, \\$context = ''}${5:, \\$extra_fields = null}${6:, \\$allow_relaxed_file_ownership = false} )"
"Checks a theme's support for a given feature before loading the functions which implement it.":
"prefix":"require_if_theme_supports"
"body":"require_if_theme_supports( ${1:\\$feature}${2:, \\$include} )"
"Load the database class file and instantiate the `$wpdb` global.":
"prefix":"require_wp_db"
"body":"require_wp_db()"
"Reset the mbstring internal encoding to a users previously set encoding.":
"prefix":"reset_mbstring_encoding"
"body":"reset_mbstring_encoding()"
"Handles resetting the user's password.":
"prefix":"reset_password"
"body":"reset_password( ${1:\\$user}${2:, \\$new_pass} )"
"Registers the default REST API filters.":
"prefix":"rest_api_default_filters"
"body":"rest_api_default_filters()"
"Registers rewrite rules for the API.":
"prefix":"rest_api_init"
"body":"rest_api_init()"
"Loads the REST API.":
"prefix":"rest_api_loaded"
"body":"rest_api_loaded()"
"Adds REST rewrite rules.":
"prefix":"rest_api_register_rewrites"
"body":"rest_api_register_rewrites()"
"Returns a contextual HTTP error code for authorization failure.":
"prefix":"rest_authorization_required_code"
"body":"rest_authorization_required_code()"
"Checks for errors when using cookie-based authentication.":
"prefix":"rest_cookie_check_errors"
"body":"rest_cookie_check_errors( ${1:\\$result} )"
"Collects cookie authentication status.":
"prefix":"rest_cookie_collect_status"
"body":"rest_cookie_collect_status()"
"Do a REST request.":
"prefix":"rest_do_request"
"body":"rest_do_request( ${1:\\$request} )"
"Ensures request arguments are a request object (for consistency).":
"prefix":"rest_ensure_request"
"body":"rest_ensure_request( ${1:\\$request} )"
"Ensures a REST response is a response object (for consistency).":
"prefix":"rest_ensure_response"
"body":"rest_ensure_response( ${1:\\$response} )"
"Retrieves the pixel sizes for avatars.":
"prefix":"rest_get_avatar_sizes"
"body":"rest_get_avatar_sizes()"
"Retrieves the avatar urls in various sizes based on a given email address.":
"prefix":"rest_get_avatar_urls"
"body":"rest_get_avatar_urls( ${1:\\$email} )"
"Parses a date into both its local and UTC equivalent, in MySQL datetime format.":
"prefix":"rest_get_date_with_gmt"
"body":"rest_get_date_with_gmt( ${1:\\$date}${2:, \\$is_utc = false} )"
"Retrieves the current REST server instance.":
"prefix":"rest_get_server"
"body":"rest_get_server()"
"Retrieves the URL prefix for any API resource.":
"prefix":"rest_get_url_prefix"
"body":"rest_get_url_prefix()"
"Handles _deprecated_argument() errors.":
"prefix":"rest_handle_deprecated_argument"
"body":"rest_handle_deprecated_argument( ${1:\\$function}${2:, \\$message}${3:, \\$version} )"
"Handles _deprecated_function() errors.":
"prefix":"rest_handle_deprecated_function"
"body":"rest_handle_deprecated_function( ${1:\\$function}${2:, \\$replacement}${3:, \\$version} )"
"Handles OPTIONS requests for the server.":
"prefix":"rest_handle_options_request"
"body":"rest_handle_options_request( ${1:\\$response}${2:, \\$handler}${3:, \\$request} )"
"Determines if a given value is boolean-like.":
"prefix":"rest_is_boolean"
"body":"rest_is_boolean( ${1:\\$maybe_bool} )"
"Determines if an IP address is valid.":
"prefix":"rest_is_ip_address"
"body":"rest_is_ip_address( ${1:\\$ip} )"
"Sends a Link header for the REST API.":
"prefix":"rest_output_link_header"
"body":"rest_output_link_header()"
"Outputs the REST API link tag into page header.":
"prefix":"rest_output_link_wp_head"
"body":"rest_output_link_wp_head()"
"Adds the REST API URL to the WP RSD endpoint.":
"prefix":"rest_output_rsd"
"body":"rest_output_rsd()"
"Parses an RFC3339 time into a Unix timestamp.":
"prefix":"rest_parse_date"
"body":"rest_parse_date( ${1:\\$date}${2:, \\$force_utc = false} )"
"Parse a request argument based on details registered to the route.":
"prefix":"rest_parse_request_arg"
"body":"rest_parse_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Changes a boolean-like value into the proper boolean value.":
"prefix":"rest_sanitize_boolean"
"body":"rest_sanitize_boolean( ${1:\\$value} )"
"Sanitize a request argument based on details registered to the route.":
"prefix":"rest_sanitize_request_arg"
"body":"rest_sanitize_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Sanitize a value based on a schema.":
"prefix":"rest_sanitize_value_from_schema"
"body":"rest_sanitize_value_from_schema( ${1:\\$value}${2:, \\$args} )"
"Sends the "Allow" header to state all methods that can be sent to the current route.":
"prefix":"rest_send_allow_header"
"body":"rest_send_allow_header( ${1:\\$response}${2:, \\$server}${3:, \\$request} )"
"Sends Cross-Origin Resource Sharing headers with API requests.":
"prefix":"rest_send_cors_headers"
"body":"rest_send_cors_headers( ${1:\\$value} )"
"Retrieves the URL to a REST endpoint.":
"prefix":"rest_url"
"body":"rest_url( ${1:\\$path = ''}${2:, \\$scheme = 'json'} )"
"Validate a request argument based on details registered to the route.":
"prefix":"rest_validate_request_arg"
"body":"rest_validate_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Validate a value based on a schema.":
"prefix":"rest_validate_value_from_schema"
"body":"rest_validate_value_from_schema( ${1:\\$value}${2:, \\$args}${3:, \\$param = ''} )"
"Restore the current blog, after calling switch_to_blog()":
"prefix":"restore_current_blog"
"body":"restore_current_blog()"
"Restores the translations according to the original locale.":
"prefix":"restore_current_locale"
"body":"restore_current_locale()"
"Restores the translations according to the previous locale.":
"prefix":"restore_previous_locale"
"body":"restore_previous_locale()"
"Handles sending password retrieval email to user.":
"prefix":"retrieve_password"
"body":"retrieve_password()"
"Look for "lost" widgets, this has to run at least on each theme change.":
"prefix":"retrieve_widgets"
"body":"retrieve_widgets( ${1:\\$theme_changed = false} )"
"Revokes Super Admin privileges.":
"prefix":"revoke_super_admin"
"body":"revoke_super_admin( ${1:\\$user_id} )"
"Rewind the loop posts.":
"prefix":"rewind_posts"
"body":"rewind_posts()"
"Determine if TinyMCE is available.":
"prefix":"rich_edit_exists"
"body":"rich_edit_exists()"
"Display the link to the Really Simple Discovery service endpoint.":
"prefix":"rsd_link"
"body":"rsd_link()"
"Displays Site Icon in RSS2.":
"prefix":"rss2_site_icon"
"body":"rss2_site_icon()"
"Display the rss enclosure for the current post.":
"prefix":"rss_enclosure"
"body":"rss_enclosure()"
"Inline CSS filter":
"prefix":"safecss_filter_attr"
"body":"safecss_filter_attr( ${1:\\$css}${2:, \\$deprecated = ''} )"
"Sanitizes all bookmark fields":
"prefix":"sanitize_bookmark"
"body":"sanitize_bookmark( ${1:\\$bookmark}${2:, \\$context = 'display'} )"
"Sanitizes a bookmark field.":
"prefix":"sanitize_bookmark_field"
"body":"sanitize_bookmark_field( ${1:\\$field}${2:, \\$value}${3:, \\$bookmark_id}${4:, \\$context} )"
"Sanitizes category data based on context.":
"prefix":"sanitize_category"
"body":"sanitize_category( ${1:\\$category}${2:, \\$context = 'display'} )"
"Sanitizes data in single category key field.":
"prefix":"sanitize_category_field"
"body":"sanitize_category_field( ${1:\\$field}${2:, \\$value}${3:, \\$cat_id}${4:, \\$context} )"
"Sanitizes the cookies sent to the user already.":
"prefix":"sanitize_comment_cookies"
"body":"sanitize_comment_cookies()"
"Strips out all characters that are not allowable in an email.":
"prefix":"sanitize_email"
"body":"sanitize_email( ${1:\\$email} )"
"Sanitizes a filename, replacing whitespace with dashes.":
"prefix":"sanitize_file_name"
"body":"sanitize_file_name( ${1:\\$filename} )"
"Sanitizes a hex color.":
"prefix":"sanitize_hex_color"
"body":"sanitize_hex_color( ${1:\\$color} )"
"Sanitizes a hex color without a hash. Use sanitize_hex_color() when possible.":
"prefix":"sanitize_hex_color_no_hash"
"body":"sanitize_hex_color_no_hash( ${1:\\$color} )"
"Sanitizes an HTML classname to ensure it only contains valid characters.":
"prefix":"sanitize_html_class"
"body":"sanitize_html_class( ${1:\\$class}${2:, \\$fallback = ''} )"
"Sanitizes a string key.":
"prefix":"sanitize_key"
"body":"sanitize_key( ${1:\\$key} )"
"Sanitize meta value.":
"prefix":"sanitize_meta"
"body":"sanitize_meta( ${1:\\$meta_key}${2:, \\$meta_value}${3:, \\$object_type} )"
"Sanitize a mime type":
"prefix":"sanitize_mime_type"
"body":"sanitize_mime_type( ${1:\\$mime_type} )"
"Sanitises various option values based on the nature of the option.":
"prefix":"sanitize_option"
"body":"sanitize_option( ${1:\\$option}${2:, \\$value} )"
"Sanitize every post field.":
"prefix":"sanitize_post"
"body":"sanitize_post( ${1:\\$post}${2:, \\$context = 'display'} )"
"Sanitize post field based on context.":
"prefix":"sanitize_post_field"
"body":"sanitize_post_field( ${1:\\$field}${2:, \\$value}${3:, \\$post_id}${4:, \\$context = 'display'} )"
"Ensures a string is a valid SQL 'order by' clause.":
"prefix":"sanitize_sql_orderby"
"body":"sanitize_sql_orderby( ${1:\\$orderby} )"
"Sanitize Term all fields.":
"prefix":"sanitize_term"
"body":"sanitize_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$context = 'display'} )"
"Cleanse the field value in the term based on the context.":
"prefix":"sanitize_term_field"
"body":"sanitize_term_field( ${1:\\$field}${2:, \\$value}${3:, \\$term_id}${4:, \\$taxonomy}${5:, \\$context} )"
"Sanitizes a string from user input or from the database.":
"prefix":"sanitize_text_field"
"body":"sanitize_text_field( ${1:\\$str} )"
"Sanitizes a multiline string from user input or from the database.":
"prefix":"sanitize_textarea_field"
"body":"sanitize_textarea_field( ${1:\\$str} )"
"Sanitizes a title, or returns a fallback title.":
"prefix":"sanitize_title"
"body":"sanitize_title( ${1:\\$title}${2:, \\$fallback_title = ''}${3:, \\$context = 'save'} )"
"Sanitizes a title with the 'query' context.":
"prefix":"sanitize_title_for_query"
"body":"sanitize_title_for_query( ${1:\\$title} )"
"Sanitizes a title, replacing whitespace and a few other characters with dashes.":
"prefix":"sanitize_title_with_dashes"
"body":"sanitize_title_with_dashes( ${1:\\$title}${2:, \\$raw_title = ''}${3:, \\$context = 'display'} )"
"Sanitize space or carriage return separated URLs that are used to send trackbacks.":
"prefix":"sanitize_trackback_urls"
"body":"sanitize_trackback_urls( ${1:\\$to_ping} )"
"Performs esc_url() for database or redirect usage.":
"prefix":"sanitize_url"
"body":"sanitize_url( ${1:\\$url}${2:, \\$protocols = null} )"
"Sanitizes a username, stripping out unsafe characters.":
"prefix":"sanitize_user"
"body":"sanitize_user( ${1:\\$username}${2:, \\$strict = false} )"
"Sanitize user field based on context.":
"prefix":"sanitize_user_field"
"body":"sanitize_user_field( ${1:\\$field}${2:, \\$value}${3:, \\$user_id}${4:, \\$context} )"
"Sanitize every user field.":
"prefix":"sanitize_user_object"
"body":"sanitize_user_object( ${1:\\$user}${2:, \\$context = 'display'} )"
"Updates the htaccess file with the current rules if it is writable.":
"prefix":"save_mod_rewrite_rules"
"body":"save_mod_rewrite_rules()"
"Saves the XML document into a file":
"prefix":"savedomdocument"
"body":"savedomdocument( ${1:\\$doc}${2:, \\$filename} )"
"Displays a screen icon.":
"prefix":"screen_icon"
"body":"screen_icon()"
"Returns the screen layout options.":
"prefix":"screen_layout"
"body":"screen_layout()"
"Renders the screen's help.":
"prefix":"screen_meta"
"body":"screen_meta()"
"Returns the screen's per-page options.":
"prefix":"screen_options"
"body":"screen_options()"
"Determine the concatenation and compression settings for scripts and styles.":
"prefix":"script_concat_settings"
"body":"script_concat_settings()"
"Search all registered theme directories for complete and valid themes.":
"prefix":"search_theme_directories"
"body":"search_theme_directories( ${1:\\$force = false} )"
"Checks to see if a string is utf8 encoded.":
"prefix":"seems_utf8"
"body":"seems_utf8( ${1:\\$str} )"
"Outputs the html selected attribute.":
"prefix":"selected"
"body":"selected( ${1:\\$selected}${2:, \\$current = true}${3:, \\$echo = true} )"
"Retrieves the URL to the admin area for either the current site or the network depending on context.":
"prefix":"self_admin_url"
"body":"self_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Display the link for the currently displayed feed in a XSS safe way.":
"prefix":"self_link"
"body":"self_link()"
"Sends an email when an email address change is requested.":
"prefix":"send_confirmation_on_profile_email"
"body":"send_confirmation_on_profile_email()"
"Send a HTTP header to limit rendering of pages to same origin iframes.":
"prefix":"send_frame_options_header"
"body":"send_frame_options_header()"
"Send a HTTP header to disable content type sniffing in browsers which support it.":
"prefix":"send_nosniff_header"
"body":"send_nosniff_header()"
"Send Access-Control-Allow-Origin and related headers if the current request
is from an allowed origin.":
"prefix":"send_origin_headers"
"body":"send_origin_headers()"
"Separates an array of comments into an array keyed by comment_type.":
"prefix":"separate_comments"
"body":"separate_comments( ${1:\\$comments} )"
"Set the current screen object":
"prefix":"set_current_screen"
"body":"set_current_screen( ${1:\\$hook_name = ''} )"
"Changes the current user by ID or name. set_current_user":
"prefix":"set_current_user"
"body":"set_current_user( ${1:\\$id}${2:, \\$name = ''} )"
"Assign a format to a post":
"prefix":"set_post_format"
"body":"set_post_format( ${1:\\$post}${2:, \\$format} )"
"Set a post thumbnail.":
"prefix":"set_post_thumbnail"
"body":"set_post_thumbnail( ${1:\\$post}${2:, \\$thumbnail_id} )"
"Registers an image size for the post thumbnail.":
"prefix":"set_post_thumbnail_size"
"body":"set_post_thumbnail_size( ${1:\\$width}${2:, \\$height}${3:, \\$crop = false} )"
"Update the post type for the post ID.":
"prefix":"set_post_type"
"body":"set_post_type( ${1:\\$post_id}${2:, \\$post_type = 'post'} )"
"Set query variable.":
"prefix":"set_query_var"
"body":"set_query_var( ${1:\\$var}${2:, \\$value} )"
"Saves option for number of rows when listing posts, pages, comments, etc.":
"prefix":"set_screen_options"
"body":"set_screen_options()"
"Set/update the value of a site transient.":
"prefix":"set_site_transient"
"body":"set_site_transient( ${1:\\$transient}${2:, \\$value}${3:, \\$expiration} )"
"Update theme modification value for the current theme.":
"prefix":"set_theme_mod"
"body":"set_theme_mod( ${1:\\$name}${2:, \\$value} )"
"Set/update the value of a transient.":
"prefix":"set_transient"
"body":"set_transient( ${1:\\$transient}${2:, \\$value}${3:, \\$expiration} )"
"Sets the scheme for a URL.":
"prefix":"set_url_scheme"
"body":"set_url_scheme( ${1:\\$url}${2:, \\$scheme = null} )"
"Add or update user interface setting.":
"prefix":"set_user_setting"
"body":"set_user_setting( ${1:\\$name}${2:, \\$value} )"
"Display settings errors registered by add_settings_error().":
"prefix":"settings_errors"
"body":"settings_errors( ${1:\\$setting = ''}${2:, \\$sanitize = false}${3:, \\$hide_on_update = false} )"
"Output nonce, action, and option_page fields for a settings page.":
"prefix":"settings_fields"
"body":"settings_fields( ${1:\\$option_group} )"
"setup_config_display_header":
"prefix":"setup_config_display_header"
"body":"setup_config_display_header()"
"Set up global post data.":
"prefix":"setup_postdata"
"body":"setup_postdata( ${1:\\$post} )"
"Set up global user vars.":
"prefix":"setup_userdata"
"body":"setup_userdata( ${1:\\$for_user_id = ''} )"
"Combine user attributes with known attributes and fill in defaults when needed.":
"prefix":"shortcode_atts"
"body":"shortcode_atts( ${1:\\$pairs}${2:, \\$atts}${3:, \\$shortcode = ''} )"
"Whether a registered shortcode exists named $tag":
"prefix":"shortcode_exists"
"body":"shortcode_exists( ${1:\\$tag} )"
"Retrieve all attributes from the shortcodes tag.":
"prefix":"shortcode_parse_atts"
"body":"shortcode_parse_atts( ${1:\\$text} )"
"Don't auto-p wrap shortcodes that stand alone":
"prefix":"shortcode_unautop"
"body":"shortcode_unautop( ${1:\\$pee} )"
"Sets the display status of the admin bar.":
"prefix":"show_admin_bar"
"body":"show_admin_bar( ${1:\\$show} )"
"Generates and displays the Signup and Create Site forms":
"prefix":"show_blog_form"
"body":"show_blog_form( ${1:\\$blogname = ''}${2:, \\$blog_title = ''}${3:, \\$errors = ''} )"
"Displays the given administration message.":
"prefix":"show_message"
"body":"show_message( ${1:\\$message} )"
"Display user registration form":
"prefix":"show_user_form"
"body":"show_user_form( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$errors = ''} )"
"Runs just before PHP shuts down execution.":
"prefix":"shutdown_action_hook"
"body":"shutdown_action_hook()"
"Allow returning users to sign up for another site":
"prefix":"signup_another_blog"
"body":"signup_another_blog( ${1:\\$blogname = ''}${2:, \\$blog_title = ''}${3:, \\$errors = ''} )"
"Setup the new site signup":
"prefix":"signup_blog"
"body":"signup_blog( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$blogname = ''}${4:, \\$blog_title = ''}${5:, \\$errors = ''} )"
"Retrieves languages available during the site/user signup process.":
"prefix":"signup_get_available_languages"
"body":"signup_get_available_languages()"
"Process the signup nonce created in signup_nonce_fields().":
"prefix":"signup_nonce_check"
"body":"signup_nonce_check( ${1:\\$result} )"
"Add a nonce field to the signup page.":
"prefix":"signup_nonce_fields"
"body":"signup_nonce_fields()"
"Setup the new user signup process":
"prefix":"signup_user"
"body":"signup_user( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$errors = ''} )"
"Display or retrieve page title for category archive.":
"prefix":"single_cat_title"
"body":"single_cat_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for post archive based on date.":
"prefix":"single_month_title"
"body":"single_month_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for post.":
"prefix":"single_post_title"
"body":"single_post_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for tag post archive.":
"prefix":"single_tag_title"
"body":"single_tag_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for taxonomy term archive.":
"prefix":"single_term_title"
"body":"single_term_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Displays an admin notice to upgrade all sites after a core upgrade.":
"prefix":"site_admin_notice"
"body":"site_admin_notice()"
"Displays the Site Icon URL.":
"prefix":"site_icon_url"
"body":"site_icon_url( ${1:\\$size = 512}${2:, \\$url = ''}${3:, \\$blog_id} )"
"Retrieves the URL for the current site where WordPress application files
(e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.":
"prefix":"site_url"
"body":"site_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Convert number of bytes largest unit bytes will fit into.":
"prefix":"size_format"
"body":"size_format( ${1:\\$bytes}${2:, \\$decimals} )"
"Convert smiley code to the icon graphic file equivalent.":
"prefix":"smilies_init"
"body":"smilies_init()"
"sort_menu":
"prefix":"sort_menu"
"body":"sort_menu( ${1:\\$a}${2:, \\$b} )"
"Sends a request to run cron through HTTP request that doesn't halt page loading.":
"prefix":"spawn_cron"
"body":"spawn_cron( ${1:\\$gmt_time} )"
"Retrieves the registered autoloader functions.":
"prefix":"spl_autoload_functions"
"body":"spl_autoload_functions()"
"Registers a function to be autoloaded.":
"prefix":"spl_autoload_register"
"body":"spl_autoload_register( ${1:\\$autoload_function}${2:, \\$throw = true}${3:, \\$prepend = false} )"
"Unregisters an autoloader function.":
"prefix":"spl_autoload_unregister"
"body":"spl_autoload_unregister( ${1:\\$function} )"
"Display relational link for the first post.":
"prefix":"start_post_rel_link"
"body":"start_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_cat = false}${3:, \\$excluded_categories = ''} )"
"Sets up the WordPress Loop.":
"prefix":"start_wp"
"body":"start_wp()"
"XML callback function for the start of a new XML tag.":
"prefix":"startelement"
"body":"startelement( ${1:\\$parser}${2:, \\$tagName}${3:, \\$attrs} )"
"Set HTTP status header.":
"prefix":"status_header"
"body":"status_header( ${1:\\$code}${2:, \\$description = ''} )"
"Make a post sticky.":
"prefix":"stick_post"
"body":"stick_post( ${1:\\$post_id} )"
"Display "sticky" CSS class, if a post is sticky.":
"prefix":"sticky_class"
"body":"sticky_class( ${1:\\$post_id = null} )"
"Streams image in post to browser, along with enqueued changes
in $_REQUEST['history']":
"prefix":"stream_preview_image"
"body":"stream_preview_image( ${1:\\$post_id} )"
"Strips the #fragment from a URL, if one is present.":
"prefix":"strip_fragment_from_url"
"body":"strip_fragment_from_url( ${1:\\$url} )"
"Strips a shortcode tag based on RegEx matches against post content.":
"prefix":"strip_shortcode_tag"
"body":"strip_shortcode_tag( ${1:\\$m} )"
"Remove all shortcode tags from the given content.":
"prefix":"strip_shortcodes"
"body":"strip_shortcodes( ${1:\\$content} )"
"Navigates through an array, object, or scalar, and removes slashes from the values.":
"prefix":"stripslashes_deep"
"body":"stripslashes_deep( ${1:\\$value} )"
"Callback function for `stripslashes_deep()` which strips slashes from strings.":
"prefix":"stripslashes_from_strings_only"
"body":"stripslashes_from_strings_only( ${1:\\$value} )"
"Echoes a submit button, with provided text and appropriate class(es).":
"prefix":"submit_button"
"body":"submit_button( ${1:\\$text = null}${2:, \\$type = 'primary'}${3:, \\$name = 'submit'}${4:, \\$wrap = true}${5:, \\$other_attributes = null} )"
"Switches the theme.":
"prefix":"switch_theme"
"body":"switch_theme( ${1:\\$stylesheet} )"
"Switch the current blog.":
"prefix":"switch_to_blog"
"body":"switch_to_blog( ${1:\\$new_blog}${2:, \\$deprecated = null} )"
"Switches the translations according to the given locale.":
"prefix":"switch_to_locale"
"body":"switch_to_locale( ${1:\\$locale} )"
"Synchronize category and post tag slugs when global terms are enabled.":
"prefix":"sync_category_tag_slugs"
"body":"sync_category_tag_slugs( ${1:\\$term}${2:, \\$taxonomy} )"
"Retrieve tag description.":
"prefix":"tag_description"
"body":"tag_description( ${1:\\$tag} )"
"Escape an HTML tag name.":
"prefix":"tag_escape"
"body":"tag_escape( ${1:\\$tag_name} )"
"Check whether a post tag with a given name exists.":
"prefix":"tag_exists"
"body":"tag_exists( ${1:\\$tag_name} )"
"Checks that the taxonomy name exists. taxonomy_exists":
"prefix":"taxonomy_exists"
"body":"taxonomy_exists( ${1:\\$taxonomy} )"
"Retrieve term description.":
"prefix":"term_description"
"body":"term_description( ${1:\\$term}${2:, \\$taxonomy = 'post_tag'} )"
"Check if Term exists term_exists.":
"prefix":"term_exists"
"body":"term_exists( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$parent = null} )"
"Check if a term is an ancestor of another term.":
"prefix":"term_is_ancestor_of"
"body":"term_is_ancestor_of( ${1:\\$term1}${2:, \\$term2}${3:, \\rel$taxonomy} )"
"Display category, tag, term, or author description.":
"prefix":"the_archive_description"
"body":"the_archive_description( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Display the archive title based on the queried object.":
"prefix":"the_archive_title"
"body":"the_archive_title( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Display an attachment page link using an image or icon.":
"prefix":"the_attachment_link"
"body":"the_attachment_link( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$deprecated = false}${4:, \\$permalink = false} )"
"This was once used to display attachment links. Now it is deprecated and stubbed.":
"prefix":"the_attachment_links"
"body":"the_attachment_links( ${1:\\$id = false} )"
"Display the name of the author of the current post.":
"prefix":"the_author"
"body":"the_author( ${1:\\$deprecated = ''}${2:, \\$deprecated_echo = true} )"
"Display the AIM address of the author of the current post.":
"prefix":"the_author_aim"
"body":"the_author_aim()"
"Display the description of the author of the current post.":
"prefix":"the_author_description"
"body":"the_author_description()"
"Display the email of the author of the current post.":
"prefix":"the_author_email"
"body":"the_author_email()"
"Display the first name of the author of the current post.":
"prefix":"the_author_firstname"
"body":"the_author_firstname()"
"Display the ICQ number of the author of the current post.":
"prefix":"the_author_icq"
"body":"the_author_icq()"
"Display the ID of the author of the current post.":
"prefix":"the_author_id"
"body":"the_author_id()"
"Display the last name of the author of the current post.":
"prefix":"the_author_lastname"
"body":"the_author_lastname()"
"Display either author's link or author's name.":
"prefix":"the_author_link"
"body":"the_author_link()"
"Display the login name of the author of the current post.":
"prefix":"the_author_login"
"body":"the_author_login()"
"Outputs the field from the user's DB object. Defaults to current post's author.":
"prefix":"the_author_meta"
"body":"the_author_meta( ${1:\\$field = ''}${2:, \\$user_id = false} )"
"Display the MSN address of the author of the current post.":
"prefix":"the_author_msn"
"body":"the_author_msn()"
"Display the nickname of the author of the current post.":
"prefix":"the_author_nickname"
"body":"the_author_nickname()"
"Display the number of posts by the author of the current post.":
"prefix":"the_author_posts"
"body":"the_author_posts()"
"Displays an HTML link to the author page of the current post's author.":
"prefix":"the_author_posts_link"
"body":"the_author_posts_link( ${1:\\$deprecated = ''} )"
"Display the URL to the home page of the author of the current post.":
"prefix":"the_author_url"
"body":"the_author_url()"
"Display the Yahoo! IM name of the author of the current post.":
"prefix":"the_author_yim"
"body":"the_author_yim()"
"Display category list for a post in either HTML list or custom format.":
"prefix":"the_category"
"body":"the_category( ${1:\\$separator = ''}${2:, \\$parents = ''}${3:, \\$post_id = false} )"
"Prints a category with optional text before and after.":
"prefix":"the_category_head"
"body":"the_category_head( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Returns or prints a category ID.":
"prefix":"the_category_id"
"body":"the_category_id( ${1:\\$echo = true} )"
"Display the post categories in the feed.":
"prefix":"the_category_rss"
"body":"the_category_rss( ${1:\\$type = null} )"
"Iterate comment index in the comment loop.":
"prefix":"the_comment"
"body":"the_comment()"
"Displays navigation to next/previous set of comments, when applicable.":
"prefix":"the_comments_navigation"
"body":"the_comments_navigation( ${1:\\$args = array()} )"
"Displays a paginated navigation to next/previous set of comments, when applicable.":
"prefix":"the_comments_pagination"
"body":"the_comments_pagination( ${1:\\$args = array()} )"
"Display the post content.":
"prefix":"the_content"
"body":"the_content( ${1:\\$more_link_text = null}${2:, \\$strip_teaser = false} )"
"Display the post content for feeds.":
"prefix":"the_content_feed"
"body":"the_content_feed( ${1:\\$feed_type = null} )"
"Display the post content for the feed.":
"prefix":"the_content_rss"
"body":"the_content_rss( ${1:\\$more_link_text = '(more...)'}${2:, \\$stripteaser}${3:, \\$more_file = ''}${4:, \\$cut}${5:, \\$encode_html} )"
"Print the markup for a custom header.":
"prefix":"the_custom_header_markup"
"body":"the_custom_header_markup()"
"Displays a custom logo, linked to home.":
"prefix":"the_custom_logo"
"body":"the_custom_logo( ${1:\\$blog_id} )"
"Display or Retrieve the date the current post was written (once per date)":
"prefix":"the_date"
"body":"the_date( ${1:\\$d = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$echo = true} )"
"Outputs the date in iso8601 format for xml files.":
"prefix":"the_date_xml"
"body":"the_date_xml()"
"Displays an editor: TinyMCE, HTML, or both.":
"prefix":"the_editor"
"body":"the_editor( ${1:\\$content}${2:, \\$id = 'content'}${3:, \\$prev_id = 'title'}${4:, \\$media_buttons = true}${5:, \\$tab_index = 2}${6:, \\$extended = true} )"
"Prints the necessary markup for the site title in an embed template.":
"prefix":"the_embed_site_title"
"body":"the_embed_site_title()"
"Display the post excerpt.":
"prefix":"the_excerpt"
"body":"the_excerpt()"
"Displays the post excerpt for the embed template.":
"prefix":"the_excerpt_embed"
"body":"the_excerpt_embed()"
"Display the post excerpt for the feed.":
"prefix":"the_excerpt_rss"
"body":"the_excerpt_rss()"
"Displays the permalink for the feed type.":
"prefix":"the_feed_link"
"body":"the_feed_link( ${1:\\$anchor}${2:, \\$feed = ''} )"
"Display the generator XML or Comment for RSS, ATOM, etc.":
"prefix":"the_generator"
"body":"the_generator( ${1:\\$type} )"
"Display the Post Global Unique Identifier (guid).":
"prefix":"the_guid"
"body":"the_guid( ${1:\\$post} )"
"Display the image markup for a custom header image.":
"prefix":"the_header_image_tag"
"body":"the_header_image_tag( ${1:\\$attr = array()} )"
"Display header video URL.":
"prefix":"the_header_video_url"
"body":"the_header_video_url()"
"Display the ID of the current item in the WordPress Loop.":
"prefix":"the_id"
"body":"the_id()"
"Outputs the legacy media upload tabs UI.":
"prefix":"the_media_upload_tabs"
"body":"the_media_upload_tabs()"
"Display list of post custom fields.":
"prefix":"the_meta"
"body":"the_meta()"
"Display the name of the author who last edited the current post,
if the author's ID is available.":
"prefix":"the_modified_author"
"body":"the_modified_author()"
"Display the date on which the post was last modified.":
"prefix":"the_modified_date"
"body":"the_modified_date( ${1:\\$d = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$echo = true} )"
"Display the time at which the post was last modified.":
"prefix":"the_modified_time"
"body":"the_modified_time( ${1:\\$d = ''} )"
"Displays the permalink for the current post.":
"prefix":"the_permalink"
"body":"the_permalink( ${1:\\$post} )"
"Display the permalink to the post for use in feeds.":
"prefix":"the_permalink_rss"
"body":"the_permalink_rss()"
"Iterate the post index in the loop.":
"prefix":"the_post"
"body":"the_post()"
"Displays the navigation to next/previous post, when applicable.":
"prefix":"the_post_navigation"
"body":"the_post_navigation( ${1:\\$args = array()} )"
"Displays the post password.":
"prefix":"the_post_password"
"body":"the_post_password()"
"Display the post thumbnail.":
"prefix":"the_post_thumbnail"
"body":"the_post_thumbnail( ${1:\\$size = 'post-thumbnail'}${2:, \\$attr = ''} )"
"Displays the post thumbnail caption.":
"prefix":"the_post_thumbnail_caption"
"body":"the_post_thumbnail_caption( ${1:\\$post = null} )"
"Display the post thumbnail URL.":
"prefix":"the_post_thumbnail_url"
"body":"the_post_thumbnail_url( ${1:\\$size = 'post-thumbnail'} )"
"Displays the navigation to next/previous set of posts, when applicable.":
"prefix":"the_posts_navigation"
"body":"the_posts_navigation( ${1:\\$args = array()} )"
"Displays a paginated navigation to next/previous set of posts, when applicable.":
"prefix":"the_posts_pagination"
"body":"the_posts_pagination( ${1:\\$args = array()} )"
"Displays the contents of the search query variable.":
"prefix":"the_search_query"
"body":"the_search_query()"
"Displays the shortlink for a post.":
"prefix":"the_shortlink"
"body":"the_shortlink( ${1:\\$text = ''}${2:, \\$title = ''}${3:, \\$before = ''}${4:, \\$after = ''} )"
"Retrieve the tags for a post. the_tags":
"prefix":"the_tags"
"body":"the_tags( ${1:\\$before = null}${2:, \\$sep = ', '}${3:, \\$after = ''} )"
"Display the taxonomies of a post with available options.":
"prefix":"the_taxonomies"
"body":"the_taxonomies( ${1:\\$args = array()} )"
"Display the terms in a list.":
"prefix":"the_terms"
"body":"the_terms( ${1:\\$id}${2:, \\$taxonomy}${3:, \\$before = ''}${4:, \\$sep = ', '}${5:, \\$after = ''} )"
"Display the time at which the post was written.":
"prefix":"the_time"
"body":"the_time( ${1:\\$d = ''} )"
"Display or retrieve the current post title with optional markup.":
"prefix":"the_title"
"body":"the_title( ${1:\\$before = ''}${2:, \\$after = ''}${3:, \\$echo = true} )"
"Sanitize the current title when retrieving or displaying.":
"prefix":"the_title_attribute"
"body":"the_title_attribute( ${1:\\$args = ''} )"
"Display the post title in the feed.":
"prefix":"the_title_rss"
"body":"the_title_rss()"
"Display the weekday on which the post was written. the_weekdayre":
"prefix":"the_weekday"
"body":"the_weekday()"
"Display the weekday on which the post was written.":
"prefix":"the_weekday_date"
"body":"the_weekday_date( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Output an arbitrary widget as a template tag.":
"prefix":"the_widget"
"body":"the_widget( ${1:\\$widget}${2:, \\$instance = array()}${3:, \\$args = array()} )"
"Check if there is an update for a theme available.":
"prefix":"theme_update_available"
"body":"theme_update_available( ${1:\\$theme} )"
"Retrieves theme installer pages from the WordPress.org Themes API.":
"prefix":"themes_api"
"body":"themes_api( ${1:\\$action}${2:, \\$args = array()} )"
"Start the WordPress micro-timer.":
"prefix":"timer_start"
"body":"timer_start()"
"Retrieve or display the time from the page start to when function is called.":
"prefix":"timer_stop"
"body":"timer_stop( ${1:\\$display}${2:, \\$precision = 3} )"
"tinymce_include":
"prefix":"tinymce_include"
"body":"tinymce_include()"
"Print out HTML form date elements for editing post or comment publish date.":
"prefix":"touch_time"
"body":"touch_time( ${1:\\$edit = 1}${2:, \\$for_post = 1}${3:, \\$tab_index}${4:, \\$multi} )"
"Send a Trackback.":
"prefix":"trackback"
"body":"trackback( ${1:\\$trackback_url}${2:, \\$title}${3:, \\$excerpt}${4:, \\$ID} )"
"Generate and display the RDF for the trackback information of current post.":
"prefix":"trackback_rdf"
"body":"trackback_rdf( ${1:\\$deprecated = ''} )"
"Response to a trackback.":
"prefix":"trackback_response"
"body":"trackback_response( ${1:\\$error}${2:, \\$error_message = ''} )"
"Display the current post's trackback URL.":
"prefix":"trackback_url"
"body":"trackback_url( ${1:\\$deprecated_echo = true} )"
"Do trackbacks for a list of URLs.":
"prefix":"trackback_url_list"
"body":"trackback_url_list( ${1:\\$tb_list}${2:, \\$post_id} )"
"Appends a trailing slash.":
"prefix":"trailingslashit"
"body":"trailingslashit( ${1:\\$string} )"
"Retrieve the translation of $text. translate":
"prefix":"translate"
"body":"translate( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate user level to user role name.":
"prefix":"translate_level_to_role"
"body":"translate_level_to_role( ${1:\\$level} )"
"Translates and retrieves the singular or plural form of a string that's been registered
with _n_noop() or _nx_noop().":
"prefix":"translate_nooped_plural"
"body":"translate_nooped_plural( ${1:\\$nooped_plural}${2:, \\$count}${3:, \\$domain = 'default'} )"
"Convert one smiley code to the icon graphic file equivalent.":
"prefix":"translate_smiley"
"body":"translate_smiley( ${1:\\$matches} )"
"Translates role name.":
"prefix":"translate_user_role"
"body":"translate_user_role( ${1:\\$name} )"
"Translates $text like translate(), but assumes that the text
contains a context after its last vertical bar.":
"prefix":"translate_with_context"
"body":"translate_with_context( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Retrieve the translation of $text in the context defined in $context.":
"prefix":"translate_with_gettext_context"
"body":"translate_with_gettext_context( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Retrieve translations from WordPress Translation API.":
"prefix":"translations_api"
"body":"translations_api( ${1:\\$type}${2:, \\$args = null} )"
"Handles retrieving the insert-from-URL form for an audio file.":
"prefix":"type_url_form_audio"
"body":"type_url_form_audio()"
"Handles retrieving the insert-from-URL form for a generic file.":
"prefix":"type_url_form_file"
"body":"type_url_form_file()"
"Handles retrieving the insert-from-URL form for an image.":
"prefix":"type_url_form_image"
"body":"type_url_form_image()"
"Handles retrieving the insert-from-URL form for a video file.":
"prefix":"type_url_form_video"
"body":"type_url_form_video()"
"undismiss_core_update":
"prefix":"undismiss_core_update"
"body":"undismiss_core_update( ${1:\\$version}${2:, \\$locale} )"
"Remove placeholders added by do_shortcodes_in_html_tags().":
"prefix":"unescape_invalid_shortcodes"
"body":"unescape_invalid_shortcodes( ${1:\\$content} )"
"Uninstall a single plugin.":
"prefix":"uninstall_plugin"
"body":"uninstall_plugin( ${1:\\$plugin} )"
"Unload translations for a text domain.":
"prefix":"unload_textdomain"
"body":"unload_textdomain( ${1:\\$domain} )"
"Unregister default headers.":
"prefix":"unregister_default_headers"
"body":"unregister_default_headers( ${1:\\$header} )"
"Unregisters a meta key from the list of registered keys.":
"prefix":"unregister_meta_key"
"body":"unregister_meta_key( ${1:\\$object_type}${2:, \\$meta_key} )"
"Unregisters a navigation menu location for a theme.":
"prefix":"unregister_nav_menu"
"body":"unregister_nav_menu( ${1:\\$location} )"
"Unregisters a post type.":
"prefix":"unregister_post_type"
"body":"unregister_post_type( ${1:\\$post_type} )"
"Unregister a setting.":
"prefix":"unregister_setting"
"body":"unregister_setting( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$deprecated = ''} )"
"Removes a sidebar from the list.":
"prefix":"unregister_sidebar"
"body":"unregister_sidebar( ${1:\\$sidebar_id} )"
"Serves as an alias of wp_unregister_sidebar_widget().":
"prefix":"unregister_sidebar_widget"
"body":"unregister_sidebar_widget( ${1:\\$id} )"
"Unregisters a taxonomy.":
"prefix":"unregister_taxonomy"
"body":"unregister_taxonomy( ${1:\\$taxonomy} )"
"Remove an already registered taxonomy from an object type.":
"prefix":"unregister_taxonomy_for_object_type"
"body":"unregister_taxonomy_for_object_type( ${1:\\$taxonomy}${2:, \\$object_type} )"
"Unregisters a widget.":
"prefix":"unregister_widget"
"body":"unregister_widget( ${1:\\$widget_class} )"
"Alias of wp_unregister_widget_control().":
"prefix":"unregister_widget_control"
"body":"unregister_widget_control( ${1:\\$id} )"
"Un-stick a post.":
"prefix":"unstick_post"
"body":"unstick_post( ${1:\\$post_id} )"
"Removes trailing forward slashes and backslashes if they exist.":
"prefix":"untrailingslashit"
"body":"untrailingslashit( ${1:\\$string} )"
"Unzips a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction.":
"prefix":"unzip_file"
"body":"unzip_file( ${1:\\$file}${2:, \\$to} )"
"Update the 'archived' status of a particular blog.":
"prefix":"update_archived"
"body":"update_archived( ${1:\\$id}${2:, \\$archived} )"
"Update attachment file path based on attachment ID.":
"prefix":"update_attached_file"
"body":"update_attached_file( ${1:\\$attachment_id}${2:, \\$file} )"
"Update the details for a blog. Updates the blogs table for a given blog id.":
"prefix":"update_blog_details"
"body":"update_blog_details( ${1:\\$blog_id}${2:, \\$details = array()} )"
"Update an option for a particular blog.":
"prefix":"update_blog_option"
"body":"update_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update this blog's 'public' setting in the global blogs table.":
"prefix":"update_blog_public"
"body":"update_blog_public( ${1:\\$old_value}${2:, \\$value} )"
"Update a blog details field.":
"prefix":"update_blog_status"
"body":"update_blog_status( ${1:\\$blog_id}${2:, \\$pref}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update the categories cache.":
"prefix":"update_category_cache"
"body":"update_category_cache()"
"Updates the comment cache of given comments.":
"prefix":"update_comment_cache"
"body":"update_comment_cache( ${1:\\$comments}${2:, \\$update_meta_cache = true} )"
"Update comment meta field based on comment ID.":
"prefix":"update_comment_meta"
"body":"update_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Upgrades the core of WordPress.":
"prefix":"update_core"
"body":"update_core( ${1:\\$from}${2:, \\$to} )"
"Adds the gallery tab back to the tabs array if post has image attachments":
"prefix":"update_gallery_tab"
"body":"update_gallery_tab( ${1:\\$tabs} )"
"Flushes rewrite rules if siteurl, home or page_on_front changed.":
"prefix":"update_home_siteurl"
"body":"update_home_siteurl( ${1:\\$old_value}${2:, \\$value} )"
"Update post meta data by meta ID.":
"prefix":"update_meta"
"body":"update_meta( ${1:\\$meta_id}${2:, \\$meta_key}${3:, \\$meta_value} )"
"Update the metadata cache for the specified objects.":
"prefix":"update_meta_cache"
"body":"update_meta_cache( ${1:\\$meta_type}${2:, \\$object_ids} )"
"Update metadata for the specified object. If no value already exists for the specified object
ID and metadata key, the metadata will be added.":
"prefix":"update_metadata"
"body":"update_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value}${5:, \\$prev_value = ''} )"
"Update meta data by meta ID":
"prefix":"update_metadata_by_mid"
"body":"update_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id}${3:, \\$meta_value}${4:, \\$meta_key = false} )"
"update_nag":
"prefix":"update_nag"
"body":"update_nag()"
"Updates the network cache of given networks.":
"prefix":"update_network_cache"
"body":"update_network_cache( ${1:\\$networks} )"
"Update the value of a network option that was already added.":
"prefix":"update_network_option"
"body":"update_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$value} )"
"Updates the cache for the given term object ID(s).":
"prefix":"update_object_term_cache"
"body":"update_object_term_cache( ${1:\\$object_ids}${2:, \\$object_type} )"
"Update the value of an option that was already added.":
"prefix":"update_option"
"body":"update_option( ${1:\\$option}${2:, \\$value}${3:, \\$autoload = null} )"
"Sends an email when a site administrator email address is changed.":
"prefix":"update_option_new_admin_email"
"body":"update_option_new_admin_email( ${1:\\$old_value}${2:, \\$value} )"
"Alias of update_post_cache().":
"prefix":"update_page_cache"
"body":"update_page_cache( ${1:\\$pages} )"
"Updates posts in cache.":
"prefix":"update_post_cache"
"body":"update_post_cache( ${1:\\$posts} )"
"Call major cache updating functions for list of Post objects.":
"prefix":"update_post_caches"
"body":"update_post_caches( ${1:\\$posts}${2:, \\$post_type = 'post'}${3:, \\$update_term_cache = true}${4:, \\$update_meta_cache = true} )"
"Update post meta field based on post ID.":
"prefix":"update_post_meta"
"body":"update_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Update cache for thumbnails in the current loop.":
"prefix":"update_post_thumbnail_cache"
"body":"update_post_thumbnail_cache( ${1:\\$wp_query = null} )"
"Updates metadata cache for list of post IDs.":
"prefix":"update_postmeta_cache"
"body":"update_postmeta_cache( ${1:\\$post_ids} )"
"Update a blog's post count.":
"prefix":"update_posts_count"
"body":"update_posts_count( ${1:\\$deprecated = ''} )"
"Update the "recently-edited" file for the plugin or theme editor.":
"prefix":"update_recently_edited"
"body":"update_recently_edited( ${1:\\$file} )"
"update_right_now_message":
"prefix":"update_right_now_message"
"body":"update_right_now_message()"
"Updates sites in cache.":
"prefix":"update_site_cache"
"body":"update_site_cache( ${1:\\$sites} )"
"Update the value of an option that was already added for the current network.":
"prefix":"update_site_option"
"body":"update_site_option( ${1:\\$option}${2:, \\$value} )"
"Updates Terms to Taxonomy in cache.":
"prefix":"update_term_cache"
"body":"update_term_cache( ${1:\\$terms}${2:, \\$taxonomy = ''} )"
"Updates term metadata.":
"prefix":"update_term_meta"
"body":"update_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Updates metadata cache for list of term IDs.":
"prefix":"update_termmeta_cache"
"body":"update_termmeta_cache( ${1:\\$term_ids} )"
"Update all user caches":
"prefix":"update_user_caches"
"body":"update_user_caches( ${1:\\$user} )"
"Update user meta field based on user ID.":
"prefix":"update_user_meta"
"body":"update_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Update user option with global blog capability.":
"prefix":"update_user_option"
"body":"update_user_option( ${1:\\$user_id}${2:, \\$option_name}${3:, \\$newvalue}${4:, \\$global = false} )"
"Update the status of a user in the database.":
"prefix":"update_user_status"
"body":"update_user_status( ${1:\\$id}${2:, \\$pref}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update metadata of user.":
"prefix":"update_usermeta"
"body":"update_usermeta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value} )"
"Execute changes made in WordPress 1.0.":
"prefix":"upgrade_100"
"body":"upgrade_100()"
"Execute changes made in WordPress 1.0.1.":
"prefix":"upgrade_101"
"body":"upgrade_101()"
"Execute changes made in WordPress 1.2.":
"prefix":"upgrade_110"
"body":"upgrade_110()"
"Execute changes made in WordPress 1.5.":
"prefix":"upgrade_130"
"body":"upgrade_130()"
"Execute changes made in WordPress 2.0.":
"prefix":"upgrade_160"
"body":"upgrade_160()"
"Execute changes made in WordPress 2.1.":
"prefix":"upgrade_210"
"body":"upgrade_210()"
"Execute changes made in WordPress 2.3.":
"prefix":"upgrade_230"
"body":"upgrade_230()"
"Remove old categories, link2cat, and post2cat database tables.":
"prefix":"upgrade_230_old_tables"
"body":"upgrade_230_old_tables()"
"Remove old options from the database.":
"prefix":"upgrade_230_options_table"
"body":"upgrade_230_options_table()"
"Execute changes made in WordPress 2.5.0.":
"prefix":"upgrade_250"
"body":"upgrade_250()"
"Execute changes made in WordPress 2.5.2.":
"prefix":"upgrade_252"
"body":"upgrade_252()"
"Execute changes made in WordPress 2.6.":
"prefix":"upgrade_260"
"body":"upgrade_260()"
"Execute changes made in WordPress 2.7.":
"prefix":"upgrade_270"
"body":"upgrade_270()"
"Execute changes made in WordPress 2.8.":
"prefix":"upgrade_280"
"body":"upgrade_280()"
"Execute changes made in WordPress 2.9.":
"prefix":"upgrade_290"
"body":"upgrade_290()"
"Execute changes made in WordPress 3.0.":
"prefix":"upgrade_300"
"body":"upgrade_300()"
"Execute changes made in WordPress 3.3.":
"prefix":"upgrade_330"
"body":"upgrade_330()"
"Execute changes made in WordPress 3.4.":
"prefix":"upgrade_340"
"body":"upgrade_340()"
"Execute changes made in WordPress 3.5.":
"prefix":"upgrade_350"
"body":"upgrade_350()"
"Execute changes made in WordPress 3.7.":
"prefix":"upgrade_370"
"body":"upgrade_370()"
"Execute changes made in WordPress 3.7.2.":
"prefix":"upgrade_372"
"body":"upgrade_372()"
"Execute changes made in WordPress 3.8.0.":
"prefix":"upgrade_380"
"body":"upgrade_380()"
"Execute changes made in WordPress 4.0.0.":
"prefix":"upgrade_400"
"body":"upgrade_400()"
"Execute changes made in WordPress 4.2.0.":
"prefix":"upgrade_420"
"body":"upgrade_420()"
"Executes changes made in WordPress 4.3.0.":
"prefix":"upgrade_430"
"body":"upgrade_430()"
"Executes comments changes made in WordPress 4.3.0.":
"prefix":"upgrade_430_fix_comments"
"body":"upgrade_430_fix_comments()"
"Executes changes made in WordPress 4.3.1.":
"prefix":"upgrade_431"
"body":"upgrade_431()"
"Executes changes made in WordPress 4.4.0.":
"prefix":"upgrade_440"
"body":"upgrade_440()"
"Executes changes made in WordPress 4.5.0.":
"prefix":"upgrade_450"
"body":"upgrade_450()"
"Executes changes made in WordPress 4.6.0.":
"prefix":"upgrade_460"
"body":"upgrade_460()"
"Functions to be called in install and upgrade scripts.":
"prefix":"upgrade_all"
"body":"upgrade_all()"
"Executes network-level upgrade routines.":
"prefix":"upgrade_network"
"body":"upgrade_network()"
"Upgrade old slugs made in version 2.2.":
"prefix":"upgrade_old_slugs"
"body":"upgrade_old_slugs()"
"Check whether an upload is too big.":
"prefix":"upload_is_file_too_big"
"body":"upload_is_file_too_big( ${1:\\$upload} )"
"Check whether a site has used its allotted upload space.":
"prefix":"upload_is_user_over_quota"
"body":"upload_is_user_over_quota( ${1:\\$echo = true} )"
"Filters the maximum upload file size allowed, in bytes.":
"prefix":"upload_size_limit_filter"
"body":"upload_size_limit_filter( ${1:\\$size} )"
"Displays the site upload space quota setting form on the Edit Site Settings screen.":
"prefix":"upload_space_setting"
"body":"upload_space_setting( ${1:\\$id} )"
"Determines if the URL can be accessed over SSL.":
"prefix":"url_is_accessable_via_ssl"
"body":"url_is_accessable_via_ssl( ${1:\\$url} )"
"Shorten a URL, to be used as link text.":
"prefix":"url_shorten"
"body":"url_shorten( ${1:\\$url}${2:, \\$length = 35} )"
"Examine a URL and try to determine the post ID it represents.":
"prefix":"url_to_postid"
"body":"url_to_postid( ${1:\\$url} )"
"Navigates through an array, object, or scalar, and decodes URL-encoded values":
"prefix":"urldecode_deep"
"body":"urldecode_deep( ${1:\\$value} )"
"Navigates through an array, object, or scalar, and encodes the values to be used in a URL.":
"prefix":"urlencode_deep"
"body":"urlencode_deep( ${1:\\$value} )"
"Determine whether to use CodePress.":
"prefix":"use_codepress"
"body":"use_codepress()"
"Optional SSL preference that can be turned on by hooking to the 'personal_options' action.":
"prefix":"use_ssl_preference"
"body":"use_ssl_preference( ${1:\\$user} )"
"Retrieves the URL to the admin area for the current user.":
"prefix":"user_admin_url"
"body":"user_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Whether a particular user has capability or role.":
"prefix":"user_can"
"body":"user_can( ${1:\\$user}${2:, \\$capability} )"
"user_can_access_admin_page":
"prefix":"user_can_access_admin_page"
"body":"user_can_access_admin_page()"
"Whether user can create a post. user_can_create_draft":
"prefix":"user_can_create_draft"
"body":"user_can_create_draft( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Whether user can create a post. user_can_create_post":
"prefix":"user_can_create_post"
"body":"user_can_create_post( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Whether user can delete a post. user_can_delete_post":
"prefix":"user_can_delete_post"
"body":"user_can_delete_post( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_delete_post_comments":
"prefix":"user_can_delete_post_comments"
"body":"user_can_delete_post_comments( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can edit a post.":
"prefix":"user_can_edit_post"
"body":"user_can_edit_post( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_edit_post_comments":
"prefix":"user_can_edit_post_comments"
"body":"user_can_edit_post_comments( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_edit_post_date":
"prefix":"user_can_edit_post_date"
"body":"user_can_edit_post_date( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Can user can edit other user.":
"prefix":"user_can_edit_user"
"body":"user_can_edit_user( ${1:\\$user_id}${2:, \\$other_user} )"
"Whether the user can access the visual editor.":
"prefix":"user_can_richedit"
"body":"user_can_richedit()"
"Whether user can set new posts' dates.":
"prefix":"user_can_set_post_date"
"body":"user_can_set_post_date( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Check that the user login name and password is correct.":
"prefix":"user_pass_ok"
"body":"user_pass_ok( ${1:\\$user_login}${2:, \\$user_pass} )"
"Retrieves a trailing-slashed string if the site is set for adding trailing slashes.":
"prefix":"user_trailingslashit"
"body":"user_trailingslashit( ${1:\\$string}${2:, \\$type_of_url = ''} )"
"Checks whether the given username exists.":
"prefix":"username_exists"
"body":"username_exists( ${1:\\$username} )"
"Check whether users can self-register, based on Network settings.":
"prefix":"users_can_register_signup_filter"
"body":"users_can_register_signup_filter()"
"Encode the Unicode values to be used in the URI.":
"prefix":"utf8_uri_encode"
"body":"utf8_uri_encode( ${1:\\$utf8_string}${2:, \\$length} )"
"Helper function to determine if a Unicode value is valid.":
"prefix":"valid_unicode"
"body":"valid_unicode( ${1:\\$i} )"
"Validate active plugins":
"prefix":"validate_active_plugins"
"body":"validate_active_plugins()"
"Validate a new site signup.":
"prefix":"validate_another_blog_signup"
"body":"validate_another_blog_signup()"
"Validate the new site signup":
"prefix":"validate_blog_form"
"body":"validate_blog_form()"
"Validate new site signup":
"prefix":"validate_blog_signup"
"body":"validate_blog_signup()"
"Checks that current theme files 'index.php' and 'style.css' exists.":
"prefix":"validate_current_theme"
"body":"validate_current_theme()"
"Deprecated functionality to validate an email address.":
"prefix":"validate_email"
"body":"validate_email( ${1:\\$email}${2:, \\$check_domain = true} )"
"File validates against allowed set of defined rules.":
"prefix":"validate_file"
"body":"validate_file( ${1:\\$file}${2:, \\$allowed_files = ''} )"
"Make sure that the file that was requested to edit, is allowed to be edited":
"prefix":"validate_file_to_edit"
"body":"validate_file_to_edit( ${1:\\$file}${2:, \\$allowed_files = ''} )"
"Validate the plugin path.":
"prefix":"validate_plugin"
"body":"validate_plugin( ${1:\\$plugin} )"
"Validate user signup name and email":
"prefix":"validate_user_form"
"body":"validate_user_form()"
"Validate the new user signup":
"prefix":"validate_user_signup"
"body":"validate_user_signup()"
"Checks whether a username is valid.":
"prefix":"validate_username"
"body":"validate_username( ${1:\\$username} )"
"Calculates and compares the MD5 of a file to its expected value.":
"prefix":"verify_file_md5"
"body":"verify_file_md5( ${1:\\$filename}${2:, \\$expected_md5} )"
"Retrieve HTML dropdown (select) content for category list.":
"prefix":"walk_category_dropdown_tree"
"body":"walk_category_dropdown_tree()"
"Retrieve HTML list content for category list.":
"prefix":"walk_category_tree"
"body":"walk_category_tree()"
"Retrieve the HTML list content for nav menu items.":
"prefix":"walk_nav_menu_tree"
"body":"walk_nav_menu_tree( ${1:\\$items}${2:, \\$depth}${3:, \\$r} )"
"Retrieve HTML dropdown (select) content for page list.":
"prefix":"walk_page_dropdown_tree"
"body":"walk_page_dropdown_tree()"
"Retrieve HTML list content for page list.":
"prefix":"walk_page_tree"
"body":"walk_page_tree( ${1:\\$pages}${2:, \\$depth}${3:, \\$current_page}${4:, \\$r} )"
"Send a pingback.":
"prefix":"weblog_ping"
"body":"weblog_ping( ${1:\\$server = ''}${2:, \\$path = ''} )"
"Ensure that the welcome message is not empty. Currently unused.":
"prefix":"welcome_user_msg_filter"
"body":"welcome_user_msg_filter( ${1:\\$text} )"
"Workaround for Windows bug in is_writable() function":
"prefix":"win_is_writable"
"body":"win_is_writable( ${1:\\$path} )"
"Display the link to the Windows Live Writer manifest file.":
"prefix":"wlwmanifest_link"
"body":"wlwmanifest_link()"
"Set up the WordPress query.":
"prefix":"wp"
"body":"wp( ${1:\\$query_vars = ''} )"
"Adds a new dashboard widget.":
"prefix":"wp_add_dashboard_widget"
"body":"wp_add_dashboard_widget( ${1:\\$widget_id}${2:, \\$widget_name}${3:, \\$callback}${4:, \\$control_callback = null}${5:, \\$callback_args = null} )"
"Parse ID3v2, ID3v1, and getID3 comments to extract usable data":
"prefix":"wp_add_id3_tag_data"
"body":"wp_add_id3_tag_data( ${1:\\$metadata}${2:, \\$data} )"
"Adds extra code to a registered script.":
"prefix":"wp_add_inline_script"
"body":"wp_add_inline_script( ${1:\\$handle}${2:, \\$data}${3:, \\$position = 'after'} )"
"Add extra CSS styles to a registered stylesheet.":
"prefix":"wp_add_inline_style"
"body":"wp_add_inline_style( ${1:\\$handle}${2:, \\$data} )"
"Add term(s) associated with a given object.":
"prefix":"wp_add_object_terms"
"body":"wp_add_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy} )"
"Add tags to a post.":
"prefix":"wp_add_post_tags"
"body":"wp_add_post_tags( ${1:\\$post_id}${2:, \\$tags = ''} )"
"Adds a trashed suffix for a given post.":
"prefix":"wp_add_trashed_suffix_to_post_name_for_post"
"body":"wp_add_trashed_suffix_to_post_name_for_post( ${1:\\$post} )"
"Adds a suffix if any trashed posts have a given slug.":
"prefix":"wp_add_trashed_suffix_to_post_name_for_trashed_posts"
"body":"wp_add_trashed_suffix_to_post_name_for_trashed_posts( ${1:\\$post_name}${2:, \\$post_ID} )"
"Add secondary menus.":
"prefix":"wp_admin_bar_add_secondary_groups"
"body":"wp_admin_bar_add_secondary_groups( ${1:\\$wp_admin_bar} )"
"Add appearance submenu items to the "Site Name" menu.":
"prefix":"wp_admin_bar_appearance_menu"
"body":"wp_admin_bar_appearance_menu( ${1:\\$wp_admin_bar} )"
"Add edit comments link with awaiting moderation count bubble.":
"prefix":"wp_admin_bar_comments_menu"
"body":"wp_admin_bar_comments_menu( ${1:\\$wp_admin_bar} )"
"Adds the "Customize" link to the Toolbar.":
"prefix":"wp_admin_bar_customize_menu"
"body":"wp_admin_bar_customize_menu( ${1:\\$wp_admin_bar} )"
"Add the "Dashboard"/"Visit Site" menu.":
"prefix":"wp_admin_bar_dashboard_view_site_menu"
"body":"wp_admin_bar_dashboard_view_site_menu( ${1:\\$wp_admin_bar} )"
"Provide an edit link for posts and terms.":
"prefix":"wp_admin_bar_edit_menu"
"body":"wp_admin_bar_edit_menu( ${1:\\$wp_admin_bar} )"
"Style and scripts for the admin bar.":
"prefix":"wp_admin_bar_header"
"body":"wp_admin_bar_header()"
"Add the "My Account" item.":
"prefix":"wp_admin_bar_my_account_item"
"body":"wp_admin_bar_my_account_item( ${1:\\$wp_admin_bar} )"
"Add the "My Account" submenu items.":
"prefix":"wp_admin_bar_my_account_menu"
"body":"wp_admin_bar_my_account_menu( ${1:\\$wp_admin_bar} )"
"Add the "My Sites/[Site Name]" menu and all submenus.":
"prefix":"wp_admin_bar_my_sites_menu"
"body":"wp_admin_bar_my_sites_menu( ${1:\\$wp_admin_bar} )"
"Add "Add New" menu.":
"prefix":"wp_admin_bar_new_content_menu"
"body":"wp_admin_bar_new_content_menu( ${1:\\$wp_admin_bar} )"
"Renders the admin bar to the page based on the $wp_admin_bar->menu member var.":
"prefix":"wp_admin_bar_render"
"body":"wp_admin_bar_render()"
"Add search form.":
"prefix":"wp_admin_bar_search_menu"
"body":"wp_admin_bar_search_menu( ${1:\\$wp_admin_bar} )"
"Provide a shortlink.":
"prefix":"wp_admin_bar_shortlink_menu"
"body":"wp_admin_bar_shortlink_menu( ${1:\\$wp_admin_bar} )"
"Add the sidebar toggle button.":
"prefix":"wp_admin_bar_sidebar_toggle"
"body":"wp_admin_bar_sidebar_toggle( ${1:\\$wp_admin_bar} )"
"Add the "Site Name" menu.":
"prefix":"wp_admin_bar_site_menu"
"body":"wp_admin_bar_site_menu( ${1:\\$wp_admin_bar} )"
"Provide an update link if theme/plugin/core updates are available.":
"prefix":"wp_admin_bar_updates_menu"
"body":"wp_admin_bar_updates_menu( ${1:\\$wp_admin_bar} )"
"Add the WordPress logo menu.":
"prefix":"wp_admin_bar_wp_menu"
"body":"wp_admin_bar_wp_menu( ${1:\\$wp_admin_bar} )"
"Remove single-use URL parameters and create canonical link based on new URL.":
"prefix":"wp_admin_canonical_url"
"body":"wp_admin_canonical_url()"
"Enqueues or directly prints a stylesheet link to the specified CSS file.":
"prefix":"wp_admin_css"
"body":"wp_admin_css( ${1:\\$file = 'wp-admin'}${2:, \\$force_echo = false} )"
"Registers an admin colour scheme css file.":
"prefix":"wp_admin_css_color"
"body":"wp_admin_css_color( ${1:\\$key}${2:, \\$name}${3:, \\$url}${4:, \\$colors = array()}${5:, \\$icons = array()} )"
"Displays the URL of a WordPress admin CSS file.":
"prefix":"wp_admin_css_uri"
"body":"wp_admin_css_uri( ${1:\\$file = 'wp-admin'} )"
"Ajax handler for adding a link category.":
"prefix":"wp_ajax_add_link_category"
"body":"wp_ajax_add_link_category( ${1:\\$action} )"
"Ajax handler for adding a menu item.":
"prefix":"wp_ajax_add_menu_item"
"body":"wp_ajax_add_menu_item()"
"Ajax handler for adding meta.":
"prefix":"wp_ajax_add_meta"
"body":"wp_ajax_add_meta()"
"Ajax handler to add a tag.":
"prefix":"wp_ajax_add_tag"
"body":"wp_ajax_add_tag()"
"Ajax handler for adding a user.":
"prefix":"wp_ajax_add_user"
"body":"wp_ajax_add_user( ${1:\\$action} )"
"Ajax handler for tag search.":
"prefix":"wp_ajax_ajax_tag_search"
"body":"wp_ajax_ajax_tag_search()"
"Ajax handler for user autocomplete.":
"prefix":"wp_ajax_autocomplete_user"
"body":"wp_ajax_autocomplete_user()"
"Ajax handler for closed post boxes.":
"prefix":"wp_ajax_closed_postboxes"
"body":"wp_ajax_closed_postboxes()"
"Ajax handler for cropping an image.":
"prefix":"wp_ajax_crop_image"
"body":"wp_ajax_crop_image()"
"Ajax handler for dashboard widgets.":
"prefix":"wp_ajax_dashboard_widgets"
"body":"wp_ajax_dashboard_widgets()"
"Ajax handler for date formatting.":
"prefix":"wp_ajax_date_format"
"body":"wp_ajax_date_format()"
"Ajax handler for deleting a comment.":
"prefix":"wp_ajax_delete_comment"
"body":"wp_ajax_delete_comment()"
"Ajax handler for removing inactive widgets.":
"prefix":"wp_ajax_delete_inactive_widgets"
"body":"wp_ajax_delete_inactive_widgets()"
"Ajax handler for deleting a link.":
"prefix":"wp_ajax_delete_link"
"body":"wp_ajax_delete_link()"
"Ajax handler for deleting meta.":
"prefix":"wp_ajax_delete_meta"
"body":"wp_ajax_delete_meta()"
"wp_ajax_delete_page":
"prefix":"wp_ajax_delete_page"
"body":"wp_ajax_delete_page( ${1:\\$action} )"
"Ajax handler for deleting a plugin.":
"prefix":"wp_ajax_delete_plugin"
"body":"wp_ajax_delete_plugin()"
"Ajax handler for deleting a post.":
"prefix":"wp_ajax_delete_post"
"body":"wp_ajax_delete_post( ${1:\\$action} )"
"Ajax handler for deleting a tag.":
"prefix":"wp_ajax_delete_tag"
"body":"wp_ajax_delete_tag()"
"Ajax handler for deleting a theme.":
"prefix":"wp_ajax_delete_theme"
"body":"wp_ajax_delete_theme()"
"Ajax handler for destroying multiple open sessions for a user.":
"prefix":"wp_ajax_destroy_sessions"
"body":"wp_ajax_destroy_sessions()"
"Ajax handler to dim a comment.":
"prefix":"wp_ajax_dim_comment"
"body":"wp_ajax_dim_comment()"
"Ajax handler for dismissing a WordPress pointer.":
"prefix":"wp_ajax_dismiss_wp_pointer"
"body":"wp_ajax_dismiss_wp_pointer()"
"Ajax handler for editing a comment.":
"prefix":"wp_ajax_edit_comment"
"body":"wp_ajax_edit_comment()"
"Ajax handler for fetching a list table.":
"prefix":"wp_ajax_fetch_list"
"body":"wp_ajax_fetch_list()"
"Ajax handler for querying posts for the Find Posts modal.":
"prefix":"wp_ajax_find_posts"
"body":"wp_ajax_find_posts()"
"Ajax handler for generating a password.":
"prefix":"wp_ajax_generate_password"
"body":"wp_ajax_generate_password()"
"Ajax handler for getting an attachment.":
"prefix":"wp_ajax_get_attachment"
"body":"wp_ajax_get_attachment()"
"Ajax handler for getting comments.":
"prefix":"wp_ajax_get_comments"
"body":"wp_ajax_get_comments( ${1:\\$action} )"
"Handles AJAX requests for community events":
"prefix":"wp_ajax_get_community_events"
"body":"wp_ajax_get_community_events()"
"Ajax handler to retrieve a permalink.":
"prefix":"wp_ajax_get_permalink"
"body":"wp_ajax_get_permalink()"
"Ajax handler for retrieving HTML for the featured image.":
"prefix":"wp_ajax_get_post_thumbnail_html"
"body":"wp_ajax_get_post_thumbnail_html()"
"Ajax handler for getting revision diffs.":
"prefix":"wp_ajax_get_revision_diffs"
"body":"wp_ajax_get_revision_diffs()"
"Ajax handler for getting a tagcloud.":
"prefix":"wp_ajax_get_tagcloud"
"body":"wp_ajax_get_tagcloud()"
"Ajax handler for the Heartbeat API.":
"prefix":"wp_ajax_heartbeat"
"body":"wp_ajax_heartbeat()"
"Ajax handler for hidden columns.":
"prefix":"wp_ajax_hidden_columns"
"body":"wp_ajax_hidden_columns()"
"Ajax handler for image editing.":
"prefix":"wp_ajax_image_editor"
"body":"wp_ajax_image_editor()"
"Ajax handler for image editor previews.":
"prefix":"wp_ajax_imgedit_preview"
"body":"wp_ajax_imgedit_preview()"
"Ajax handler for Quick Edit saving a post from a list table.":
"prefix":"wp_ajax_inline_save"
"body":"wp_ajax_inline_save()"
"Ajax handler for quick edit saving for a term.":
"prefix":"wp_ajax_inline_save_tax"
"body":"wp_ajax_inline_save_tax()"
"Ajax handler for installing a plugin.":
"prefix":"wp_ajax_install_plugin"
"body":"wp_ajax_install_plugin()"
"Ajax handler for installing a theme.":
"prefix":"wp_ajax_install_theme"
"body":"wp_ajax_install_theme()"
"Ajax handler for Customizer preview logged-in status.":
"prefix":"wp_ajax_logged_in"
"body":"wp_ajax_logged_in()"
"Ajax handler for retrieving menu meta boxes.":
"prefix":"wp_ajax_menu_get_metabox"
"body":"wp_ajax_menu_get_metabox()"
"Ajax handler for menu locations save.":
"prefix":"wp_ajax_menu_locations_save"
"body":"wp_ajax_menu_locations_save()"
"Ajax handler for menu quick searching.":
"prefix":"wp_ajax_menu_quick_search"
"body":"wp_ajax_menu_quick_search()"
"Ajax handler for saving the meta box order.":
"prefix":"wp_ajax_meta_box_order"
"body":"wp_ajax_meta_box_order()"
"Ajax handler for the Heartbeat API in
the no-privilege context.":
"prefix":"wp_ajax_nopriv_heartbeat"
"body":"wp_ajax_nopriv_heartbeat()"
"Ajax handler for oEmbed caching.":
"prefix":"wp_ajax_oembed_cache"
"body":"wp_ajax_oembed_cache()"
"Apply [embed] Ajax handlers to a string.":
"prefix":"wp_ajax_parse_embed"
"body":"wp_ajax_parse_embed()"
"wp_ajax_parse_media_shortcode":
"prefix":"wp_ajax_parse_media_shortcode"
"body":"wp_ajax_parse_media_shortcode()"
"Ajax handler for creating new category from Press This.":
"prefix":"wp_ajax_press_this_add_category"
"body":"wp_ajax_press_this_add_category()"
"Ajax handler for saving a post from Press This.":
"prefix":"wp_ajax_press_this_save_post"
"body":"wp_ajax_press_this_save_post()"
"Ajax handler for querying attachments.":
"prefix":"wp_ajax_query_attachments"
"body":"wp_ajax_query_attachments()"
"Ajax handler for getting themes from themes_api().":
"prefix":"wp_ajax_query_themes"
"body":"wp_ajax_query_themes()"
"Ajax handler for replying to a comment.":
"prefix":"wp_ajax_replyto_comment"
"body":"wp_ajax_replyto_comment( ${1:\\$action} )"
"Ajax handler to retrieve a sample permalink.":
"prefix":"wp_ajax_sample_permalink"
"body":"wp_ajax_sample_permalink()"
"Ajax handler for updating attachment attributes.":
"prefix":"wp_ajax_save_attachment"
"body":"wp_ajax_save_attachment()"
"Ajax handler for saving backward compatible attachment attributes.":
"prefix":"wp_ajax_save_attachment_compat"
"body":"wp_ajax_save_attachment_compat()"
"Ajax handler for saving the attachment order.":
"prefix":"wp_ajax_save_attachment_order"
"body":"wp_ajax_save_attachment_order()"
"Ajax handler for auto-saving the selected color scheme for
a user's own profile.":
"prefix":"wp_ajax_save_user_color_scheme"
"body":"wp_ajax_save_user_color_scheme()"
"Ajax handler for saving a widget.":
"prefix":"wp_ajax_save_widget"
"body":"wp_ajax_save_widget()"
"Ajax handler for saving the user's WordPress.org username.":
"prefix":"wp_ajax_save_wporg_username"
"body":"wp_ajax_save_wporg_username()"
"Ajax handler for searching plugins to install.":
"prefix":"wp_ajax_search_install_plugins"
"body":"wp_ajax_search_install_plugins()"
"Ajax handler for searching plugins.":
"prefix":"wp_ajax_search_plugins"
"body":"wp_ajax_search_plugins()"
"Ajax handler for sending an attachment to the editor.":
"prefix":"wp_ajax_send_attachment_to_editor"
"body":"wp_ajax_send_attachment_to_editor()"
"Ajax handler for sending a link to the editor.":
"prefix":"wp_ajax_send_link_to_editor"
"body":"wp_ajax_send_link_to_editor()"
"Ajax handler for setting the featured image for an attachment.":
"prefix":"wp_ajax_set_attachment_thumbnail"
"body":"wp_ajax_set_attachment_thumbnail()"
"Ajax handler for setting the featured image.":
"prefix":"wp_ajax_set_post_thumbnail"
"body":"wp_ajax_set_post_thumbnail()"
"Ajax handler for time formatting.":
"prefix":"wp_ajax_time_format"
"body":"wp_ajax_time_format()"
"Ajax handler for sending a post to the trash.":
"prefix":"wp_ajax_trash_post"
"body":"wp_ajax_trash_post( ${1:\\$action} )"
"Ajax handler to restore a post from the trash.":
"prefix":"wp_ajax_untrash_post"
"body":"wp_ajax_untrash_post( ${1:\\$action} )"
"Ajax handler for updating a plugin.":
"prefix":"wp_ajax_update_plugin"
"body":"wp_ajax_update_plugin()"
"Ajax handler for updating a theme.":
"prefix":"wp_ajax_update_theme"
"body":"wp_ajax_update_theme()"
"Ajax handler for updating whether to display the welcome panel.":
"prefix":"wp_ajax_update_welcome_panel"
"body":"wp_ajax_update_welcome_panel()"
"Ajax handler for updating a widget.":
"prefix":"wp_ajax_update_widget"
"body":"wp_ajax_update_widget()"
"Ajax handler for uploading attachments":
"prefix":"wp_ajax_upload_attachment"
"body":"wp_ajax_upload_attachment()"
"Ajax handler for saving the widgets order.":
"prefix":"wp_ajax_widgets_order"
"body":"wp_ajax_widgets_order()"
"Ajax handler for compression testing.":
"prefix":"wp_ajax_wp_compression_test"
"body":"wp_ajax_wp_compression_test()"
"Ajax handler for saving posts from the fullscreen editor.":
"prefix":"wp_ajax_wp_fullscreen_save_post"
"body":"wp_ajax_wp_fullscreen_save_post()"
"Ajax handler for internal linking.":
"prefix":"wp_ajax_wp_link_ajax"
"body":"wp_ajax_wp_link_ajax()"
"Ajax handler for removing a post lock.":
"prefix":"wp_ajax_wp_remove_post_lock"
"body":"wp_ajax_wp_remove_post_lock()"
"Validates whether this comment is allowed to be made.":
"prefix":"wp_allow_comment"
"body":"wp_allow_comment( ${1:\\$commentdata}${2:, \\$avoid_die = false} )"
"Retrieve a list of protocols to allow in HTML attributes.":
"prefix":"wp_allowed_protocols"
"body":"wp_allowed_protocols()"
"Extract a slice of an array, given a list of keys.":
"prefix":"wp_array_slice_assoc"
"body":"wp_array_slice_assoc( ${1:\\$array}${2:, \\$keys} )"
"Verifies an attachment is of a given type.":
"prefix":"wp_attachment_is"
"body":"wp_attachment_is( ${1:\\$type}${2:, \\$post = null} )"
"Checks if the attachment is an image.":
"prefix":"wp_attachment_is_image"
"body":"wp_attachment_is_image( ${1:\\$post = null} )"
"Builds the Audio shortcode output.":
"prefix":"wp_audio_shortcode"
"body":"wp_audio_shortcode( ${1:\\$attr}${2:, \\$content = ''} )"
"Check whether a user is still logged in, for the heartbeat.":
"prefix":"wp_auth_check"
"body":"wp_auth_check( ${1:\\$response} )"
"Output the HTML that shows the wp-login dialog when the user is no longer logged in.":
"prefix":"wp_auth_check_html"
"body":"wp_auth_check_html()"
"Load the auth check for monitoring whether the user is still logged in.":
"prefix":"wp_auth_check_load"
"body":"wp_auth_check_load()"
"Authenticate a user, confirming the login credentials are valid.":
"prefix":"wp_authenticate"
"body":"wp_authenticate( ${1:\\$username}${2:, \\$password} )"
"Authenticate the user using the WordPress auth cookie.":
"prefix":"wp_authenticate_cookie"
"body":"wp_authenticate_cookie( ${1:\\$user}${2:, \\$username}${3:, \\$password} )"
"Authenticates a user using the email and password.":
"prefix":"wp_authenticate_email_password"
"body":"wp_authenticate_email_password( ${1:\\$user}${2:, \\$email}${3:, \\$password} )"
"For Multisite blogs, check if the authenticated user has been marked as a
spammer, or if the user's primary blog has been marked as spam.":
"prefix":"wp_authenticate_spam_check"
"body":"wp_authenticate_spam_check( ${1:\\$user} )"
"Authenticate a user, confirming the username and password are valid.":
"prefix":"wp_authenticate_username_password"
"body":"wp_authenticate_username_password( ${1:\\$user}${2:, \\$username}${3:, \\$password} )"
"Save a post submitted with XHR":
"prefix":"wp_autosave"
"body":"wp_autosave( ${1:\\$post_data} )"
"i18n friendly version of basename()":
"prefix":"wp_basename"
"body":"wp_basename( ${1:\\$path}${2:, \\$suffix = ''} )"
"Does comment contain blacklisted characters or words.":
"prefix":"wp_blacklist_check"
"body":"wp_blacklist_check( ${1:\\$author}${2:, \\$email}${3:, \\$url}${4:, \\$comment}${5:, \\$user_ip}${6:, \\$user_agent} )"
"Adds data to the cache, if the cache key doesn't already exist.":
"prefix":"wp_cache_add"
"body":"wp_cache_add( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Adds a group or set of groups to the list of global groups.":
"prefix":"wp_cache_add_global_groups"
"body":"wp_cache_add_global_groups( ${1:\\$groups} )"
"Adds a group or set of groups to the list of non-persistent groups.":
"prefix":"wp_cache_add_non_persistent_groups"
"body":"wp_cache_add_non_persistent_groups( ${1:\\$groups} )"
"Closes the cache.":
"prefix":"wp_cache_close"
"body":"wp_cache_close()"
"Decrements numeric cache item's value.":
"prefix":"wp_cache_decr"
"body":"wp_cache_decr( ${1:\\$key}${2:, \\$offset = 1}${3:, \\$group = ''} )"
"Removes the cache contents matching key and group.":
"prefix":"wp_cache_delete"
"body":"wp_cache_delete( ${1:\\$key}${2:, \\$group = ''} )"
"Removes all cache items.":
"prefix":"wp_cache_flush"
"body":"wp_cache_flush()"
"Retrieves the cache contents from the cache by key and group.":
"prefix":"wp_cache_get"
"body":"wp_cache_get( ${1:\\$key}${2:, \\$group = ''}${3:, \\$force = false}${4:, \\$found = null} )"
"Get last changed date for the specified cache group.":
"prefix":"wp_cache_get_last_changed"
"body":"wp_cache_get_last_changed( ${1:\\$group} )"
"Increment numeric cache item's value":
"prefix":"wp_cache_incr"
"body":"wp_cache_incr( ${1:\\$key}${2:, \\$offset = 1}${3:, \\$group = ''} )"
"Sets up Object Cache Global and assigns it.":
"prefix":"wp_cache_init"
"body":"wp_cache_init()"
"Replaces the contents of the cache with new data.":
"prefix":"wp_cache_replace"
"body":"wp_cache_replace( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Reset internal cache keys and structures.":
"prefix":"wp_cache_reset"
"body":"wp_cache_reset()"
"Saves the data to the cache.":
"prefix":"wp_cache_set"
"body":"wp_cache_set( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Switches the internal blog ID.":
"prefix":"wp_cache_switch_to_blog"
"body":"wp_cache_switch_to_blog( ${1:\\$blog_id} )"
"Creates a 'sizes' attribute value for an image.":
"prefix":"wp_calculate_image_sizes"
"body":"wp_calculate_image_sizes( ${1:\\$size}${2:, \\$image_src = null}${3:, \\$image_meta = null}${4:, \\$attachment_id} )"
"A helper function to calculate the image sources to include in a 'srcset' attribute.":
"prefix":"wp_calculate_image_srcset"
"body":"wp_calculate_image_srcset( ${1:\\$size_array}${2:, \\$image_src}${3:, \\$image_meta}${4:, \\$attachment_id} )"
"Check if WordPress has access to the filesystem without asking for
credentials.":
"prefix":"wp_can_install_language_pack"
"body":"wp_can_install_language_pack()"
"Output a textarea element for inputting an attachment caption.":
"prefix":"wp_caption_input_textarea"
"body":"wp_caption_input_textarea( ${1:\\$edit_post} )"
"Output an unordered list of checkbox input elements labeled with category names.":
"prefix":"wp_category_checklist"
"body":"wp_category_checklist( ${1:\\$post_id}${2:, \\$descendants_and_self}${3:, \\$selected_cats = false}${4:, \\$popular_cats = false}${5:, \\$walker = null}${6:, \\$checked_ontop = true} )"
"Check if the user needs a browser update":
"prefix":"wp_check_browser_version"
"body":"wp_check_browser_version()"
"Compares the lengths of comment data against the maximum character limits.":
"prefix":"wp_check_comment_data_max_lengths"
"body":"wp_check_comment_data_max_lengths( ${1:\\$comment_data} )"
"Checks whether comment flooding is occurring.":
"prefix":"wp_check_comment_flood"
"body":"wp_check_comment_flood( ${1:\\$is_flood}${2:, \\$ip}${3:, \\$email}${4:, \\$date}${5:, \\$avoid_die = false} )"
"Retrieve the file type from the file name.":
"prefix":"wp_check_filetype"
"body":"wp_check_filetype( ${1:\\$filename}${2:, \\$mimes = null} )"
"Attempt to determine the real file type of a file.":
"prefix":"wp_check_filetype_and_ext"
"body":"wp_check_filetype_and_ext( ${1:\\$file}${2:, \\$filename}${3:, \\$mimes = null} )"
"Check for changed slugs for published post objects and save the old slug.":
"prefix":"wp_check_for_changed_slugs"
"body":"wp_check_for_changed_slugs( ${1:\\$post_id}${2:, \\$post}${3:, \\$post_before} )"
"Checks for invalid UTF8 in a string.":
"prefix":"wp_check_invalid_utf8"
"body":"wp_check_invalid_utf8( ${1:\\$string}${2:, \\$strip = false} )"
"Checks that a JSONP callback is a valid JavaScript callback.":
"prefix":"wp_check_jsonp_callback"
"body":"wp_check_jsonp_callback( ${1:\\$callback} )"
"Check lock status for posts displayed on the Posts screen":
"prefix":"wp_check_locked_posts"
"body":"wp_check_locked_posts( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Checks the version of the installed MySQL binary.":
"prefix":"wp_check_mysql_version"
"body":"wp_check_mysql_version()"
"Checks the plaintext password against the encrypted Password.":
"prefix":"wp_check_password"
"body":"wp_check_password( ${1:\\$password}${2:, \\$hash}${3:, \\$user_id = ''} )"
"Check for the required PHP version, and the MySQL extension or
a database drop-in.":
"prefix":"wp_check_php_mysql_versions"
"body":"wp_check_php_mysql_versions()"
"Check the given subset of the post hierarchy for hierarchy loops.":
"prefix":"wp_check_post_hierarchy_for_loops"
"body":"wp_check_post_hierarchy_for_loops( ${1:\\$post_parent}${2:, \\$post_ID} )"
"Check to see if the post is currently being edited by another user.":
"prefix":"wp_check_post_lock"
"body":"wp_check_post_lock( ${1:\\$post_id} )"
"Checks the given subset of the term hierarchy for hierarchy loops.":
"prefix":"wp_check_term_hierarchy_for_loops"
"body":"wp_check_term_hierarchy_for_loops( ${1:\\$parent}${2:, \\$term_id}${3:, \\$taxonomy} )"
"Test if the supplied date is valid for the Gregorian calendar.":
"prefix":"wp_checkdate"
"body":"wp_checkdate( ${1:\\$month}${2:, \\$day}${3:, \\$year}${4:, \\$source_date} )"
"Clears the Plugins cache used by get_plugins() and by default, the Plugin Update cache.":
"prefix":"wp_clean_plugins_cache"
"body":"wp_clean_plugins_cache( ${1:\\$clear_update_cache = true} )"
"Clears the cache held by get_theme_roots() and WP_Theme.":
"prefix":"wp_clean_themes_cache"
"body":"wp_clean_themes_cache( ${1:\\$clear_update_cache = true} )"
"Clear existing update caches for plugins, themes, and core.":
"prefix":"wp_clean_update_cache"
"body":"wp_clean_update_cache()"
"Removes all of the cookies associated with authentication.":
"prefix":"wp_clear_auth_cookie"
"body":"wp_clear_auth_cookie()"
"Unschedules all events attached to the hook with the specified arguments.":
"prefix":"wp_clear_scheduled_hook"
"body":"wp_clear_scheduled_hook( ${1:\\$hook}${2:, \\$args = array()} )"
"Clears the authentication cookie, logging the user out. This function is deprecated.":
"prefix":"wp_clearcookie"
"body":"wp_clearcookie()"
"Copy an object.":
"prefix":"wp_clone"
"body":"wp_clone( ${1:\\$object} )"
"wp_color_scheme_settings":
"prefix":"wp_color_scheme_settings"
"body":"wp_color_scheme_settings()"
"Display form token for unfiltered comments.":
"prefix":"wp_comment_form_unfiltered_html_nonce"
"body":"wp_comment_form_unfiltered_html_nonce()"
"Outputs the in-line comment reply-to form in the Comments list table.":
"prefix":"wp_comment_reply"
"body":"wp_comment_reply( ${1:\\$position = 1}${2:, \\$checkbox = false}${3:, \\$mode = 'single'}${4:, \\$table_row = true} )"
"Output 'undo move to trash' text for comments":
"prefix":"wp_comment_trashnotice"
"body":"wp_comment_trashnotice()"
"Calculates the new dimensions for a down-sampled image.":
"prefix":"wp_constrain_dimensions"
"body":"wp_constrain_dimensions( ${1:\\$current_width}${2:, \\$current_height}${3:, \\$max_width}${4:, \\$max_height} )"
"Converts an integer byte value to a shorthand byte value.":
"prefix":"wp_convert_bytes_to_hr"
"body":"wp_convert_bytes_to_hr( ${1:\\$bytes} )"
"Converts a shorthand byte value to an integer byte value.":
"prefix":"wp_convert_hr_to_bytes"
"body":"wp_convert_hr_to_bytes( ${1:\\$value} )"
"Convert the widget settings from single to multi-widget format.":
"prefix":"wp_convert_widget_settings"
"body":"wp_convert_widget_settings( ${1:\\$base_name}${2:, \\$option_name}${3:, \\$settings} )"
"Defines cookie related WordPress constants wp_cookie_constants":
"prefix":"wp_cookie_constants"
"body":"wp_cookie_constants()"
"Count number of attachments for the mime type(s).":
"prefix":"wp_count_attachments"
"body":"wp_count_attachments( ${1:\\$mime_type = ''} )"
"Retrieve total comments for blog or single post.":
"prefix":"wp_count_comments"
"body":"wp_count_comments( ${1:\\$post_id} )"
"Count number of posts of a post type and if user has permissions to view.":
"prefix":"wp_count_posts"
"body":"wp_count_posts( ${1:\\$type = 'post'}${2:, \\$perm = ''} )"
"Count how many terms are in Taxonomy.":
"prefix":"wp_count_terms"
"body":"wp_count_terms( ${1:\\$taxonomy}${2:, \\$args = array()} )"
"Create categories for the given post.":
"prefix":"wp_create_categories"
"body":"wp_create_categories( ${1:\\$categories}${2:, \\$post_id = ''} )"
"Add a new category to the database if it does not already exist.":
"prefix":"wp_create_category"
"body":"wp_create_category( ${1:\\$cat_name}${2:, \\$parent} )"
"Creates a navigation menu.":
"prefix":"wp_create_nav_menu"
"body":"wp_create_nav_menu( ${1:\\$menu_name} )"
"Creates a cryptographic token tied to a specific action, user, user session,
and window of time.":
"prefix":"wp_create_nonce"
"body":"wp_create_nonce( ${1:\\$action = -1} )"
"Creates autosave data for the specified post from $_POST data.":
"prefix":"wp_create_post_autosave"
"body":"wp_create_post_autosave( ${1:\\$post_data} )"
"Add a new tag to the database if it does not already exist.":
"prefix":"wp_create_tag"
"body":"wp_create_tag( ${1:\\$tag_name} )"
"Add a new term to the database if it does not already exist.":
"prefix":"wp_create_term"
"body":"wp_create_term( ${1:\\$tag_name}${2:, \\$taxonomy = 'post_tag'} )"
"This was once used to create a thumbnail from an Image given a maximum side size.":
"prefix":"wp_create_thumbnail"
"body":"wp_create_thumbnail( ${1:\\$file}${2:, \\$max_side}${3:, \\$deprecated = ''} )"
"A simpler way of inserting a user into the database.":
"prefix":"wp_create_user"
"body":"wp_create_user( ${1:\\$username}${2:, \\$password}${3:, \\$email = ''} )"
"Retrieve the contributor credits.":
"prefix":"wp_credits"
"body":"wp_credits()"
"Run scheduled callbacks or spawn cron for all scheduled events.":
"prefix":"wp_cron"
"body":"wp_cron()"
"Crop an Image to a given size.":
"prefix":"wp_crop_image"
"body":"wp_crop_image( ${1:\\$src}${2:, \\$src_x}${3:, \\$src_y}${4:, \\$src_w}${5:, \\$src_h}${6:, \\$dst_w}${7:, \\$dst_h}${8:, \\$src_abs = false}${9:, \\$dst_file = false} )"
"Render the Custom CSS style element.":
"prefix":"wp_custom_css_cb"
"body":"wp_custom_css_cb()"
"Prints a script to check whether or not the Customizer is supported,
and apply either the no-customize-support or customize-support class
to the body.":
"prefix":"wp_customize_support_script"
"body":"wp_customize_support_script()"
"Returns a URL to load the Customizer.":
"prefix":"wp_customize_url"
"body":"wp_customize_url( ${1:\\$stylesheet = null} )"
"Displays the dashboard.":
"prefix":"wp_dashboard"
"body":"wp_dashboard()"
"wp_dashboard_browser_nag":
"prefix":"wp_dashboard_browser_nag"
"body":"wp_dashboard_browser_nag()"
"Checks to see if all of the feed url in $check_urls are cached.":
"prefix":"wp_dashboard_cached_rss_widget"
"body":"wp_dashboard_cached_rss_widget( ${1:\\$widget_id}${2:, \\$callback}${3:, \\$check_urls = array()} )"
"Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).":
"prefix":"wp_dashboard_empty"
"body":"wp_dashboard_empty()"
"Renders the Events and News dashboard widget.":
"prefix":"wp_dashboard_events_news"
"body":"wp_dashboard_events_news()"
"Deprecated dashboard widget controls. wp_dashboard_incoming_links":
"prefix":"wp_dashboard_incoming_links"
"body":"wp_dashboard_incoming_links()"
"Deprecated dashboard incoming links control.":
"prefix":"wp_dashboard_incoming_links_control"
"body":"wp_dashboard_incoming_links_control()"
"Deprecated dashboard widget controls. wp_dashboard_incoming_links_output":
"prefix":"wp_dashboard_incoming_links_output"
"body":"wp_dashboard_incoming_links_output()"
"Deprecated dashboard plugins control.":
"prefix":"wp_dashboard_plugins"
"body":"wp_dashboard_plugins()"
"Display plugins text for the WordPress news widget.":
"prefix":"wp_dashboard_plugins_output"
"body":"wp_dashboard_plugins_output( ${1:\\$rss}${2:, \\$args = array()} )"
"WordPress News dashboard widget.":
"prefix":"wp_dashboard_primary"
"body":"wp_dashboard_primary()"
"Deprecated dashboard primary control.":
"prefix":"wp_dashboard_primary_control"
"body":"wp_dashboard_primary_control()"
"Display the WordPress news feeds.":
"prefix":"wp_dashboard_primary_output"
"body":"wp_dashboard_primary_output( ${1:\\$widget_id}${2:, \\$feeds} )"
"The Quick Draft widget display and creation of drafts.":
"prefix":"wp_dashboard_quick_press"
"body":"wp_dashboard_quick_press( ${1:\\$error_msg = false} )"
"Output the QuickPress dashboard widget.":
"prefix":"wp_dashboard_quick_press_output"
"body":"wp_dashboard_quick_press_output()"
"Display file upload quota on dashboard.":
"prefix":"wp_dashboard_quota"
"body":"wp_dashboard_quota()"
"Show Comments section.":
"prefix":"wp_dashboard_recent_comments"
"body":"wp_dashboard_recent_comments( ${1:\\$total_items = 5} )"
"Deprecated dashboard recent comments control.":
"prefix":"wp_dashboard_recent_comments_control"
"body":"wp_dashboard_recent_comments_control()"
"Show recent drafts of the user on the dashboard.":
"prefix":"wp_dashboard_recent_drafts"
"body":"wp_dashboard_recent_drafts( ${1:\\$drafts = false} )"
"Generates Publishing Soon and Recently Published sections.":
"prefix":"wp_dashboard_recent_posts"
"body":"wp_dashboard_recent_posts( ${1:\\$args} )"
"Dashboard widget that displays some basic stats about the site.":
"prefix":"wp_dashboard_right_now"
"body":"wp_dashboard_right_now()"
"The RSS dashboard widget control.":
"prefix":"wp_dashboard_rss_control"
"body":"wp_dashboard_rss_control( ${1:\\$widget_id}${2:, \\$form_inputs = array()} )"
"Display generic dashboard RSS widget feed.":
"prefix":"wp_dashboard_rss_output"
"body":"wp_dashboard_rss_output( ${1:\\$widget_id} )"
"Deprecated dashboard secondary section.":
"prefix":"wp_dashboard_secondary"
"body":"wp_dashboard_secondary()"
"Deprecated dashboard secondary control.":
"prefix":"wp_dashboard_secondary_control"
"body":"wp_dashboard_secondary_control()"
"Deprecated dashboard secondary output.":
"prefix":"wp_dashboard_secondary_output"
"body":"wp_dashboard_secondary_output()"
"Registers dashboard widgets.":
"prefix":"wp_dashboard_setup"
"body":"wp_dashboard_setup()"
"Callback function for Activity widget.":
"prefix":"wp_dashboard_site_activity"
"body":"wp_dashboard_site_activity()"
"Calls widget control callback.":
"prefix":"wp_dashboard_trigger_widget_control"
"body":"wp_dashboard_trigger_widget_control( ${1:\\$widget_control_id = false} )"
"Return a comma-separated string of functions that have been called to get
to the current point in code.":
"prefix":"wp_debug_backtrace_summary"
"body":"wp_debug_backtrace_summary( ${1:\\$ignore_class = null}${2:, \\$skip_frames}${3:, \\$pretty = true} )"
"Set PHP error reporting based on WordPress debug settings.":
"prefix":"wp_debug_mode"
"body":"wp_debug_mode()"
"Find out which editor should be displayed by default.":
"prefix":"wp_default_editor"
"body":"wp_default_editor()"
"Register all WordPress scripts.":
"prefix":"wp_default_scripts"
"body":"wp_default_scripts( ${1:\\$scripts} )"
"Assign default styles to $styles object.":
"prefix":"wp_default_styles"
"body":"wp_default_styles( ${1:\\$styles} )"
"Whether to defer comment counting.":
"prefix":"wp_defer_comment_counting"
"body":"wp_defer_comment_counting( ${1:\\$defer = null} )"
"Enable or disable term counting.":
"prefix":"wp_defer_term_counting"
"body":"wp_defer_term_counting( ${1:\\$defer = null} )"
"Trash or delete an attachment.":
"prefix":"wp_delete_attachment"
"body":"wp_delete_attachment( ${1:\\$post_id}${2:, \\$force_delete = false} )"
"Delete auto-drafts for new posts that are > 7 days old.":
"prefix":"wp_delete_auto_drafts"
"body":"wp_delete_auto_drafts()"
"Deletes one existing category.":
"prefix":"wp_delete_category"
"body":"wp_delete_category( ${1:\\$cat_ID} )"
"Trashes or deletes a comment.":
"prefix":"wp_delete_comment"
"body":"wp_delete_comment( ${1:\\$comment_id}${2:, \\$force_delete = false} )"
"Delete a file":
"prefix":"wp_delete_file"
"body":"wp_delete_file( ${1:\\$file} )"
"Deletes a specified link from the database.":
"prefix":"wp_delete_link"
"body":"wp_delete_link( ${1:\\$link_id} )"
"Delete a Navigation Menu.":
"prefix":"wp_delete_nav_menu"
"body":"wp_delete_nav_menu( ${1:\\$menu} )"
"Will unlink the object from the taxonomy or taxonomies.":
"prefix":"wp_delete_object_term_relationships"
"body":"wp_delete_object_term_relationships( ${1:\\$object_id}${2:, \\$taxonomies} )"
"Trash or delete a post or page.":
"prefix":"wp_delete_post"
"body":"wp_delete_post( ${1:\\$postid}${2:, \\$force_delete = false} )"
"Deletes a revision.":
"prefix":"wp_delete_post_revision"
"body":"wp_delete_post_revision( ${1:\\$revision_id} )"
"Removes a term from the database.":
"prefix":"wp_delete_term"
"body":"wp_delete_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Remove user and optionally reassign posts and links to another user.":
"prefix":"wp_delete_user"
"body":"wp_delete_user( ${1:\\$id}${2:, \\$reassign = null} )"
"Retrieves a list of unique hosts of all enqueued scripts and styles.":
"prefix":"wp_dependencies_unique_hosts"
"body":"wp_dependencies_unique_hosts()"
"Remove a previously enqueued script.":
"prefix":"wp_dequeue_script"
"body":"wp_dequeue_script( ${1:\\$handle} )"
"Remove a previously enqueued CSS stylesheet.":
"prefix":"wp_dequeue_style"
"body":"wp_dequeue_style( ${1:\\$handle} )"
"Remove a registered script.":
"prefix":"wp_deregister_script"
"body":"wp_deregister_script( ${1:\\$handle} )"
"Remove a registered stylesheet.":
"prefix":"wp_deregister_style"
"body":"wp_deregister_style( ${1:\\$handle} )"
"Remove all session tokens for the current user from the database.":
"prefix":"wp_destroy_all_sessions"
"body":"wp_destroy_all_sessions()"
"Remove the current session token from the database.":
"prefix":"wp_destroy_current_session"
"body":"wp_destroy_current_session()"
"Remove all but the current session token for the current user for the database.":
"prefix":"wp_destroy_other_sessions"
"body":"wp_destroy_other_sessions()"
"Kill WordPress execution and display HTML message with error message.":
"prefix":"wp_die"
"body":"wp_die( ${1:\\$message = ''}${2:, \\$title = ''}${3:, \\$args = array()} )"
"wp_doc_link_parse":
"prefix":"wp_doc_link_parse"
"body":"wp_doc_link_parse( ${1:\\$content} )"
"Determines whether the current request is a WordPress Ajax request.":
"prefix":"wp_doing_ajax"
"body":"wp_doing_ajax()"
"Determines whether the current request is a WordPress cron request.":
"prefix":"wp_doing_cron"
"body":"wp_doing_cron()"
"Download a language pack.":
"prefix":"wp_download_language_pack"
"body":"wp_download_language_pack( ${1:\\$download} )"
"Display or retrieve the HTML dropdown list of categories.":
"prefix":"wp_dropdown_categories"
"body":"wp_dropdown_categories( ${1:\\$args = ''} )"
"Legacy function used for generating a categories drop-down control.":
"prefix":"wp_dropdown_cats"
"body":"wp_dropdown_cats( ${1:\\$currentcat}${2:, \\$currentparent}${3:, \\$parent}${4:, \\$level}${5:, \\$categories} )"
"Language selector.":
"prefix":"wp_dropdown_languages"
"body":"wp_dropdown_languages( ${1:\\$args = array()} )"
"Retrieve or display list of pages as a dropdown (select list).":
"prefix":"wp_dropdown_pages"
"body":"wp_dropdown_pages( ${1:\\$args = ''} )"
"Print out option html elements for role selectors.":
"prefix":"wp_dropdown_roles"
"body":"wp_dropdown_roles( ${1:\\$selected = ''} )"
"Create dropdown HTML content of users.":
"prefix":"wp_dropdown_users"
"body":"wp_dropdown_users( ${1:\\$args = ''} )"
"Executes a query for attachments. An array of WP_Query arguments
can be passed in, which will override the arguments set by this function.":
"prefix":"wp_edit_attachments_query"
"body":"wp_edit_attachments_query( ${1:\\$q = false} )"
"Get the query variables for the current attachments request.":
"prefix":"wp_edit_attachments_query_vars"
"body":"wp_edit_attachments_query_vars( ${1:\\$q = false} )"
"Run the wp query to fetch the posts for listing on the edit posts page":
"prefix":"wp_edit_posts_query"
"body":"wp_edit_posts_query( ${1:\\$q = false} )"
"Renders an editor.":
"prefix":"wp_editor"
"body":"wp_editor( ${1:\\$content}${2:, \\$editor_id}${3:, \\$settings = array()} )"
"Creates default array of embed parameters.":
"prefix":"wp_embed_defaults"
"body":"wp_embed_defaults( ${1:\\$url = ''} )"
"Filters the post excerpt for the embed template.":
"prefix":"wp_embed_excerpt_attachment"
"body":"wp_embed_excerpt_attachment( ${1:\\$content} )"
"Filters the string in the 'more' link displayed after a trimmed excerpt.":
"prefix":"wp_embed_excerpt_more"
"body":"wp_embed_excerpt_more( ${1:\\$more_string} )"
"Audio embed handler callback.":
"prefix":"wp_embed_handler_audio"
"body":"wp_embed_handler_audio( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"The Google Video embed handler callback.":
"prefix":"wp_embed_handler_googlevideo"
"body":"wp_embed_handler_googlevideo()"
"Video embed handler callback.":
"prefix":"wp_embed_handler_video"
"body":"wp_embed_handler_video( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"YouTube iframe embed handler callback.":
"prefix":"wp_embed_handler_youtube"
"body":"wp_embed_handler_youtube( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"Registers an embed handler.":
"prefix":"wp_embed_register_handler"
"body":"wp_embed_register_handler( ${1:\\$id}${2:, \\$regex}${3:, \\$callback}${4:, \\$priority = 10} )"
"Unregisters a previously-registered embed handler.":
"prefix":"wp_embed_unregister_handler"
"body":"wp_embed_unregister_handler( ${1:\\$id}${2:, \\$priority = 10} )"
"Convert any 4 byte emoji in a string to their equivalent HTML entity.":
"prefix":"wp_encode_emoji"
"body":"wp_encode_emoji( ${1:\\$content} )"
"Outputs the editor scripts, stylesheets, and default settings.":
"prefix":"wp_enqueue_editor"
"body":"wp_enqueue_editor()"
"Enqueues all scripts, styles, settings, and templates necessary to use
all media JS APIs.":
"prefix":"wp_enqueue_media"
"body":"wp_enqueue_media( ${1:\\$args = array()} )"
"Enqueue a script.":
"prefix":"wp_enqueue_script"
"body":"wp_enqueue_script( ${1:\\$handle}${2:, \\$src = ''}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$in_footer = false} )"
"Wrapper for do_action('wp_enqueue_scripts')":
"prefix":"wp_enqueue_scripts"
"body":"wp_enqueue_scripts()"
"Enqueue a CSS stylesheet.":
"prefix":"wp_enqueue_style"
"body":"wp_enqueue_style( ${1:\\$handle}${2:, \\$src = ''}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$media = 'all'} )"
"Convert the exif date format to a unix timestamp.":
"prefix":"wp_exif_date2ts"
"body":"wp_exif_date2ts( ${1:\\$str} )"
"Convert a fraction string to a decimal.":
"prefix":"wp_exif_frac2dec"
"body":"wp_exif_frac2dec( ${1:\\$str} )"
"Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.":
"prefix":"wp_expand_dimensions"
"body":"wp_expand_dimensions( ${1:\\$example_width}${2:, \\$example_height}${3:, \\$max_width}${4:, \\$max_height} )"
"Retrieve nonce action "Are you sure" message.":
"prefix":"wp_explain_nonce"
"body":"wp_explain_nonce( ${1:\\$action} )"
"Retrieve the file type based on the extension name.":
"prefix":"wp_ext2type"
"body":"wp_ext2type( ${1:\\$ext} )"
"Use RegEx to extract URLs from arbitrary content.":
"prefix":"wp_extract_urls"
"body":"wp_extract_urls( ${1:\\$content} )"
"Don't load all of WordPress when handling a favicon.ico request.":
"prefix":"wp_favicon_request"
"body":"wp_favicon_request()"
"Initialises and connects the WordPress Filesystem Abstraction classes.":
"prefix":"wp_filesystem"
"body":"wp_filesystem( ${1:\\$args = false}${2:, \\$context = false}${3:, \\$allow_relaxed_file_ownership = false} )"
"Filters and sanitizes comment data.":
"prefix":"wp_filter_comment"
"body":"wp_filter_comment( ${1:\\$commentdata} )"
"Sanitize content with allowed HTML Kses rules.":
"prefix":"wp_filter_kses"
"body":"wp_filter_kses( ${1:\\$data} )"
"Strips all of the HTML in the content.":
"prefix":"wp_filter_nohtml_kses"
"body":"wp_filter_nohtml_kses( ${1:\\$data} )"
"Filters a list of objects, based on a set of key => value arguments. wp_filter_object_list":
"prefix":"wp_filter_object_list"
"body":"wp_filter_object_list( ${1:\\$list}${2:, \\$args = array()}${3:, \\$operator = 'and'}${4:, \\$field = false} )"
"Filters the given oEmbed HTML.":
"prefix":"wp_filter_oembed_result"
"body":"wp_filter_oembed_result( ${1:\\$result}${2:, \\$data}${3:, \\$url} )"
"Sanitize content for allowed HTML tags for post content. wp_filter_post_kses":
"prefix":"wp_filter_post_kses"
"body":"wp_filter_post_kses( ${1:\\$data} )"
"Filters the oEmbed result before any HTTP requests are made.":
"prefix":"wp_filter_pre_oembed_result"
"body":"wp_filter_pre_oembed_result( ${1:\\$result}${2:, \\$url}${3:, \\$args} )"
"Find hierarchy loops using a callback function that maps object IDs to parent IDs.":
"prefix":"wp_find_hierarchy_loop"
"body":"wp_find_hierarchy_loop( ${1:\\$callback}${2:, \\$start}${3:, \\$start_parent}${4:, \\$callback_args = array()} )"
"Use the "The Tortoise and the Hare" algorithm to detect loops.":
"prefix":"wp_find_hierarchy_loop_tortoise_hare"
"body":"wp_find_hierarchy_loop_tortoise_hare( ${1:\\$callback}${2:, \\$start}${3:, \\$override = array()}${4:, \\$callback_args = array()}${5:, \\$_return_loop = false} )"
"Fix `$_SERVER` variables for various setups.":
"prefix":"wp_fix_server_vars"
"body":"wp_fix_server_vars()"
"Fire the wp_footer action.":
"prefix":"wp_footer"
"body":"wp_footer()"
"Defines functionality related WordPress constants":
"prefix":"wp_functionality_constants"
"body":"wp_functionality_constants()"
"Generate post thumbnail attachment meta data.":
"prefix":"wp_generate_attachment_metadata"
"body":"wp_generate_attachment_metadata( ${1:\\$attachment_id}${2:, \\$file} )"
"Generate authentication cookie contents.":
"prefix":"wp_generate_auth_cookie"
"body":"wp_generate_auth_cookie( ${1:\\$user_id}${2:, \\$expiration}${3:, \\$scheme = 'auth'}${4:, \\$token = ''} )"
"Generates a random password drawn from the defined set of characters.":
"prefix":"wp_generate_password"
"body":"wp_generate_password( ${1:\\$length = 12}${2:, \\$special_chars = true}${3:, \\$extra_special_chars = false} )"
"Generates a tag cloud (heatmap) from provided data.":
"prefix":"wp_generate_tag_cloud"
"body":"wp_generate_tag_cloud( ${1:\\$tags}${2:, \\$args = ''} )"
"Generate a random UUID (version 4).":
"prefix":"wp_generate_uuid4"
"body":"wp_generate_uuid4()"
"Displays the XHTML generator that is generated on the wp_head hook.":
"prefix":"wp_generator"
"body":"wp_generator()"
"Retrieve an array of active and valid plugin files.":
"prefix":"wp_get_active_and_valid_plugins"
"body":"wp_get_active_and_valid_plugins()"
"Returns array of network plugin files to be included in global scope.":
"prefix":"wp_get_active_network_plugins"
"body":"wp_get_active_network_plugins()"
"Retrieve additional image sizes.":
"prefix":"wp_get_additional_image_sizes"
"body":"wp_get_additional_image_sizes()"
"Retrieve a list of sessions for the current user.":
"prefix":"wp_get_all_sessions"
"body":"wp_get_all_sessions()"
"Display archive links based on type and format.":
"prefix":"wp_get_archives"
"body":"wp_get_archives( ${1:\\$args = ''} )"
"Get the menu items associated with a particular object.":
"prefix":"wp_get_associated_nav_menu_items"
"body":"wp_get_associated_nav_menu_items( ${1:\\$object_id}${2:, \\$object_type = 'post_type'}${3:, \\$taxonomy = ''} )"
"Retrieves the caption for an attachment.":
"prefix":"wp_get_attachment_caption"
"body":"wp_get_attachment_caption( ${1:\\$post_id} )"
"Returns useful keys to use to lookup data from an attachment's stored metadata.":
"prefix":"wp_get_attachment_id3_keys"
"body":"wp_get_attachment_id3_keys( ${1:\\$attachment}${2:, \\$context = 'display'} )"
"Get an HTML img element representing an image attachment":
"prefix":"wp_get_attachment_image"
"body":"wp_get_attachment_image( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false}${4:, \\$attr = ''} )"
"Retrieves the value for an image attachment's 'sizes' attribute.":
"prefix":"wp_get_attachment_image_sizes"
"body":"wp_get_attachment_image_sizes( ${1:\\$attachment_id}${2:, \\$size = 'medium'}${3:, \\$image_meta = null} )"
"Retrieve an image to represent an attachment.":
"prefix":"wp_get_attachment_image_src"
"body":"wp_get_attachment_image_src( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false} )"
"Retrieves the value for an image attachment's 'srcset' attribute.":
"prefix":"wp_get_attachment_image_srcset"
"body":"wp_get_attachment_image_srcset( ${1:\\$attachment_id}${2:, \\$size = 'medium'}${3:, \\$image_meta = null} )"
"Get the URL of an image attachment.":
"prefix":"wp_get_attachment_image_url"
"body":"wp_get_attachment_image_url( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false} )"
"Retrieve an attachment page link using an image or icon, if possible.":
"prefix":"wp_get_attachment_link"
"body":"wp_get_attachment_link( ${1:\\$id}${2:, \\$size = 'thumbnail'}${3:, \\$permalink = false}${4:, \\$icon = false}${5:, \\$text = false}${6:, \\$attr = ''} )"
"Retrieve attachment meta field for attachment ID.":
"prefix":"wp_get_attachment_metadata"
"body":"wp_get_attachment_metadata( ${1:\\$post_id}${2:, \\$unfiltered = false} )"
"Retrieve thumbnail for an attachment.":
"prefix":"wp_get_attachment_thumb_file"
"body":"wp_get_attachment_thumb_file( ${1:\\$post_id} )"
"Retrieve URL for an attachment thumbnail.":
"prefix":"wp_get_attachment_thumb_url"
"body":"wp_get_attachment_thumb_url( ${1:\\$post_id} )"
"Retrieve the URL for an attachment.":
"prefix":"wp_get_attachment_url"
"body":"wp_get_attachment_url( ${1:\\$post_id} )"
"Returns a filtered list of WP-supported audio formats.":
"prefix":"wp_get_audio_extensions"
"body":"wp_get_audio_extensions()"
"Get available translations from the WordPress.org API.":
"prefix":"wp_get_available_translations"
"body":"wp_get_available_translations()"
"Returns the canonical URL for a post.":
"prefix":"wp_get_canonical_url"
"body":"wp_get_canonical_url( ${1:\\$post = null} )"
"Retrieves the maximum character lengths for the comment form fields.":
"prefix":"wp_get_comment_fields_max_lengths"
"body":"wp_get_comment_fields_max_lengths()"
"The status of a comment by ID.":
"prefix":"wp_get_comment_status"
"body":"wp_get_comment_status( ${1:\\$comment_id} )"
"Gets the user cookie login. This function is deprecated.":
"prefix":"wp_get_cookie_login"
"body":"wp_get_cookie_login()"
"Get current commenter's name, email, and URL.":
"prefix":"wp_get_current_commenter"
"body":"wp_get_current_commenter()"
"Retrieve the current user object.":
"prefix":"wp_get_current_user"
"body":"wp_get_current_user()"
"Fetch the saved Custom CSS content for rendering.":
"prefix":"wp_get_custom_css"
"body":"wp_get_custom_css( ${1:\\$stylesheet = ''} )"
"Fetch the `custom_css` post for a given theme.":
"prefix":"wp_get_custom_css_post"
"body":"wp_get_custom_css_post( ${1:\\$stylesheet = ''} )"
"Retrieve the SQL for creating database tables.":
"prefix":"wp_get_db_schema"
"body":"wp_get_db_schema( ${1:\\$scope = 'all'}${2:, \\$blog_id = null} )"
"Returns document title for the current page.":
"prefix":"wp_get_document_title"
"body":"wp_get_document_title()"
"Retrieves the list of common file extensions and their types.":
"prefix":"wp_get_ext_types"
"body":"wp_get_ext_types()"
"Perform a HTTP HEAD or GET request.":
"prefix":"wp_get_http"
"body":"wp_get_http( ${1:\\$url}${2:, \\$file_path = false}${3:, \\$red = 1} )"
"Retrieve HTTP Headers from URL.":
"prefix":"wp_get_http_headers"
"body":"wp_get_http_headers( ${1:\\$url}${2:, \\$deprecated = false} )"
"Returns a WP_Image_Editor instance and loads file into it.":
"prefix":"wp_get_image_editor"
"body":"wp_get_image_editor( ${1:\\$path}${2:, \\$args = array()} )"
"Returns the real mime type of an image file.":
"prefix":"wp_get_image_mime"
"body":"wp_get_image_mime( ${1:\\$file} )"
"Get installed translations.":
"prefix":"wp_get_installed_translations"
"body":"wp_get_installed_translations( ${1:\\$type} )"
"Retrieves the link categories associated with the link specified.":
"prefix":"wp_get_link_cats"
"body":"wp_get_link_cats( ${1:\\$link_id} )"
"Gets the links associated with category.":
"prefix":"wp_get_links"
"body":"wp_get_links( ${1:\\$args = ''} )"
"Gets the links associated with the named category.":
"prefix":"wp_get_linksbyname"
"body":"wp_get_linksbyname( ${1:\\$category}${2:, \\$args = ''} )"
"Retrieve list of mime types and file extensions.":
"prefix":"wp_get_mime_types"
"body":"wp_get_mime_types()"
"Retrieve an array of must-use plugin files.":
"prefix":"wp_get_mu_plugins"
"body":"wp_get_mu_plugins()"
"Retrieves all menu items of a navigation menu.":
"prefix":"wp_get_nav_menu_items"
"body":"wp_get_nav_menu_items( ${1:\\$menu}${2:, \\$args = array()} )"
"Returns a navigation menu object.":
"prefix":"wp_get_nav_menu_object"
"body":"wp_get_nav_menu_object( ${1:\\$menu} )"
"Returns the menu formatted to edit.":
"prefix":"wp_get_nav_menu_to_edit"
"body":"wp_get_nav_menu_to_edit( ${1:\\$menu_id} )"
"Returns all navigation menu objects.":
"prefix":"wp_get_nav_menus"
"body":"wp_get_nav_menus( ${1:\\$args = array()} )"
"Retrieve an object containing information about the requested network.":
"prefix":"wp_get_network"
"body":"wp_get_network( ${1:\\$network} )"
"Get the header information to prevent caching.":
"prefix":"wp_get_nocache_headers"
"body":"wp_get_nocache_headers()"
"Retrieves the terms associated with the given object(s), in the supplied taxonomies.":
"prefix":"wp_get_object_terms"
"body":"wp_get_object_terms( ${1:\\$object_ids}${2:, \\$taxonomies}${3:, \\$args = array()} )"
"Retrieve original referer that was posted, if it exists.":
"prefix":"wp_get_original_referer"
"body":"wp_get_original_referer()"
"Gets the text suggesting how to create strong passwords.":
"prefix":"wp_get_password_hint"
"body":"wp_get_password_hint()"
"Extract headers from a PO file.":
"prefix":"wp_get_pomo_file_data"
"body":"wp_get_pomo_file_data( ${1:\\$po_file} )"
"Returns a list from WordPress.org of popular importer plugins.":
"prefix":"wp_get_popular_importers"
"body":"wp_get_popular_importers()"
"Retrieve the autosaved data of the specified post.":
"prefix":"wp_get_post_autosave"
"body":"wp_get_post_autosave( ${1:\\$post_id}${2:, \\$user_id} )"
"Retrieve the list of categories for a post.":
"prefix":"wp_get_post_categories"
"body":"wp_get_post_categories( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieves a list of post categories.":
"prefix":"wp_get_post_cats"
"body":"wp_get_post_cats( ${1:\\$blogid = '1'}${2:, \\$post_ID} )"
"Return the post's parent's post_ID":
"prefix":"wp_get_post_parent_id"
"body":"wp_get_post_parent_id( ${1:\\$post_ID} )"
"Gets a post revision.":
"prefix":"wp_get_post_revision"
"body":"wp_get_post_revision( ${1:\\$post}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Returns all revisions of specified post.":
"prefix":"wp_get_post_revisions"
"body":"wp_get_post_revisions( ${1:\\$post_id}${2:, \\$args = null} )"
"Retrieve the tags for a post. wp_get_post_tags":
"prefix":"wp_get_post_tags"
"body":"wp_get_post_tags( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieve the terms for a post.":
"prefix":"wp_get_post_terms"
"body":"wp_get_post_terms( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'}${3:, \\$args = array()} )"
"Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.":
"prefix":"wp_get_raw_referer"
"body":"wp_get_raw_referer()"
"Retrieve a number of recent posts.":
"prefix":"wp_get_recent_posts"
"body":"wp_get_recent_posts( ${1:\\$args = array()}${2:, \\$output = ARRAY_A} )"
"Retrieve referer from '_wp_http_referer' or HTTP referer.":
"prefix":"wp_get_referer"
"body":"wp_get_referer()"
"Get the revision UI diff.":
"prefix":"wp_get_revision_ui_diff"
"body":"wp_get_revision_ui_diff( ${1:\\$post}${2:, \\$compare_from}${3:, \\$compare_to} )"
"Retrieve the recurrence schedule for an event.":
"prefix":"wp_get_schedule"
"body":"wp_get_schedule( ${1:\\$hook}${2:, \\$args = array()} )"
"Retrieve supported event recurrence schedules.":
"prefix":"wp_get_schedules"
"body":"wp_get_schedules()"
"Return the HTTP protocol sent by the server.":
"prefix":"wp_get_server_protocol"
"body":"wp_get_server_protocol()"
"Retrieve the current session token from the logged_in cookie.":
"prefix":"wp_get_session_token"
"body":"wp_get_session_token()"
"Returns a shortlink for a post, page, attachment, or site.":
"prefix":"wp_get_shortlink"
"body":"wp_get_shortlink( ${1:\\$id}${2:, \\$context = 'post'}${3:, \\$allow_slugs = true} )"
"Retrieve full list of sidebars and their widget instance IDs.":
"prefix":"wp_get_sidebars_widgets"
"body":"wp_get_sidebars_widgets( ${1:\\$deprecated = true} )"
"Retrieve a single post, based on post ID.":
"prefix":"wp_get_single_post"
"body":"wp_get_single_post( ${1:\\$postid}${2:, \\$mode = OBJECT} )"
"Return an array of sites for a network or networks.":
"prefix":"wp_get_sites"
"body":"wp_get_sites( ${1:\\$args = array()} )"
"Get the new term ID corresponding to a previously split term.":
"prefix":"wp_get_split_term"
"body":"wp_get_split_term( ${1:\\$old_term_id}${2:, \\$taxonomy} )"
"Get data about terms that previously shared a single term_id, but have since been split.":
"prefix":"wp_get_split_terms"
"body":"wp_get_split_terms( ${1:\\$old_term_id} )"
"Returns the term's parent's term_ID.":
"prefix":"wp_get_term_taxonomy_parent_id"
"body":"wp_get_term_taxonomy_parent_id( ${1:\\$term_id}${2:, \\$taxonomy} )"
"Gets a WP_Theme object for a theme.":
"prefix":"wp_get_theme"
"body":"wp_get_theme( ${1:\\$stylesheet = null}${2:, \\$theme_root = null} )"
"Returns an array of WP_Theme objects based on the arguments.":
"prefix":"wp_get_themes"
"body":"wp_get_themes( ${1:\\$args = array()} )"
"Retrieves a list of all language updates available.":
"prefix":"wp_get_translation_updates"
"body":"wp_get_translation_updates()"
"Collect counts and UI strings for available updates":
"prefix":"wp_get_update_data"
"body":"wp_get_update_data()"
"Retrieves uploads directory information.":
"prefix":"wp_get_upload_dir"
"body":"wp_get_upload_dir()"
"Set up the user contact methods.":
"prefix":"wp_get_user_contact_methods"
"body":"wp_get_user_contact_methods( ${1:\\$user = null} )"
"Get the user IDs of all users with no role on this site.":
"prefix":"wp_get_users_with_no_role"
"body":"wp_get_users_with_no_role()"
"Returns a filtered list of WP-supported video formats.":
"prefix":"wp_get_video_extensions"
"body":"wp_get_video_extensions()"
"Retrieve default registered sidebars list.":
"prefix":"wp_get_widget_defaults"
"body":"wp_get_widget_defaults()"
"Guess the URL for the site.":
"prefix":"wp_guess_url"
"body":"wp_guess_url()"
"Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form.":
"prefix":"wp_handle_comment_submission"
"body":"wp_handle_comment_submission( ${1:\\$comment_data} )"
"Wrapper for _wp_handle_upload(). wp_handle_sideload":
"prefix":"wp_handle_sideload"
"body":"wp_handle_sideload( ${1:\\$file}${2:, \\$overrides = false}${3:, \\$time = null} )"
"Wrapper for _wp_handle_upload(). wp_handle_upload":
"prefix":"wp_handle_upload"
"body":"wp_handle_upload( ${1:\\$file}${2:, \\$overrides = false}${3:, \\$time = null} )"
"Get hash of given string.":
"prefix":"wp_hash"
"body":"wp_hash( ${1:\\$data}${2:, \\$scheme = 'auth'} )"
"Create a hash (encrypt) of a plain text password.":
"prefix":"wp_hash_password"
"body":"wp_hash_password( ${1:\\$password} )"
"Fire the wp_head action.":
"prefix":"wp_head"
"body":"wp_head()"
"Disable suspension of Heartbeat on the Add/Edit Post screens.":
"prefix":"wp_heartbeat_set_suspension"
"body":"wp_heartbeat_set_suspension( ${1:\\$settings} )"
"Default settings for heartbeat":
"prefix":"wp_heartbeat_settings"
"body":"wp_heartbeat_settings( ${1:\\$settings} )"
"Safely extracts not more than the first $count characters from html string.":
"prefix":"wp_html_excerpt"
"body":"wp_html_excerpt( ${1:\\$str}${2:, \\$count}${3:, \\$more = null} )"
"Separate HTML elements and comments from the text.":
"prefix":"wp_html_split"
"body":"wp_html_split( ${1:\\$input} )"
"Formats text for the HTML editor.":
"prefix":"wp_htmledit_pre"
"body":"wp_htmledit_pre( ${1:\\$output} )"
"Determines if there is an HTTP Transport that can process this request.":
"prefix":"wp_http_supports"
"body":"wp_http_supports( ${1:\\$capabilities = array()}${2:, \\$url = null} )"
"Validate a URL for safe use in the HTTP API.":
"prefix":"wp_http_validate_url"
"body":"wp_http_validate_url( ${1:\\$url} )"
"Adds the iframe to display content for the media upload page":
"prefix":"wp_iframe"
"body":"wp_iframe( ${1:\\$content_func} )"
"Adds 'srcset' and 'sizes' attributes to an existing 'img' element.":
"prefix":"wp_image_add_srcset_and_sizes"
"body":"wp_image_add_srcset_and_sizes( ${1:\\$image}${2:, \\$image_meta}${3:, \\$attachment_id} )"
"Loads the WP image-editing interface.":
"prefix":"wp_image_editor"
"body":"wp_image_editor( ${1:\\$post_id}${2:, \\$msg = false} )"
"Tests whether there is an editor that supports a given mime type or methods.":
"prefix":"wp_image_editor_supports"
"body":"wp_image_editor_supports( ${1:\\$args = array()} )"
"Helper function to test if aspect ratios for two images match.":
"prefix":"wp_image_matches_ratio"
"body":"wp_image_matches_ratio( ${1:\\$source_width}${2:, \\$source_height}${3:, \\$target_width}${4:, \\$target_height} )"
"Create new GD image resource with transparency support":
"prefix":"wp_imagecreatetruecolor"
"body":"wp_imagecreatetruecolor( ${1:\\$width}${2:, \\$height} )"
"Cleanup importer.":
"prefix":"wp_import_cleanup"
"body":"wp_import_cleanup( ${1:\\$id} )"
"Handle importer uploading and add attachment.":
"prefix":"wp_import_handle_upload"
"body":"wp_import_handle_upload()"
"Outputs the form used by the importers to accept the data to be imported":
"prefix":"wp_import_upload_form"
"body":"wp_import_upload_form( ${1:\\$action} )"
"Defines initial WordPress constants":
"prefix":"wp_initial_constants"
"body":"wp_initial_constants()"
"Limit the amount of meta boxes to pages, posts, links, and categories for first time users.":
"prefix":"wp_initial_nav_menu_meta_boxes"
"body":"wp_initial_nav_menu_meta_boxes()"
"Insert an attachment.":
"prefix":"wp_insert_attachment"
"body":"wp_insert_attachment( ${1:\\$args}${2:, \\$file = false}${3:, \\$parent}${4:, \\$wp_error = false} )"
"Updates an existing Category or creates a new Category.":
"prefix":"wp_insert_category"
"body":"wp_insert_category( ${1:\\$catarr}${2:, \\$wp_error = false} )"
"Inserts a comment into the database.":
"prefix":"wp_insert_comment"
"body":"wp_insert_comment( ${1:\\$commentdata} )"
"Inserts/updates links into/in the database.":
"prefix":"wp_insert_link"
"body":"wp_insert_link( ${1:\\$linkdata}${2:, \\$wp_error = false} )"
"Insert or update a post.":
"prefix":"wp_insert_post"
"body":"wp_insert_post( ${1:\\$postarr}${2:, \\$wp_error = false} )"
"Add a new term to the database.":
"prefix":"wp_insert_term"
"body":"wp_insert_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Insert a user into the database.":
"prefix":"wp_insert_user"
"body":"wp_insert_user( ${1:\\$userdata} )"
"Installs the site.":
"prefix":"wp_install"
"body":"wp_install( ${1:\\$blog_title}${2:, \\$user_name}${3:, \\$user_email}${4:, \\$public}${5:, \\$deprecated = ''}${6:, \\$user_password = ''}${7:, \\$language = ''} )"
"Creates the initial content for a newly-installed site.":
"prefix":"wp_install_defaults"
"body":"wp_install_defaults( ${1:\\$user_id} )"
"Output the select form for the language selection on the installation screen.":
"prefix":"wp_install_language_form"
"body":"wp_install_language_form( ${1:\\$languages} )"
"Maybe enable pretty permalinks on install.":
"prefix":"wp_install_maybe_enable_pretty_permalinks"
"body":"wp_install_maybe_enable_pretty_permalinks()"
"Check or set whether WordPress is in "installation" mode.":
"prefix":"wp_installing"
"body":"wp_installing( ${1:\\$is_installing = null} )"
"Determines whether file modifications are allowed.":
"prefix":"wp_is_file_mod_allowed"
"body":"wp_is_file_mod_allowed( ${1:\\$context} )"
"Determines whether a PHP ini value is changeable at runtime.":
"prefix":"wp_is_ini_value_changeable"
"body":"wp_is_ini_value_changeable( ${1:\\$setting} )"
"Whether or not we have a large network.":
"prefix":"wp_is_large_network"
"body":"wp_is_large_network( ${1:\\$using = 'sites'}${2:, \\$network_id = null} )"
"Test if the current browser runs on a mobile device (smart phone, tablet, etc.)":
"prefix":"wp_is_mobile"
"body":"wp_is_mobile()"
"Determines if the variable is a numeric-indexed array.":
"prefix":"wp_is_numeric_array"
"body":"wp_is_numeric_array( ${1:\\$data} )"
"Determines if the specified post is an autosave.":
"prefix":"wp_is_post_autosave"
"body":"wp_is_post_autosave( ${1:\\$post} )"
"Determines if the specified post is a revision.":
"prefix":"wp_is_post_revision"
"body":"wp_is_post_revision( ${1:\\$post} )"
"Test if a given path is a stream URL":
"prefix":"wp_is_stream"
"body":"wp_is_stream( ${1:\\$path} )"
"Determine if a directory is writable.":
"prefix":"wp_is_writable"
"body":"wp_is_writable( ${1:\\$path} )"
"Convert to ASCII from email subjects.":
"prefix":"wp_iso_descrambler"
"body":"wp_iso_descrambler( ${1:\\$string} )"
"Encode a variable into JSON, with some sanity checks.":
"prefix":"wp_json_encode"
"body":"wp_json_encode( ${1:\\$data}${2:, \\$options}${3:, \\$depth = 512} )"
"Load localized data on print rather than initialization.":
"prefix":"wp_just_in_time_script_localization"
"body":"wp_just_in_time_script_localization()"
"Filters content and keeps only allowable HTML elements.":
"prefix":"wp_kses"
"body":"wp_kses( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols = array()} )"
"Return a list of allowed tags and attributes for a given context.":
"prefix":"wp_kses_allowed_html"
"body":"wp_kses_allowed_html( ${1:\\$context = ''} )"
"Goes through an array and changes the keys to all lower case.":
"prefix":"wp_kses_array_lc"
"body":"wp_kses_array_lc( ${1:\\$inarray} )"
"Removes all attributes, if none are allowed for this element.":
"prefix":"wp_kses_attr"
"body":"wp_kses_attr( ${1:\\$element}${2:, \\$attr}${3:, \\$allowed_html}${4:, \\$allowed_protocols} )"
"Determine whether an attribute is allowed.":
"prefix":"wp_kses_attr_check"
"body":"wp_kses_attr_check( ${1:\\$name}${2:, \\$value}${3:, \\$whole}${4:, \\$vless}${5:, \\$element}${6:, \\$allowed_html} )"
"Finds all attributes of an HTML element.":
"prefix":"wp_kses_attr_parse"
"body":"wp_kses_attr_parse( ${1:\\$element} )"
"Sanitize string from bad protocols.":
"prefix":"wp_kses_bad_protocol"
"body":"wp_kses_bad_protocol( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Sanitizes content from bad protocols and other characters.":
"prefix":"wp_kses_bad_protocol_once"
"body":"wp_kses_bad_protocol_once( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Callback for wp_kses_bad_protocol_once() regular expression.":
"prefix":"wp_kses_bad_protocol_once2"
"body":"wp_kses_bad_protocol_once2( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Performs different checks for attribute values.":
"prefix":"wp_kses_check_attr_val"
"body":"wp_kses_check_attr_val( ${1:\\$value}${2:, \\$vless}${3:, \\$checkname}${4:, \\$checkvalue} )"
"Sanitize content with allowed HTML Kses rules. wp_kses_datare":
"prefix":"wp_kses_data"
"body":"wp_kses_data( ${1:\\$data} )"
"Convert all entities to their character counterparts.":
"prefix":"wp_kses_decode_entities"
"body":"wp_kses_decode_entities( ${1:\\$string} )"
"Builds an attribute list from string containing attributes. wp_kses_hair":
"prefix":"wp_kses_hair"
"body":"wp_kses_hair( ${1:\\$attr}${2:, \\$allowed_protocols} )"
"Builds an attribute list from string containing attributes. wp_kses_hair_parse":
"prefix":"wp_kses_hair_parse"
"body":"wp_kses_hair_parse( ${1:\\$attr} )"
"You add any kses hooks here.":
"prefix":"wp_kses_hook"
"body":"wp_kses_hook( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Handles parsing errors in wp_kses_hair().":
"prefix":"wp_kses_html_error"
"body":"wp_kses_html_error( ${1:\\$string} )"
"Removes the HTML JavaScript entities found in early versions of Netscape 4.":
"prefix":"wp_kses_js_entities"
"body":"wp_kses_js_entities( ${1:\\$string} )"
"Callback for wp_kses_normalize_entities() regular expression. wp_kses_named_entitiesre":
"prefix":"wp_kses_named_entities"
"body":"wp_kses_named_entities( ${1:\\$matches} )"
"Removes any invalid control characters in $string.":
"prefix":"wp_kses_no_null"
"body":"wp_kses_no_null( ${1:\\$string}${2:, \\$options = null} )"
"Converts and fixes HTML entities.":
"prefix":"wp_kses_normalize_entities"
"body":"wp_kses_normalize_entities( ${1:\\$string} )"
"Callback for wp_kses_normalize_entities() regular expression. wp_kses_normalize_entities2":
"prefix":"wp_kses_normalize_entities2"
"body":"wp_kses_normalize_entities2( ${1:\\$matches} )"
"Callback for wp_kses_normalize_entities() for regular expression.":
"prefix":"wp_kses_normalize_entities3"
"body":"wp_kses_normalize_entities3( ${1:\\$matches} )"
"Filters one attribute only and ensures its value is allowed.":
"prefix":"wp_kses_one_attr"
"body":"wp_kses_one_attr( ${1:\\$string}${2:, \\$element} )"
"Sanitize content for allowed HTML tags for post content. wp_kses_post":
"prefix":"wp_kses_post"
"body":"wp_kses_post( ${1:\\$data} )"
"Navigates through an array, object, or scalar, and sanitizes content for
allowed HTML tags for post content.":
"prefix":"wp_kses_post_deep"
"body":"wp_kses_post_deep( ${1:\\$data} )"
"Searches for HTML tags, no matter how malformed.":
"prefix":"wp_kses_split"
"body":"wp_kses_split( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Callback for wp_kses_split for fixing malformed HTML tags.":
"prefix":"wp_kses_split2"
"body":"wp_kses_split2( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Strips slashes from in front of quotes.":
"prefix":"wp_kses_stripslashes"
"body":"wp_kses_stripslashes( ${1:\\$string} )"
"This function returns kses' version number.":
"prefix":"wp_kses_version"
"body":"wp_kses_version()"
"Outputs a link category checklist element.":
"prefix":"wp_link_category_checklist"
"body":"wp_link_category_checklist( ${1:\\$link_id} )"
"Outputs the 'disabled' message for the WordPress Link Manager.":
"prefix":"wp_link_manager_disabled_message"
"body":"wp_link_manager_disabled_message()"
"The formatted output of a list of pages.":
"prefix":"wp_link_pages"
"body":"wp_link_pages( ${1:\\$args = ''} )"
"List all the authors of the site, with several options available.":
"prefix":"wp_list_authors"
"body":"wp_list_authors( ${1:\\$args = ''} )"
"Retrieve or echo all of the bookmarks.":
"prefix":"wp_list_bookmarks"
"body":"wp_list_bookmarks( ${1:\\$args = ''} )"
"Display or retrieve the HTML list of categories.":
"prefix":"wp_list_categories"
"body":"wp_list_categories( ${1:\\$args = ''} )"
"Lists categories. wp_list_cats":
"prefix":"wp_list_cats"
"body":"wp_list_cats( ${1:\\$args = ''} )"
"List comments.":
"prefix":"wp_list_comments"
"body":"wp_list_comments( ${1:\\$args = array()}${2:, \\$comments = null} )"
"Filters a list of objects, based on a set of key => value arguments. wp_list_filter":
"prefix":"wp_list_filter"
"body":"wp_list_filter( ${1:\\$list}${2:, \\$args = array()}${3:, \\$operator = 'AND'} )"
"Retrieve or display list of pages (or hierarchical post type items) in list (li) format.":
"prefix":"wp_list_pages"
"body":"wp_list_pages( ${1:\\$args = ''} )"
"Pluck a certain field out of each object in a list.":
"prefix":"wp_list_pluck"
"body":"wp_list_pluck( ${1:\\$list}${2:, \\$field}${3:, \\$index_key = null} )"
"Display list of a post's revisions.":
"prefix":"wp_list_post_revisions"
"body":"wp_list_post_revisions( ${1:\\$post_id}${2:, \\$type = 'all'} )"
"Sorts a list of objects, based on one or more orderby arguments.":
"prefix":"wp_list_sort"
"body":"wp_list_sort( ${1:\\$list}${2:, \\$orderby = array()}${3:, \\$order = 'ASC'}${4:, \\$preserve_keys = false} )"
"Show the widgets and their settings for a sidebar.":
"prefix":"wp_list_widget_controls"
"body":"wp_list_widget_controls( ${1:\\$sidebar}${2:, \\$sidebar_name = ''} )"
"Retrieves the widget control arguments.":
"prefix":"wp_list_widget_controls_dynamic_sidebar"
"body":"wp_list_widget_controls_dynamic_sidebar( ${1:\\$params} )"
"Display list of the available widgets.":
"prefix":"wp_list_widgets"
"body":"wp_list_widgets()"
"Loads and caches all autoloaded options, if available or all options.":
"prefix":"wp_load_alloptions"
"body":"wp_load_alloptions()"
"Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used.":
"prefix":"wp_load_core_site_options"
"body":"wp_load_core_site_options( ${1:\\$site_id = null} )"
"Load an image from a string, if PHP supports it.":
"prefix":"wp_load_image"
"body":"wp_load_image( ${1:\\$file} )"
"Attempt an early load of translations.":
"prefix":"wp_load_translations_early"
"body":"wp_load_translations_early()"
"Localizes community events data that needs to be passed to dashboard.js.":
"prefix":"wp_localize_community_events"
"body":"wp_localize_community_events()"
"Localizes the jQuery UI datepicker.":
"prefix":"wp_localize_jquery_ui_datepicker"
"body":"wp_localize_jquery_ui_datepicker()"
"Localize a script.":
"prefix":"wp_localize_script"
"body":"wp_localize_script( ${1:\\$handle}${2:, \\$object_name}${3:, \\$l10n} )"
"Checks a users login information and logs them in if it checks out. This function is deprecated.":
"prefix":"wp_login"
"body":"wp_login( ${1:\\$username}${2:, \\$password}${3:, \\$deprecated = ''} )"
"Provides a simple login form for use anywhere within WordPress.":
"prefix":"wp_login_form"
"body":"wp_login_form( ${1:\\$args = array()} )"
"Retrieves the login URL.":
"prefix":"wp_login_url"
"body":"wp_login_url( ${1:\\$redirect = ''}${2:, \\$force_reauth = false} )"
"wp_login_viewport_meta":
"prefix":"wp_login_viewport_meta"
"body":"wp_login_viewport_meta()"
"Display the Log In/Out link.":
"prefix":"wp_loginout"
"body":"wp_loginout( ${1:\\$redirect = ''}${2:, \\$echo = true} )"
"Log the current user out.":
"prefix":"wp_logout"
"body":"wp_logout()"
"Retrieves the logout URL.":
"prefix":"wp_logout_url"
"body":"wp_logout_url( ${1:\\$redirect = ''} )"
"Returns the URL that allows the user to retrieve the lost password":
"prefix":"wp_lostpassword_url"
"body":"wp_lostpassword_url( ${1:\\$redirect = ''} )"
"Add magic quotes to `$_GET`, `$_POST`, `$_COOKIE`, and `$_SERVER`.":
"prefix":"wp_magic_quotes"
"body":"wp_magic_quotes()"
"Send mail, similar to PHP's mail":
"prefix":"wp_mail"
"body":"wp_mail( ${1:\\$to}${2:, \\$subject}${3:, \\$message}${4:, \\$headers = ''}${5:, \\$attachments = array()} )"
"Die with a maintenance message when conditions are met.":
"prefix":"wp_maintenance"
"body":"wp_maintenance()"
"Filters 'img' elements in post content to add 'srcset' and 'sizes' attributes.":
"prefix":"wp_make_content_images_responsive"
"body":"wp_make_content_images_responsive( ${1:\\$content} )"
"Convert full URL paths to absolute paths.":
"prefix":"wp_make_link_relative"
"body":"wp_make_link_relative( ${1:\\$link} )"
"Check a MIME-Type against a list.":
"prefix":"wp_match_mime_types"
"body":"wp_match_mime_types( ${1:\\$wildcard_mime_types}${2:, \\$real_mime_types} )"
"Determines the maximum upload size allowed in php.ini.":
"prefix":"wp_max_upload_size"
"body":"wp_max_upload_size()"
"Performs WordPress automatic background updates.":
"prefix":"wp_maybe_auto_update"
"body":"wp_maybe_auto_update()"
"Determines if the date should be declined.":
"prefix":"wp_maybe_decline_date"
"body":"wp_maybe_decline_date( ${1:\\$date} )"
"Maybe attempts to generate attachment metadata, if missing.":
"prefix":"wp_maybe_generate_attachment_metadata"
"body":"wp_maybe_generate_attachment_metadata( ${1:\\$attachment} )"
"Determines if default embed handlers should be loaded.":
"prefix":"wp_maybe_load_embeds"
"body":"wp_maybe_load_embeds()"
"Determines if Widgets library should be loaded.":
"prefix":"wp_maybe_load_widgets"
"body":"wp_maybe_load_widgets()"
"Update the count of sites for the current network.":
"prefix":"wp_maybe_update_network_site_counts"
"body":"wp_maybe_update_network_site_counts( ${1:\\$network_id = null} )"
"Update the network-wide users count.":
"prefix":"wp_maybe_update_network_user_counts"
"body":"wp_maybe_update_network_user_counts( ${1:\\$network_id = null} )"
"Encapsulate logic for Attach/Detach actions":
"prefix":"wp_media_attach_action"
"body":"wp_media_attach_action( ${1:\\$parent_id}${2:, \\$action = 'attach'} )"
"Creates the form for external url":
"prefix":"wp_media_insert_url_form"
"body":"wp_media_insert_url_form( ${1:\\$default_view = 'image'} )"
"Handles the process of uploading media.":
"prefix":"wp_media_upload_handler"
"body":"wp_media_upload_handler()"
"Provides a No-JS Flash fallback as a last resort for audio / video.":
"prefix":"wp_mediaelement_fallback"
"body":"wp_mediaelement_fallback( ${1:\\$url} )"
"Theme container function for the 'wp_meta' action.":
"prefix":"wp_meta"
"body":"wp_meta()"
"Retrieves the queue for lazy-loading metadata.":
"prefix":"wp_metadata_lazyloader"
"body":"wp_metadata_lazyloader()"
"Retrieve the icon for a MIME type.":
"prefix":"wp_mime_type_icon"
"body":"wp_mime_type_icon( ${1:\\$mime} )"
"Recursive directory creation based on full path.":
"prefix":"wp_mkdir_p"
"body":"wp_mkdir_p( ${1:\\$target} )"
"Displays a navigation menu.":
"prefix":"wp_nav_menu"
"body":"wp_nav_menu( ${1:\\$args = array()} )"
"Check whether to disable the Menu Locations meta box submit button":
"prefix":"wp_nav_menu_disabled_check"
"body":"wp_nav_menu_disabled_check( ${1:\\$nav_menu_selected_id} )"
"Displays a meta box for the custom links menu item.":
"prefix":"wp_nav_menu_item_link_meta_box"
"body":"wp_nav_menu_item_link_meta_box()"
"Displays a meta box for a post type menu item.":
"prefix":"wp_nav_menu_item_post_type_meta_box"
"body":"wp_nav_menu_item_post_type_meta_box( ${1:\\$object}${2:, \\$box} )"
"Displays a meta box for a taxonomy menu item.":
"prefix":"wp_nav_menu_item_taxonomy_meta_box"
"body":"wp_nav_menu_item_taxonomy_meta_box( ${1:\\$object}${2:, \\$box} )"
"This was once used to display a meta box for the nav menu theme locations.":
"prefix":"wp_nav_menu_locations_meta_box"
"body":"wp_nav_menu_locations_meta_box()"
"Returns the columns for the nav menus page.":
"prefix":"wp_nav_menu_manage_columns"
"body":"wp_nav_menu_manage_columns()"
"wp_nav_menu_max_depth":
"prefix":"wp_nav_menu_max_depth"
"body":"wp_nav_menu_max_depth( ${1:\\$classes} )"
"Creates meta boxes for any post type menu item..":
"prefix":"wp_nav_menu_post_type_meta_boxes"
"body":"wp_nav_menu_post_type_meta_boxes()"
"Register nav menu meta boxes and advanced menu items.":
"prefix":"wp_nav_menu_setup"
"body":"wp_nav_menu_setup()"
"Creates meta boxes for any taxonomy menu item.":
"prefix":"wp_nav_menu_taxonomy_meta_boxes"
"body":"wp_nav_menu_taxonomy_meta_boxes()"
"Saves nav menu items":
"prefix":"wp_nav_menu_update_menu_items"
"body":"wp_nav_menu_update_menu_items( ${1:\\$nav_menu_selected_id}${2:, \\$nav_menu_selected_title} )"
"wp_network_dashboard_right_now":
"prefix":"wp_network_dashboard_right_now"
"body":"wp_network_dashboard_right_now()"
"Notifies the site admin that the setup is complete.":
"prefix":"wp_new_blog_notification"
"body":"wp_new_blog_notification( ${1:\\$blog_title}${2:, \\$blog_url}${3:, \\$user_id}${4:, \\$password} )"
"Adds a new comment to the database.":
"prefix":"wp_new_comment"
"body":"wp_new_comment( ${1:\\$commentdata}${2:, \\$avoid_die = false} )"
"Send a comment moderation notification to the comment moderator.":
"prefix":"wp_new_comment_notify_moderator"
"body":"wp_new_comment_notify_moderator( ${1:\\$comment_ID} )"
"Send a notification of a new comment to the post author.":
"prefix":"wp_new_comment_notify_postauthor"
"body":"wp_new_comment_notify_postauthor( ${1:\\$comment_ID} )"
"Email login credentials to a newly-registered user.":
"prefix":"wp_new_user_notification"
"body":"wp_new_user_notification( ${1:\\$user_id}${2:, \\$deprecated = null}${3:, \\$notify = ''} )"
"Retrieve the next timestamp for an event.":
"prefix":"wp_next_scheduled"
"body":"wp_next_scheduled( ${1:\\$hook}${2:, \\$args = array()} )"
"Display a noindex meta tag.":
"prefix":"wp_no_robots"
"body":"wp_no_robots()"
"Display "Are You Sure" message to confirm the action being taken.":
"prefix":"wp_nonce_ays"
"body":"wp_nonce_ays( ${1:\\$action} )"
"Retrieve or display nonce hidden field for forms.":
"prefix":"wp_nonce_field"
"body":"wp_nonce_field( ${1:\\$action = -1}${2:, \\$name = '_wpnonce'}${3:, \\$referer = true}${4:, \\$echo = true} )"
"Get the time-dependent variable for nonce creation.":
"prefix":"wp_nonce_tick"
"body":"wp_nonce_tick()"
"Retrieve URL with nonce added to URL query.":
"prefix":"wp_nonce_url"
"body":"wp_nonce_url( ${1:\\$actionurl}${2:, \\$action = -1}${3:, \\$name = '_wpnonce'} )"
"Normalize a filesystem path.":
"prefix":"wp_normalize_path"
"body":"wp_normalize_path( ${1:\\$path} )"
"Redirect to the installer if WordPress is not installed.":
"prefix":"wp_not_installed"
"body":"wp_not_installed()"
"Notifies the moderator of the site about a new comment that is awaiting approval.":
"prefix":"wp_notify_moderator"
"body":"wp_notify_moderator( ${1:\\$comment_id} )"
"Notify an author (and/or others) of a comment/trackback/pingback on a post.":
"prefix":"wp_notify_postauthor"
"body":"wp_notify_postauthor( ${1:\\$comment_id}${2:, \\$deprecated = null} )"
"Flush all output buffers for PHP 5.2.":
"prefix":"wp_ob_end_flush_all"
"body":"wp_ob_end_flush_all()"
"Adds oEmbed discovery links in the website <head>.":
"prefix":"wp_oembed_add_discovery_links"
"body":"wp_oembed_add_discovery_links()"
"Adds the necessary JavaScript to communicate with the embedded iframes.":
"prefix":"wp_oembed_add_host_js"
"body":"wp_oembed_add_host_js()"
"Adds a URL format and oEmbed provider URL pair.":
"prefix":"wp_oembed_add_provider"
"body":"wp_oembed_add_provider( ${1:\\$format}${2:, \\$provider}${3:, \\$regex = false} )"
"Ensures that the specified format is either 'json' or 'xml'.":
"prefix":"wp_oembed_ensure_format"
"body":"wp_oembed_ensure_format( ${1:\\$format} )"
"Attempts to fetch the embed HTML for a provided URL using oEmbed.":
"prefix":"wp_oembed_get"
"body":"wp_oembed_get( ${1:\\$url}${2:, \\$args = ''} )"
"Registers the oEmbed REST API route.":
"prefix":"wp_oembed_register_route"
"body":"wp_oembed_register_route()"
"Removes an oEmbed provider.":
"prefix":"wp_oembed_remove_provider"
"body":"wp_oembed_remove_provider( ${1:\\$format} )"
"Redirect old slugs to the correct permalink.":
"prefix":"wp_old_slug_redirect"
"body":"wp_old_slug_redirect()"
"Retrieve or display original referer hidden field for forms.":
"prefix":"wp_original_referer_field"
"body":"wp_original_referer_field( ${1:\\$echo = true}${2:, \\$jump_back_to = 'current'} )"
"Displays or retrieves a list of pages with an optional home link.":
"prefix":"wp_page_menu"
"body":"wp_page_menu( ${1:\\$args = array()} )"
"Outputs JS that reloads the page if the user navigated to it with the Back or Forward button.":
"prefix":"wp_page_reload_on_back_button_js"
"body":"wp_page_reload_on_back_button_js()"
"Merge user defined arguments into defaults array.":
"prefix":"wp_parse_args"
"body":"wp_parse_args( ${1:\\$args}${2:, \\$defaults = ''} )"
"Parse a cookie into its components":
"prefix":"wp_parse_auth_cookie"
"body":"wp_parse_auth_cookie( ${1:\\$cookie = ''}${2:, \\$scheme = ''} )"
"Clean up an array, comma- or space-separated list of IDs.":
"prefix":"wp_parse_id_list"
"body":"wp_parse_id_list( ${1:\\$list} )"
"Clean up an array, comma- or space-separated list of slugs.":
"prefix":"wp_parse_slug_list"
"body":"wp_parse_slug_list( ${1:\\$list} )"
"Parses a string into variables to be stored in an array.":
"prefix":"wp_parse_str"
"body":"wp_parse_str( ${1:\\$string}${2:, \\$array} )"
"A wrapper for PHP's parse_url() function that handles consistency in the return
values across PHP versions.":
"prefix":"wp_parse_url"
"body":"wp_parse_url( ${1:\\$url}${2:, \\$component = -1} )"
"Notify the blog admin of a user changing password, normally via email.":
"prefix":"wp_password_change_notification"
"body":"wp_password_change_notification( ${1:\\$user} )"
"Outputs and enqueue default scripts and styles for playlists.":
"prefix":"wp_playlist_scripts"
"body":"wp_playlist_scripts( ${1:\\$type} )"
"Builds the Playlist shortcode output.":
"prefix":"wp_playlist_shortcode"
"body":"wp_playlist_shortcode( ${1:\\$attr} )"
"Defines plugin directory WordPress constants":
"prefix":"wp_plugin_directory_constants"
"body":"wp_plugin_directory_constants()"
"Displays update information for a plugin.":
"prefix":"wp_plugin_update_row"
"body":"wp_plugin_update_row( ${1:\\$file}${2:, \\$plugin_data} )"
"wp_plugin_update_rows":
"prefix":"wp_plugin_update_rows"
"body":"wp_plugin_update_rows()"
"Prints default Plupload arguments.":
"prefix":"wp_plupload_default_settings"
"body":"wp_plupload_default_settings()"
"Retrieve a list of the most popular terms from the specified taxonomy.":
"prefix":"wp_popular_terms_checklist"
"body":"wp_popular_terms_checklist( ${1:\\$taxonomy}${2:, \\$default}${3:, \\$number = 10}${4:, \\$echo = true} )"
"Convert MIME types into SQL.":
"prefix":"wp_post_mime_type_where"
"body":"wp_post_mime_type_where( ${1:\\$post_mime_types}${2:, \\$table_alias = ''} )"
"Outputs a small JS snippet on preview tabs/windows to remove `window.name` on unload.":
"prefix":"wp_post_preview_js"
"body":"wp_post_preview_js()"
"Retrieve formatted date timestamp of a revision (linked to that revisions's page). wp_post_revision_title":
"prefix":"wp_post_revision_title"
"body":"wp_post_revision_title( ${1:\\$revision}${2:, \\$link = true} )"
"Retrieve formatted date timestamp of a revision (linked to that revisions's page). wp_post_revision_title_expanded":
"prefix":"wp_post_revision_title_expanded"
"body":"wp_post_revision_title_expanded( ${1:\\$revision}${2:, \\$link = true} )"
"Convert lone less than signs.":
"prefix":"wp_pre_kses_less_than"
"body":"wp_pre_kses_less_than( ${1:\\$text} )"
"Callback function used by preg_replace.":
"prefix":"wp_pre_kses_less_than_callback"
"body":"wp_pre_kses_less_than_callback( ${1:\\$matches} )"
"Preloads TinyMCE dialogs.":
"prefix":"wp_preload_dialogs"
"body":"wp_preload_dialogs()"
"Prepares an attachment post object for JS, where it is expected
to be JSON-encoded and fit into an Attachment model.":
"prefix":"wp_prepare_attachment_for_js"
"body":"wp_prepare_attachment_for_js( ${1:\\$attachment} )"
"Prepare revisions for JavaScript.":
"prefix":"wp_prepare_revisions_for_js"
"body":"wp_prepare_revisions_for_js( ${1:\\$post}${2:, \\$selected_revision_id}${3:, \\$from = null} )"
"Prepare themes for JavaScript.":
"prefix":"wp_prepare_themes_for_js"
"body":"wp_prepare_themes_for_js( ${1:\\$themes = null} )"
"Prints the JavaScript templates for update admin notices.":
"prefix":"wp_print_admin_notice_templates"
"body":"wp_print_admin_notice_templates()"
"Prints the markup for the Community Events section of the Events and News Dashboard widget.":
"prefix":"wp_print_community_events_markup"
"body":"wp_print_community_events_markup()"
"Renders the events templates for the Event and News widget.":
"prefix":"wp_print_community_events_templates"
"body":"wp_print_community_events_templates()"
"Prints TinyMCE editor JS.":
"prefix":"wp_print_editor_js"
"body":"wp_print_editor_js()"
"Hooks to print the scripts and styles in the footer.":
"prefix":"wp_print_footer_scripts"
"body":"wp_print_footer_scripts()"
"Prints the script queue in the HTML head on the front end.":
"prefix":"wp_print_head_scripts"
"body":"wp_print_head_scripts()"
"Prints the templates used in the media manager.":
"prefix":"wp_print_media_templates"
"body":"wp_print_media_templates()"
"Print the filesystem credentials modal when needed.":
"prefix":"wp_print_request_filesystem_credentials_modal"
"body":"wp_print_request_filesystem_credentials_modal()"
"Print JavaScript templates required for the revisions experience.":
"prefix":"wp_print_revision_templates"
"body":"wp_print_revision_templates()"
"Prints scripts in document head that are in the $handles queue.":
"prefix":"wp_print_scripts"
"body":"wp_print_scripts( ${1:\\$handles = false} )"
"Display styles that are in the $handles queue.":
"prefix":"wp_print_styles"
"body":"wp_print_styles( ${1:\\$handles = false} )"
"Prints the JavaScript templates for update and deletion rows in list tables.":
"prefix":"wp_print_update_row_templates"
"body":"wp_print_update_row_templates()"
"Protect WordPress special option from being modified.":
"prefix":"wp_protect_special_option"
"body":"wp_protect_special_option( ${1:\\$option} )"
"Reorder JavaScript scripts array to place prototype before jQuery.":
"prefix":"wp_prototype_before_jquery"
"body":"wp_prototype_before_jquery( ${1:\\$js_array} )"
"Publish a post by transitioning the post status.":
"prefix":"wp_publish_post"
"body":"wp_publish_post( ${1:\\$post} )"
"Queues comments for metadata lazy-loading.":
"prefix":"wp_queue_comments_for_comment_meta_lazyload"
"body":"wp_queue_comments_for_comment_meta_lazyload( ${1:\\$comments} )"
"Queues posts for lazy-loading of term meta.":
"prefix":"wp_queue_posts_for_term_meta_lazyload"
"body":"wp_queue_posts_for_term_meta_lazyload( ${1:\\$posts} )"
"Handles quicktags.":
"prefix":"wp_quicktags"
"body":"wp_quicktags()"
"Attempts to raise the PHP memory limit for memory intensive processes.":
"prefix":"wp_raise_memory_limit"
"body":"wp_raise_memory_limit( ${1:\\$context = 'admin'} )"
"Generates a random number":
"prefix":"wp_rand"
"body":"wp_rand( ${1:\\$min}${2:, \\$max} )"
"Retrieve metadata from a audio file's ID3 tags":
"prefix":"wp_read_audio_metadata"
"body":"wp_read_audio_metadata( ${1:\\$file} )"
"Get extended image metadata, exif or iptc as available.":
"prefix":"wp_read_image_metadata"
"body":"wp_read_image_metadata( ${1:\\$file} )"
"Retrieve metadata from a video file's ID3 tags":
"prefix":"wp_read_video_metadata"
"body":"wp_read_video_metadata( ${1:\\$file} )"
"Redirects to another page.":
"prefix":"wp_redirect"
"body":"wp_redirect( ${1:\\$location}${2:, \\$status = 302} )"
"Redirects a variety of shorthand URLs to the admin.":
"prefix":"wp_redirect_admin_locations"
"body":"wp_redirect_admin_locations()"
"Retrieve or display referer hidden field for forms.":
"prefix":"wp_referer_field"
"body":"wp_referer_field( ${1:\\$echo = true} )"
"Check lock status on the New/Edit Post screen and refresh the lock":
"prefix":"wp_refresh_post_lock"
"body":"wp_refresh_post_lock( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Check nonce expiration on the New/Edit Post screen and refresh if needed":
"prefix":"wp_refresh_post_nonces"
"body":"wp_refresh_post_nonces( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Display the Registration or Admin link.":
"prefix":"wp_register"
"body":"wp_register( ${1:\\$before = '<li>'}${2:, \\$after = '</li>'}${3:, \\$echo = true} )"
"Register a plugin's real path.":
"prefix":"wp_register_plugin_realpath"
"body":"wp_register_plugin_realpath( ${1:\\$file} )"
"Register a new script.":
"prefix":"wp_register_script"
"body":"wp_register_script( ${1:\\$handle}${2:, \\$src}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$in_footer = false} )"
"Register an instance of a widget.":
"prefix":"wp_register_sidebar_widget"
"body":"wp_register_sidebar_widget( ${1:\\$id}${2:, \\$name}${3:, \\$output_callback}${4:, \\$options = array()} )"
"Register a CSS stylesheet.":
"prefix":"wp_register_style"
"body":"wp_register_style( ${1:\\$handle}${2:, \\$src}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$media = 'all'} )"
"Registers widget control callback for customizing options. wp_register_widget_control":
"prefix":"wp_register_widget_control"
"body":"wp_register_widget_control( ${1:\\$id}${2:, \\$name}${3:, \\$control_callback}${4:, \\$options = array()} )"
"Returns the URL that allows the user to register on the site.":
"prefix":"wp_registration_url"
"body":"wp_registration_url()"
"Adds rel nofollow string to all HTML A elements in content.":
"prefix":"wp_rel_nofollow"
"body":"wp_rel_nofollow( ${1:\\$text} )"
"Callback to add rel=nofollow string to HTML A element.":
"prefix":"wp_rel_nofollow_callback"
"body":"wp_rel_nofollow_callback( ${1:\\$matches} )"
"HTTP request for URI to retrieve content.":
"prefix":"wp_remote_fopen"
"body":"wp_remote_fopen( ${1:\\$uri} )"
"Retrieve the raw response from the HTTP request using the GET method.":
"prefix":"wp_remote_get"
"body":"wp_remote_get( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request using the HEAD method.":
"prefix":"wp_remote_head"
"body":"wp_remote_head( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request using the POST method.":
"prefix":"wp_remote_post"
"body":"wp_remote_post( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request.":
"prefix":"wp_remote_request"
"body":"wp_remote_request( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve only the body from the raw response.":
"prefix":"wp_remote_retrieve_body"
"body":"wp_remote_retrieve_body( ${1:\\$response} )"
"Retrieve a single cookie by name from the raw response.":
"prefix":"wp_remote_retrieve_cookie"
"body":"wp_remote_retrieve_cookie( ${1:\\$response}${2:, \\$name} )"
"Retrieve a single cookie's value by name from the raw response.":
"prefix":"wp_remote_retrieve_cookie_value"
"body":"wp_remote_retrieve_cookie_value( ${1:\\$response}${2:, \\$name} )"
"Retrieve only the cookies from the raw response.":
"prefix":"wp_remote_retrieve_cookies"
"body":"wp_remote_retrieve_cookies( ${1:\\$response} )"
"Retrieve a single header by name from the raw response.":
"prefix":"wp_remote_retrieve_header"
"body":"wp_remote_retrieve_header( ${1:\\$response}${2:, \\$header} )"
"Retrieve only the headers from the raw response.":
"prefix":"wp_remote_retrieve_headers"
"body":"wp_remote_retrieve_headers( ${1:\\$response} )"
"Retrieve only the response code from the raw response.":
"prefix":"wp_remote_retrieve_response_code"
"body":"wp_remote_retrieve_response_code( ${1:\\$response} )"
"Retrieve only the response message from the raw response.":
"prefix":"wp_remote_retrieve_response_message"
"body":"wp_remote_retrieve_response_message( ${1:\\$response} )"
"Returns an array of single-use query variable names that can be removed from a URL.":
"prefix":"wp_removable_query_args"
"body":"wp_removable_query_args()"
"Remove term(s) associated with a given object.":
"prefix":"wp_remove_object_terms"
"body":"wp_remove_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy} )"
"Replace characters or phrases within HTML elements only.":
"prefix":"wp_replace_in_html_tags"
"body":"wp_replace_in_html_tags( ${1:\\$haystack}${2:, \\$replace_pairs} )"
"Reschedule a recurring event.":
"prefix":"wp_reschedule_event"
"body":"wp_reschedule_event( ${1:\\$timestamp}${2:, \\$recurrence}${3:, \\$hook}${4:, \\$args = array()} )"
"After looping through a separate query, this function restores
the $post global to the current post in the main query.":
"prefix":"wp_reset_postdata"
"body":"wp_reset_postdata()"
"Destroys the previous query and sets up a new query.":
"prefix":"wp_reset_query"
"body":"wp_reset_query()"
"Resets global variables based on $_GET and $_POST":
"prefix":"wp_reset_vars"
"body":"wp_reset_vars( ${1:\\$vars} )"
"Resolve numeric slugs that collide with date permalinks.":
"prefix":"wp_resolve_numeric_slug_conflicts"
"body":"wp_resolve_numeric_slug_conflicts( ${1:\\$query_vars = array()} )"
"Prints resource hints to browsers for pre-fetching, pre-rendering
and pre-connecting to web sites.":
"prefix":"wp_resource_hints"
"body":"wp_resource_hints()"
"Restores the metadata for a given attachment.":
"prefix":"wp_restore_image"
"body":"wp_restore_image( ${1:\\$post_id} )"
"Restores a post to the specified revision.":
"prefix":"wp_restore_post_revision"
"body":"wp_restore_post_revision( ${1:\\$revision_id}${2:, \\$fields = null} )"
"Determine if revisions are enabled for a given post.":
"prefix":"wp_revisions_enabled"
"body":"wp_revisions_enabled( ${1:\\$post} )"
"Determine how many revisions to retain for a given post.":
"prefix":"wp_revisions_to_keep"
"body":"wp_revisions_to_keep( ${1:\\$post} )"
"Remove all capabilities from user.":
"prefix":"wp_revoke_user"
"body":"wp_revoke_user( ${1:\\$id} )"
"Formats text for the rich text editor.":
"prefix":"wp_richedit_pre"
"body":"wp_richedit_pre( ${1:\\$text} )"
"Retrieves the global WP_Roles instance and instantiates it if necessary.":
"prefix":"wp_roles"
"body":"wp_roles()"
"Display all RSS items in a HTML ordered list.":
"prefix":"wp_rss"
"body":"wp_rss( ${1:\\$url}${2:, \\$num_items = -1} )"
"Performs a safe (local) redirect, using wp_redirect().":
"prefix":"wp_safe_redirect"
"body":"wp_safe_redirect( ${1:\\$location}${2:, \\$status = 302} )"
"Retrieve the raw response from a safe HTTP request using the GET method.":
"prefix":"wp_safe_remote_get"
"body":"wp_safe_remote_get( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request using the HEAD method.":
"prefix":"wp_safe_remote_head"
"body":"wp_safe_remote_head( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request using the POST method.":
"prefix":"wp_safe_remote_post"
"body":"wp_safe_remote_post( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request.":
"prefix":"wp_safe_remote_request"
"body":"wp_safe_remote_request( ${1:\\$url}${2:, \\$args = array()} )"
"Get salt to add to hashes.":
"prefix":"wp_salt"
"body":"wp_salt( ${1:\\$scheme = 'auth'} )"
"Sanitizes a URL for use in a redirect.":
"prefix":"wp_sanitize_redirect"
"body":"wp_sanitize_redirect( ${1:\\$location} )"
"Saves image to post along with enqueued changes
in $_REQUEST['history']":
"prefix":"wp_save_image"
"body":"wp_save_image( ${1:\\$post_id} )"
"Saves Image to File":
"prefix":"wp_save_image_file"
"body":"wp_save_image_file( ${1:\\$filename}${2:, \\$image}${3:, \\$mime_type}${4:, \\$post_id} )"
"Save posted nav menu item data.":
"prefix":"wp_save_nav_menu_items"
"body":"wp_save_nav_menu_items( ${1:\\$menu_id}${2:, \\$menu_data = array()} )"
"Creates a revision for the current version of a post.":
"prefix":"wp_save_post_revision"
"body":"wp_save_post_revision( ${1:\\$post_id} )"
"Schedule a recurring event.":
"prefix":"wp_schedule_event"
"body":"wp_schedule_event( ${1:\\$timestamp}${2:, \\$recurrence}${3:, \\$hook}${4:, \\$args = array()} )"
"Schedules an event to run only once.":
"prefix":"wp_schedule_single_event"
"body":"wp_schedule_single_event( ${1:\\$timestamp}${2:, \\$hook}${3:, \\$args = array()} )"
"Schedule core, theme, and plugin update checks.":
"prefix":"wp_schedule_update_checks"
"body":"wp_schedule_update_checks()"
"Schedule update of the network-wide counts for the current network.":
"prefix":"wp_schedule_update_network_counts"
"body":"wp_schedule_update_network_counts()"
"Permanently delete comments or posts of any type that have held a status
of 'trash' for the number of days defined in EMPTY_TRASH_DAYS.":
"prefix":"wp_scheduled_delete"
"body":"wp_scheduled_delete()"
"Add metadata to a script.":
"prefix":"wp_script_add_data"
"body":"wp_script_add_data( ${1:\\$handle}${2:, \\$key}${3:, \\$value} )"
"Check whether a script has been added to the queue.":
"prefix":"wp_script_is"
"body":"wp_script_is( ${1:\\$handle}${2:, \\$list = 'enqueued'} )"
"Initialize $wp_scripts if it has not been set.":
"prefix":"wp_scripts"
"body":"wp_scripts()"
"Send a JSON response back to an Ajax request.":
"prefix":"wp_send_json"
"body":"wp_send_json( ${1:\\$response}${2:, \\$status_code = null} )"
"Send a JSON response back to an Ajax request, indicating failure.":
"prefix":"wp_send_json_error"
"body":"wp_send_json_error( ${1:\\$data = null}${2:, \\$status_code = null} )"
"Send a JSON response back to an Ajax request, indicating success.":
"prefix":"wp_send_json_success"
"body":"wp_send_json_success( ${1:\\$data = null}${2:, \\$status_code = null} )"
"Initiates email notifications related to the creation of new users.":
"prefix":"wp_send_new_user_notifications"
"body":"wp_send_new_user_notifications( ${1:\\$user_id}${2:, \\$notify = 'both'} )"
"Private. Set all user interface settings.":
"prefix":"wp_set_all_user_settings"
"body":"wp_set_all_user_settings( ${1:\\$user_settings} )"
"Log in a user by setting authentication cookies.":
"prefix":"wp_set_auth_cookie"
"body":"wp_set_auth_cookie( ${1:\\$user_id}${2:, \\$remember = false}${3:, \\$secure = ''}${4:, \\$token = ''} )"
"Sets the cookies used to store an unauthenticated commentator's identity. Typically used
to recall previous comments by this commentator that are still held in moderation.":
"prefix":"wp_set_comment_cookies"
"body":"wp_set_comment_cookies( ${1:\\$comment}${2:, \\$user} )"
"Sets the status of a comment.":
"prefix":"wp_set_comment_status"
"body":"wp_set_comment_status( ${1:\\$comment_id}${2:, \\$comment_status}${3:, \\$wp_error = false} )"
"Changes the current user by ID or name. wp_set_current_user":
"prefix":"wp_set_current_user"
"body":"wp_set_current_user( ${1:\\$id}${2:, \\$name = ''} )"
"Set internal encoding.":
"prefix":"wp_set_internal_encoding"
"body":"wp_set_internal_encoding()"
"Set the location of the language directory.":
"prefix":"wp_set_lang_dir"
"body":"wp_set_lang_dir()"
"Update link with the specified link categories.":
"prefix":"wp_set_link_cats"
"body":"wp_set_link_cats( ${1:\\$link_id}${2:, \\$link_categories = array()} )"
"Create Term and Taxonomy Relationships.":
"prefix":"wp_set_object_terms"
"body":"wp_set_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy}${4:, \\$append = false} )"
"Updates the user's password with a new encrypted one.":
"prefix":"wp_set_password"
"body":"wp_set_password( ${1:\\$password}${2:, \\$user_id} )"
"Set categories for a post.":
"prefix":"wp_set_post_categories"
"body":"wp_set_post_categories( ${1:\\$post_ID}${2:, \\$post_categories = array()}${3:, \\$append = false} )"
"Sets the categories that the post id belongs to.":
"prefix":"wp_set_post_cats"
"body":"wp_set_post_cats( ${1:\\$blogid = '1'}${2:, \\$post_ID}${3:, \\$post_categories = array()} )"
"Mark the post as currently being edited by the current user":
"prefix":"wp_set_post_lock"
"body":"wp_set_post_lock( ${1:\\$post_id} )"
"Set the tags for a post.":
"prefix":"wp_set_post_tags"
"body":"wp_set_post_tags( ${1:\\$post_id}${2:, \\$tags = ''}${3:, \\$append = false} )"
"Set the terms for a post.":
"prefix":"wp_set_post_terms"
"body":"wp_set_post_terms( ${1:\\$post_id}${2:, \\$tags = ''}${3:, \\$taxonomy = 'post_tag'}${4:, \\$append = false} )"
"Set the sidebar widget option to update sidebars.":
"prefix":"wp_set_sidebars_widgets"
"body":"wp_set_sidebars_widgets( ${1:\\$sidebars_widgets} )"
"Set the database table prefix and the format specifiers for database
table columns.":
"prefix":"wp_set_wpdb_vars"
"body":"wp_set_wpdb_vars()"
"Sets a cookie for a user who just logged in. This function is deprecated.":
"prefix":"wp_setcookie"
"body":"wp_setcookie( ${1:\\$username}${2:, \\$password = ''}${3:, \\$already_md5 = false}${4:, \\$home = ''}${5:, \\$siteurl = ''}${6:, \\$remember = false} )"
"Decorates a menu item object with the shared navigation menu item properties.":
"prefix":"wp_setup_nav_menu_item"
"body":"wp_setup_nav_menu_item( ${1:\\$menu_item} )"
"wp_shake_js":
"prefix":"wp_shake_js"
"body":"wp_shake_js()"
"Sends a Link: rel=shortlink header if a shortlink is defined for the current page.":
"prefix":"wp_shortlink_header"
"body":"wp_shortlink_header()"
"Injects rel=shortlink into the head if a shortlink is defined for the current page.":
"prefix":"wp_shortlink_wp_head"
"body":"wp_shortlink_wp_head()"
"Determine if global tables should be upgraded.":
"prefix":"wp_should_upgrade_global_tables"
"body":"wp_should_upgrade_global_tables()"
"Calculates the new dimensions for a downsampled image.":
"prefix":"wp_shrink_dimensions"
"body":"wp_shrink_dimensions( ${1:\\$width}${2:, \\$height}${3:, \\$wmax = 128}${4:, \\$hmax = 96} )"
"Retrieve description for a sidebar.":
"prefix":"wp_sidebar_description"
"body":"wp_sidebar_description( ${1:\\$id} )"
"Authenticates and logs a user in with 'remember' capability.":
"prefix":"wp_signon"
"body":"wp_signon( ${1:\\$credentials = array()}${2:, \\$secure_cookie = ''} )"
"WordPress autoloader for SimplePie.":
"prefix":"wp_simplepie_autoload"
"body":"wp_simplepie_autoload()"
"Display site icon meta tags.":
"prefix":"wp_site_icon"
"body":"wp_site_icon()"
"Add slashes to a string or array of strings.":
"prefix":"wp_slash"
"body":"wp_slash( ${1:\\$value} )"
"Returns the regexp for common whitespace characters.":
"prefix":"wp_spaces_regexp"
"body":"wp_spaces_regexp()"
"Marks a comment as Spam":
"prefix":"wp_spam_comment"
"body":"wp_spam_comment( ${1:\\$comment_id} )"
"Legacy escaping for HTML blocks.":
"prefix":"wp_specialchars"
"body":"wp_specialchars( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES}${3:, \\$charset = false}${4:, \\$double_encode = false} )"
"Converts a number of HTML entities into their special characters.":
"prefix":"wp_specialchars_decode"
"body":"wp_specialchars_decode( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES} )"
"WordPress implementation of PHP sprintf() with filters.":
"prefix":"wp_sprintf"
"body":"wp_sprintf( ${1:\\$pattern}${2:, \\$args} )"
"Localize list items before the rest of the content.":
"prefix":"wp_sprintf_l"
"body":"wp_sprintf_l( ${1:\\$pattern}${2:, \\$args} )"
"Defines cookie related WordPress constants wp_ssl_constants":
"prefix":"wp_ssl_constants"
"body":"wp_ssl_constants()"
"Output a HTML element with a star rating for a given rating.":
"prefix":"wp_star_rating"
"body":"wp_star_rating( ${1:\\$args = array()} )"
"Start the WordPress object cache.":
"prefix":"wp_start_object_cache"
"body":"wp_start_object_cache()"
"Convert emoji to a static img element.":
"prefix":"wp_staticize_emoji"
"body":"wp_staticize_emoji( ${1:\\$text} )"
"Convert emoji in emails into static images.":
"prefix":"wp_staticize_emoji_for_email"
"body":"wp_staticize_emoji_for_email( ${1:\\$mail} )"
"Streams image in WP_Image_Editor to browser.":
"prefix":"wp_stream_image"
"body":"wp_stream_image( ${1:\\$image}${2:, \\$mime_type}${3:, \\$post_id} )"
"Properly strip all HTML tags including script and style":
"prefix":"wp_strip_all_tags"
"body":"wp_strip_all_tags( ${1:\\$string}${2:, \\$remove_breaks = false} )"
"Add metadata to a CSS stylesheet.":
"prefix":"wp_style_add_data"
"body":"wp_style_add_data( ${1:\\$handle}${2:, \\$key}${3:, \\$value} )"
"Check whether a CSS stylesheet has been added to the queue.":
"prefix":"wp_style_is"
"body":"wp_style_is( ${1:\\$handle}${2:, \\$list = 'enqueued'} )"
"Administration Screen CSS for changing the styles.":
"prefix":"wp_style_loader_src"
"body":"wp_style_loader_src( ${1:\\$src}${2:, \\$handle} )"
"Initialize $wp_styles if it has not been set.":
"prefix":"wp_styles"
"body":"wp_styles()"
"Temporarily suspend cache additions.":
"prefix":"wp_suspend_cache_addition"
"body":"wp_suspend_cache_addition( ${1:\\$suspend = null} )"
"Suspend cache invalidation.":
"prefix":"wp_suspend_cache_invalidation"
"body":"wp_suspend_cache_invalidation( ${1:\\$suspend = true} )"
"Display tag cloud.":
"prefix":"wp_tag_cloud"
"body":"wp_tag_cloud( ${1:\\$args = ''} )"
"Defines templating related WordPress constants":
"prefix":"wp_templating_constants"
"body":"wp_templating_constants()"
"Returns a filename of a Temporary unique file.":
"prefix":"wp_tempnam"
"body":"wp_tempnam( ${1:\\$filename = ''}${2:, \\$dir = ''} )"
"Determine whether a term is shared between multiple taxonomies.":
"prefix":"wp_term_is_shared"
"body":"wp_term_is_shared( ${1:\\$term_id} )"
"Output an unordered list of checkbox input elements labelled with term names.":
"prefix":"wp_terms_checklist"
"body":"wp_terms_checklist( ${1:\\$post_id}${2:, \\$args = array()} )"
"Displays a human readable HTML representation of the difference between two strings.":
"prefix":"wp_text_diff"
"body":"wp_text_diff( ${1:\\$left_string}${2:, \\$right_string}${3:, \\$args = null} )"
"Displays update information for a theme.":
"prefix":"wp_theme_update_row"
"body":"wp_theme_update_row( ${1:\\$theme_key}${2:, \\$theme} )"
"wp_theme_update_rows":
"prefix":"wp_theme_update_rows"
"body":"wp_theme_update_rows()"
"Whether a comment should be blocked because of comment flood.":
"prefix":"wp_throttle_comment_flood"
"body":"wp_throttle_comment_flood( ${1:\\$block}${2:, \\$time_lastcomment}${3:, \\$time_newcomment} )"
"Gives a nicely-formatted list of timezone strings.":
"prefix":"wp_timezone_choice"
"body":"wp_timezone_choice( ${1:\\$selected_zone}${2:, \\$locale = null} )"
"gmt_offset modification for smart timezone handling.":
"prefix":"wp_timezone_override_offset"
"body":"wp_timezone_override_offset()"
"Check for PHP timezone support":
"prefix":"wp_timezone_supported"
"body":"wp_timezone_supported()"
"Outputs the TinyMCE editor.":
"prefix":"wp_tiny_mce"
"body":"wp_tiny_mce()"
"Display or retrieve page title for all areas of blog.":
"prefix":"wp_title"
"body":"wp_title( ${1:\\$sep = '»'}${2:, \\$display = true}${3:, \\$seplocation = ''} )"
"Display the blog title for display of the feed title.":
"prefix":"wp_title_rss"
"body":"wp_title_rss( ${1:\\$deprecated = '–'} )"
"Call hooks for when a comment status transition occurs.":
"prefix":"wp_transition_comment_status"
"body":"wp_transition_comment_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$comment} )"
"Fires actions related to the transitioning of a post's status.":
"prefix":"wp_transition_post_status"
"body":"wp_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Moves a comment to the Trash":
"prefix":"wp_trash_comment"
"body":"wp_trash_comment( ${1:\\$comment_id} )"
"Move a post or page to the Trash":
"prefix":"wp_trash_post"
"body":"wp_trash_post( ${1:\\$post_id} )"
"Moves comments for a post to the trash.":
"prefix":"wp_trash_post_comments"
"body":"wp_trash_post_comments( ${1:\\$post = null} )"
"Generates an excerpt from the content, if needed.":
"prefix":"wp_trim_excerpt"
"body":"wp_trim_excerpt( ${1:\\$text = ''} )"
"Trims text to a certain number of words.":
"prefix":"wp_trim_words"
"body":"wp_trim_words( ${1:\\$text}${2:, \\$num_words = 55}${3:, \\$more = null} )"
"Output the markup for a audio tag to be used in an Underscore template
when data.model is passed.":
"prefix":"wp_underscore_audio_template"
"body":"wp_underscore_audio_template()"
"Outputs the templates used by playlists.":
"prefix":"wp_underscore_playlist_templates"
"body":"wp_underscore_playlist_templates()"
"Output the markup for a video tag to be used in an Underscore template
when data.model is passed.":
"prefix":"wp_underscore_video_template"
"body":"wp_underscore_video_template()"
"Get a filename that is sanitized and unique for the given directory.":
"prefix":"wp_unique_filename"
"body":"wp_unique_filename( ${1:\\$dir}${2:, \\$filename}${3:, \\$unique_filename_callback = null} )"
"Computes a unique slug for the post, when given the desired slug and some post details.":
"prefix":"wp_unique_post_slug"
"body":"wp_unique_post_slug( ${1:\\$slug}${2:, \\$post_ID}${3:, \\$post_status}${4:, \\$post_type}${5:, \\$post_parent} )"
"Will make slug unique, if it isn't already.":
"prefix":"wp_unique_term_slug"
"body":"wp_unique_term_slug( ${1:\\$slug}${2:, \\$term} )"
"Turn register globals off.":
"prefix":"wp_unregister_globals"
"body":"wp_unregister_globals()"
"Remove widget from sidebar.":
"prefix":"wp_unregister_sidebar_widget"
"body":"wp_unregister_sidebar_widget( ${1:\\$id} )"
"Remove control callback for widget.":
"prefix":"wp_unregister_widget_control"
"body":"wp_unregister_widget_control( ${1:\\$id} )"
"Unschedule a previously scheduled event.":
"prefix":"wp_unschedule_event"
"body":"wp_unschedule_event( ${1:\\$timestamp}${2:, \\$hook}${3:, \\$args = array()} )"
"Unschedules all events attached to the hook.":
"prefix":"wp_unschedule_hook"
"body":"wp_unschedule_hook( ${1:\\$hook} )"
"Remove slashes from a string or array of strings.":
"prefix":"wp_unslash"
"body":"wp_unslash( ${1:\\$value} )"
"Removes a comment from the Spam":
"prefix":"wp_unspam_comment"
"body":"wp_unspam_comment( ${1:\\$comment_id} )"
"Removes a comment from the Trash":
"prefix":"wp_untrash_comment"
"body":"wp_untrash_comment( ${1:\\$comment_id} )"
"Restore a post or page from the Trash.":
"prefix":"wp_untrash_post"
"body":"wp_untrash_post( ${1:\\$post_id} )"
"Restore comments for a post from the trash.":
"prefix":"wp_untrash_post_comments"
"body":"wp_untrash_post_comments( ${1:\\$post = null} )"
"Update metadata for an attachment.":
"prefix":"wp_update_attachment_metadata"
"body":"wp_update_attachment_metadata( ${1:\\$post_id}${2:, \\$data} )"
"Aliases wp_insert_category() with minimal args.":
"prefix":"wp_update_category"
"body":"wp_update_category( ${1:\\$catarr} )"
"Updates an existing comment in the database.":
"prefix":"wp_update_comment"
"body":"wp_update_comment( ${1:\\$commentarr} )"
"Updates the comment count for post(s).":
"prefix":"wp_update_comment_count"
"body":"wp_update_comment_count( ${1:\\$post_id}${2:, \\$do_deferred = false} )"
"Updates the comment count for the post.":
"prefix":"wp_update_comment_count_now"
"body":"wp_update_comment_count_now( ${1:\\$post_id} )"
"This was once used to kick-off the Core Updater.":
"prefix":"wp_update_core"
"body":"wp_update_core()"
"Update the `custom_css` post for a given theme.":
"prefix":"wp_update_custom_css_post"
"body":"wp_update_custom_css_post( ${1:\\$css}${2:, \\$args = array()} )"
"Updates a link in the database.":
"prefix":"wp_update_link"
"body":"wp_update_link( ${1:\\$linkdata} )"
"Save the properties of a menu item or create a new one.":
"prefix":"wp_update_nav_menu_item"
"body":"wp_update_nav_menu_item( ${1:\\$menu_id}${2:, \\$menu_item_db_id}${3:, \\$menu_item_data = array()} )"
"Save the properties of a menu or create a new menu with those properties.":
"prefix":"wp_update_nav_menu_object"
"body":"wp_update_nav_menu_object( ${1:\\$menu_id}${2:, \\$menu_data = array()} )"
"Update the network-wide counts for the current network.":
"prefix":"wp_update_network_counts"
"body":"wp_update_network_counts( ${1:\\$network_id = null} )"
"Update the network-wide site count.":
"prefix":"wp_update_network_site_counts"
"body":"wp_update_network_site_counts( ${1:\\$network_id = null} )"
"Update the network-wide user count.":
"prefix":"wp_update_network_user_counts"
"body":"wp_update_network_user_counts( ${1:\\$network_id = null} )"
"This was once used to kick-off the Plugin Updater.":
"prefix":"wp_update_plugin"
"body":"wp_update_plugin()"
"Check plugin versions against the latest versions hosted on WordPress.org.":
"prefix":"wp_update_plugins"
"body":"wp_update_plugins( ${1:\\$extra_stats = array()} )"
"Update a post with new post data.":
"prefix":"wp_update_post"
"body":"wp_update_post( ${1:\\$postarr = array()}${2:, \\$wp_error = false} )"
"Update term based on arguments provided.":
"prefix":"wp_update_term"
"body":"wp_update_term( ${1:\\$term_id}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Updates the amount of terms in taxonomy.":
"prefix":"wp_update_term_count"
"body":"wp_update_term_count( ${1:\\$terms}${2:, \\$taxonomy}${3:, \\$do_deferred = false} )"
"Perform term count update immediately.":
"prefix":"wp_update_term_count_now"
"body":"wp_update_term_count_now( ${1:\\$terms}${2:, \\$taxonomy} )"
"This was once used to kick-off the Theme Updater.":
"prefix":"wp_update_theme"
"body":"wp_update_theme()"
"Check theme versions against the latest versions hosted on WordPress.org.":
"prefix":"wp_update_themes"
"body":"wp_update_themes( ${1:\\$extra_stats = array()} )"
"Update a user in the database.":
"prefix":"wp_update_user"
"body":"wp_update_user( ${1:\\$userdata} )"
"Runs WordPress Upgrade functions.":
"prefix":"wp_upgrade"
"body":"wp_upgrade()"
"Create a file in the upload folder with given content.":
"prefix":"wp_upload_bits"
"body":"wp_upload_bits( ${1:\\$name}${2:, \\$deprecated}${3:, \\$bits}${4:, \\$time = null} )"
"Get an array containing the current upload directory's path and url.":
"prefix":"wp_upload_dir"
"body":"wp_upload_dir( ${1:\\$time = null}${2:, \\$create_dir = true}${3:, \\$refresh_cache = false} )"
"Saves and restores user interface settings stored in a cookie.":
"prefix":"wp_user_settings"
"body":"wp_user_settings()"
"Toggle `$_wp_using_ext_object_cache` on and off without directly
touching global.":
"prefix":"wp_using_ext_object_cache"
"body":"wp_using_ext_object_cache( ${1:\\$using = null} )"
"Validates authentication cookie.":
"prefix":"wp_validate_auth_cookie"
"body":"wp_validate_auth_cookie( ${1:\\$cookie = ''}${2:, \\$scheme = ''} )"
"Filter/validate a variable as a boolean.":
"prefix":"wp_validate_boolean"
"body":"wp_validate_boolean( ${1:\\$var} )"
"Validates the logged-in cookie.":
"prefix":"wp_validate_logged_in_cookie"
"body":"wp_validate_logged_in_cookie( ${1:\\$user_id} )"
"Validates a URL for use in a redirect.":
"prefix":"wp_validate_redirect"
"body":"wp_validate_redirect( ${1:\\$location}${2:, \\$default = ''} )"
"Verify that correct nonce was used with time limit.":
"prefix":"wp_verify_nonce"
"body":"wp_verify_nonce( ${1:\\$nonce}${2:, \\$action = -1} )"
"Check WordPress version against the newest version.":
"prefix":"wp_version_check"
"body":"wp_version_check( ${1:\\$extra_stats = array()}${2:, \\$force_check = false} )"
"Builds the Video shortcode output.":
"prefix":"wp_video_shortcode"
"body":"wp_video_shortcode( ${1:\\$attr}${2:, \\$content = ''} )"
"Displays a welcome panel to introduce users to WordPress.":
"prefix":"wp_welcome_panel"
"body":"wp_welcome_panel()"
"Meta widget used to display the control form for a widget.":
"prefix":"wp_widget_control"
"body":"wp_widget_control( ${1:\\$sidebar_args} )"
"Retrieve description for widget.":
"prefix":"wp_widget_description"
"body":"wp_widget_description( ${1:\\$id} )"
"Display RSS widget options form.":
"prefix":"wp_widget_rss_form"
"body":"wp_widget_rss_form( ${1:\\$args}${2:, \\$inputs = null} )"
"Display the RSS entries in a list.":
"prefix":"wp_widget_rss_output"
"body":"wp_widget_rss_output( ${1:\\$rss}${2:, \\$args = array()} )"
"Process RSS feed widget data and optionally retrieve feed items.":
"prefix":"wp_widget_rss_process"
"body":"wp_widget_rss_process( ${1:\\$widget_rss}${2:, \\$check_feed = true} )"
"wp_widgets_access_body_class":
"prefix":"wp_widgets_access_body_class"
"body":"wp_widgets_access_body_class( ${1:\\$classes} )"
"Append the Widgets menu to the themes main menu.":
"prefix":"wp_widgets_add_menu"
"body":"wp_widgets_add_menu()"
"Registers all of the default WordPress widgets on startup.":
"prefix":"wp_widgets_init"
"body":"wp_widgets_init()"
"Creates a new post from the "Write Post" form using $_POST information.":
"prefix":"wp_write_post"
"body":"wp_write_post()"
"Replaces double line-breaks with paragraph elements.":
"prefix":"wpautop"
"body":"wpautop( ${1:\\$pee}${2:, \\$br = true} )"
"Activate a signup.":
"prefix":"wpmu_activate_signup"
"body":"wpmu_activate_signup( ${1:\\$key} )"
"Loads styles specific to this page.":
"prefix":"wpmu_activate_stylesheet"
"body":"wpmu_activate_stylesheet()"
"Redirect a user based on $_GET or $_POST arguments.":
"prefix":"wpmu_admin_do_redirect"
"body":"wpmu_admin_do_redirect( ${1:\\$url = ''} )"
"Adds an 'updated=true' argument to a URL.":
"prefix":"wpmu_admin_redirect_add_updated_param"
"body":"wpmu_admin_redirect_add_updated_param( ${1:\\$url = ''} )"
"Determines if the available space defined by the admin has been exceeded by the user.":
"prefix":"wpmu_checkavailablespace"
"body":"wpmu_checkavailablespace()"
"Create a site.":
"prefix":"wpmu_create_blog"
"body":"wpmu_create_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user_id}${5:, \\$meta = array()}${6:, \\$site_id = 1} )"
"Create a user.":
"prefix":"wpmu_create_user"
"body":"wpmu_create_user( ${1:\\$user_name}${2:, \\$password}${3:, \\$email} )"
"This deprecated function managed much of the site and network loading in multisite.":
"prefix":"wpmu_current_site"
"body":"wpmu_current_site()"
"Delete a site.":
"prefix":"wpmu_delete_blog"
"body":"wpmu_delete_blog( ${1:\\$blog_id}${2:, \\$drop = false} )"
"Delete a user from the network and remove from all sites.":
"prefix":"wpmu_delete_user"
"body":"wpmu_delete_user( ${1:\\$id} )"
"Deprecated functionality for getting themes allowed on a specific site.":
"prefix":"wpmu_get_blog_allowedthemes"
"body":"wpmu_get_blog_allowedthemes()"
"Logs the user email, IP, and registration date of a new site.":
"prefix":"wpmu_log_new_registrations"
"body":"wpmu_log_new_registrations( ${1:\\$blog_id}${2:, \\$user_id} )"
"Outputs the WPMU menu.":
"prefix":"wpmu_menu"
"body":"wpmu_menu()"
"Record site signup information for future activation.":
"prefix":"wpmu_signup_blog"
"body":"wpmu_signup_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user}${5:, \\$user_email}${6:, \\$meta = array()} )"
"Notify user of signup success. wpmu_signup_blog_notification":
"prefix":"wpmu_signup_blog_notification"
"body":"wpmu_signup_blog_notification( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user_login}${5:, \\$user_email}${6:, \\$key}${7:, \\$meta = array()} )"
"Prints styles for front-end Multisite signup pages":
"prefix":"wpmu_signup_stylesheet"
"body":"wpmu_signup_stylesheet()"
"Record user signup information for future activation.":
"prefix":"wpmu_signup_user"
"body":"wpmu_signup_user( ${1:\\$user}${2:, \\$user_email}${3:, \\$meta = array()} )"
"Notify user of signup success. wpmu_signup_user_notificationre":
"prefix":"wpmu_signup_user_notification"
"body":"wpmu_signup_user_notification( ${1:\\$user_login}${2:, \\$user_email}${3:, \\$key}${4:, \\$meta = array()} )"
"Update the last_updated field for the current site.":
"prefix":"wpmu_update_blogs_date"
"body":"wpmu_update_blogs_date()"
"Processes new site registrations.":
"prefix":"wpmu_validate_blog_signup"
"body":"wpmu_validate_blog_signup( ${1:\\$blogname}${2:, \\$blog_title}${3:, \\$user = ''} )"
"Sanitize and validate data required for a user sign-up.":
"prefix":"wpmu_validate_user_signup"
"body":"wpmu_validate_user_signup( ${1:\\$user_name}${2:, \\$user_email} )"
"Notify a user that their blog activation has been successful.":
"prefix":"wpmu_welcome_notification"
"body":"wpmu_welcome_notification( ${1:\\$blog_id}${2:, \\$user_id}${3:, \\$password}${4:, \\$title}${5:, \\$meta = array()} )"
"Notify a user that their account activation has been successful.":
"prefix":"wpmu_welcome_user_notification"
"body":"wpmu_welcome_user_notification( ${1:\\$user_id}${2:, \\$password}${3:, \\$meta = array()} )"
"Replaces common plain text characters into formatted entities":
"prefix":"wptexturize"
"body":"wptexturize( ${1:\\$text}${2:, \\$reset = false} )"
"Implements a logic tree to determine whether or not "7'." represents seven feet,
then converts the special char into either a prime char or a closing quote char.":
"prefix":"wptexturize_primes"
"body":"wptexturize_primes( ${1:\\$haystack}${2:, \\$needle}${3:, \\$prime}${4:, \\$open_quote}${5:, \\$close_quote} )"
"Returns the URLs for CSS files used in an iframe-sandbox'd TinyMCE media view.":
"prefix":"wpview_media_sandbox_styles"
"body":"wpview_media_sandbox_styles()"
"Calls wp_write_post() and handles the errors.":
"prefix":"write_post"
"body":"write_post()"
"Display checked checkboxes attribute for xfn microformat options.":
"prefix":"xfn_check"
"body":"xfn_check( ${1:\\$class}${2:, \\$value = ''}${3:, \\$deprecated = ''} )"
"Retrieve the post category or categories from XMLRPC XML.":
"prefix":"xmlrpc_getpostcategory"
"body":"xmlrpc_getpostcategory( ${1:\\$content} )"
"Retrieve post title from XMLRPC XML.":
"prefix":"xmlrpc_getposttitle"
"body":"xmlrpc_getposttitle( ${1:\\$content} )"
"Default filter attached to xmlrpc_pingback_error.":
"prefix":"xmlrpc_pingback_error"
"body":"xmlrpc_pingback_error( ${1:\\$ixr_error} )"
"XMLRPC XML content without title and category elements.":
"prefix":"xmlrpc_removepostdata"
"body":"xmlrpc_removepostdata( ${1:\\$content} )"
"Add leading zeros when necessary.":
"prefix":"zeroise"
"body":"zeroise( ${1:\\$number}${2:, \\$threshold} )"
| 178577 | '.source.php':
"_":
"prefix":"_"
"body":"_()"
"Retrieve the translation of $text.":
"prefix":"__"
"body":"__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Autoloader compatibility callback.":
"prefix":"__autoload"
"body":"__autoload( ${1:\\$classname} )"
"Private helper function for checked, selected, and disabled.":
"prefix":"__checked_selected_helper"
"body":"__checked_selected_helper( ${1:\\$helper}${2:, \\$current}${3:, \\$echo}${4:, \\$type} )"
"Helper function to clear the cache for number of authors.":
"prefix":"__clear_multi_author_cache"
"body":"__clear_multi_author_cache()"
"Utility version of get_option that is private to install/upgrade.":
"prefix":"__get_option"
"body":"__get_option( ${1:\\$setting} )"
"Retrieve the plural or single form based on the amount.":
"prefix":"__ngettext"
"body":"__ngettext()"
"Register plural strings in POT file, but don't translate them.":
"prefix":"__ngettext_noop"
"body":"__ngettext_noop()"
"Returns an empty array.":
"prefix":"__return_empty_array"
"body":"__return_empty_array()"
"Returns an empty string.":
"prefix":"__return_empty_string"
"body":"__return_empty_string()"
"Returns false.":
"prefix":"__return_false"
"body":"__return_false()"
"Returns null.":
"prefix":"__return_null"
"body":"__return_null()"
"Returns true.":
"prefix":"__return_true"
"body":"__return_true()"
"Returns 0.":
"prefix":"__return_zero"
"body":"__return_zero()"
"Displays an access denied message when a user tries to view a site's dashboard they
do not have access to.":
"prefix":"_access_denied_splash"
"body":"_access_denied_splash()"
"Add submenus for post types.":
"prefix":"_add_post_type_submenus"
"body":"_add_post_type_submenus()"
"Adds the (theme) 'Editor' link to the bottom of the Appearance menu.":
"prefix":"_add_themes_utility_last"
"body":"_add_themes_utility_last()"
"Default admin bar callback.":
"prefix":"_admin_bar_bump_cb"
"body":"_admin_bar_bump_cb()"
"Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post.":
"prefix":"_admin_notice_post_locked"
"body":"_admin_notice_post_locked()"
"Displays the search query.":
"prefix":"_admin_search_query"
"body":"_admin_search_query()"
"Kill WordPress ajax execution.":
"prefix":"_ajax_wp_die_handler"
"body":"_ajax_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Newline preservation help function for wpautop":
"prefix":"_autop_newline_preservation_helper"
"body":"_autop_newline_preservation_helper( ${1:\\$matches} )"
"Retrieve translated string with vertical bar context":
"prefix":"_c"
"body":"_c( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Retrieve a canonical form of the provided charset appropriate for passing to PHP
functions such as htmlspecialchars() and charset html attributes.":
"prefix":"_canonical_charset"
"body":"_canonical_charset( ${1:\\$charset} )"
"Strip close comment and close php tags from file headers used by WP.":
"prefix":"_cleanup_header_comment"
"body":"_cleanup_header_comment( ${1:\\$str} )"
"Private preg_replace callback used in image_add_caption()":
"prefix":"_cleanup_image_add_caption"
"body":"_cleanup_image_add_caption()"
"Clear the lastcommentmodified cached value when a comment status is changed.":
"prefix":"_clear_modified_cache_on_transition_comment_status"
"body":"_clear_modified_cache_on_transition_comment_status( ${1:\\$new_status}${2:, \\$old_status} )"
"Close comments on an old post. Hooked to comments_open and pings_open.":
"prefix":"_close_comments_for_old_post"
"body":"_close_comments_for_old_post( ${1:\\$open}${2:, \\$post_id} )"
"Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts.":
"prefix":"_close_comments_for_old_posts"
"body":"_close_comments_for_old_posts( ${1:\\$posts}${2:, \\$query} )"
"Retrieve the WordPress home page URL.":
"prefix":"_config_wp_home"
"body":"_config_wp_home( ${1:\\$url = ''} )"
"Retrieve the WordPress site URL.":
"prefix":"_config_wp_siteurl"
"body":"_config_wp_siteurl( ${1:\\$url = ''} )"
"Preview fix for JavaScript bug with foreign languages.":
"prefix":"_convert_urlencoded_to_entities"
"body":"_convert_urlencoded_to_entities( ${1:\\$match} )"
"_copy_dir":
"prefix":"_copy_dir"
"body":"_copy_dir( ${1:\\$from}${2:, \\$to}${3:, \\$skip_list = array()} )"
"Copy an existing image file.":
"prefix":"_copy_image_file"
"body":"_copy_image_file( ${1:\\$attachment_id} )"
"Return the cache key for wp_count_posts() based on the passed arguments.":
"prefix":"_count_posts_cache_key"
"body":"_count_posts_cache_key( ${1:\\$type = 'post'}${2:, \\$perm = ''} )"
"Crops an image resource. Internal use only.":
"prefix":"_crop_image_resource"
"body":"_crop_image_resource( ${1:\\$img}${2:, \\$x}${3:, \\$y}${4:, \\$w}${5:, \\$h} )"
"Default custom background callback.":
"prefix":"_custom_background_cb"
"body":"_custom_background_cb()"
"Registers the internal custom header and background routines.":
"prefix":"_custom_header_background_just_in_time"
"body":"_custom_header_background_just_in_time()"
"Adds CSS to hide header text for custom logo, based on Customizer setting.":
"prefix":"_custom_logo_header_styles"
"body":"_custom_logo_header_styles()"
"Perform a deep string replace operation to ensure the values in $search are no longer present":
"prefix":"_deep_replace"
"body":"_deep_replace( ${1:\\$search}${2:, \\$subject} )"
"Kills WordPress execution and display HTML message with error message.":
"prefix":"_default_wp_die_handler"
"body":"_default_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Checks an attachment being deleted to see if it's a header or background image.":
"prefix":"_delete_attachment_theme_mod"
"body":"_delete_attachment_theme_mod( ${1:\\$id} )"
"Delete the fresh site option.":
"prefix":"_delete_option_fresh_site"
"body":"_delete_option_fresh_site()"
"Mark a function argument as deprecated and inform when it has been used.":
"prefix":"_deprecated_argument"
"body":"_deprecated_argument( ${1:\\$function}${2:, \\$version}${3:, \\$message = null} )"
"Marks a constructor as deprecated and informs when it has been used.":
"prefix":"_deprecated_constructor"
"body":"_deprecated_constructor( ${1:\\$class}${2:, \\$version}${3:, \\$parent_class = ''} )"
"Mark a file as deprecated and inform when it has been used.":
"prefix":"_deprecated_file"
"body":"_deprecated_file( ${1:\\$file}${2:, \\$version}${3:, \\$replacement = null}${4:, \\$message = ''} )"
"Mark a function as deprecated and inform when it has been used.":
"prefix":"_deprecated_function"
"body":"_deprecated_function( ${1:\\$function}${2:, \\$version}${3:, \\$replacement = null} )"
"Marks a deprecated action or filter hook as deprecated and throws a notice.":
"prefix":"_deprecated_hook"
"body":"_deprecated_hook( ${1:\\$hook}${2:, \\$version}${3:, \\$replacement = null}${4:, \\$message = null} )"
"Test if the current device has the capability to upload files.":
"prefix":"_device_can_upload"
"body":"_device_can_upload()"
"Mark something as being incorrectly called.":
"prefix":"_doing_it_wrong"
"body":"_doing_it_wrong( ${1:\\$function}${2:, \\$message}${3:, \\$version} )"
"Get the post title.":
"prefix":"_draft_or_post_title"
"body":"_draft_or_post_title( ${1:\\$post} )"
"Display translated text.":
"prefix":"_e"
"body":"_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated string with gettext context.":
"prefix":"_ex"
"body":"_ex( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Retrieve URL headers and content using WP HTTP Request API.":
"prefix":"_fetch_remote_file"
"body":"_fetch_remote_file( ${1:\\$url}${2:, \\$headers = ''} )"
"Filter the SQL clauses of an attachment query to include filenames.":
"prefix":"_filter_query_attachment_filenames"
"body":"_filter_query_attachment_filenames( ${1:\\$clauses} )"
"Replace hrefs of attachment anchors with up-to-date permalinks.":
"prefix":"_fix_attachment_links"
"body":"_fix_attachment_links( ${1:\\$post} )"
"Flips an image resource. Internal use only.":
"prefix":"_flip_image_resource"
"body":"_flip_image_resource( ${1:\\$img}${2:, \\$horz}${3:, \\$vert} )"
"Hook used to schedule publication for a post marked for the future.":
"prefix":"_future_post_hook"
"body":"_future_post_hook( ${1:\\$deprecated}${2:, \\$post} )"
"Returns a list of meta keys to be (maybe) populated in wp_update_user().":
"prefix":"_get_additional_user_keys"
"body":"_get_additional_user_keys( ${1:\\$user} )"
"Retrieve the admin bar display preference of a user.":
"prefix":"_get_admin_bar_pref"
"body":"_get_admin_bar_pref( ${1:\\$context = 'front'}${2:, \\$user} )"
"Retrieve a specific component from a parsed URL array.":
"prefix":"_get_component_from_parsed_url_array"
"body":"_get_component_from_parsed_url_array( ${1:\\$url_parts}${2:, \\$component = -1} )"
"Retrieve cron info array option.":
"prefix":"_get_cron_array"
"body":"_get_cron_array()"
"Retrieves the cron lock.":
"prefix":"_get_cron_lock"
"body":"_get_cron_lock()"
"Build an object with custom-something object (post type, taxonomy) labels
out of a custom-something object":
"prefix":"_get_custom_object_labels"
"body":"_get_custom_object_labels( ${1:\\$object}${2:, \\$nohier_vs_hier_defaults} )"
"Returns drop-ins that WordPress uses.":
"prefix":"_get_dropins"
"body":"_get_dropins()"
"Get the timestamp of the last time any post was modified or published.":
"prefix":"_get_last_post_time"
"body":"_get_last_post_time( ${1:\\$timezone}${2:, \\$field}${3:, \\$post_type = 'any'} )"
"Fetch an instance of a WP_List_Table class.":
"prefix":"_get_list_table"
"body":"_get_list_table( ${1:\\$class}${2:, \\$args = array()} )"
"Retrieve the name of the metadata table for the specified object type.":
"prefix":"_get_meta_table"
"body":"_get_meta_table( ${1:\\$type} )"
"Retrieve ids that are not already present in the cache.":
"prefix":"_get_non_cached_ids"
"body":"_get_non_cached_ids( ${1:\\$object_ids}${2:, \\$cache_key} )"
"Retrieves the page permalink.":
"prefix":"_get_page_link"
"body":"_get_page_link( ${1:\\$post = false}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Gets the path to a translation file for loading a textdomain just in time.":
"prefix":"_get_path_to_translation"
"body":"_get_path_to_translation( ${1:\\$domain}${2:, \\$reset = false} )"
"Gets the path to a translation file in the languages directory for the current locale.":
"prefix":"_get_path_to_translation_from_lang_dir"
"body":"_get_path_to_translation_from_lang_dir( ${1:\\$domain} )"
"Sanitizes plugin data, optionally adds markup, optionally translates.":
"prefix":"_get_plugin_data_markup_translate"
"body":"_get_plugin_data_markup_translate()"
"Retrieve post ancestors.":
"prefix":"_get_post_ancestors"
"body":"_get_post_ancestors( ${1:\\$post} )"
"Get random header image data from registered images in theme.":
"prefix":"_get_random_header_data"
"body":"_get_random_header_data()"
"Tidies a filename for url display by the theme editor.":
"prefix":"_get_template_edit_filename"
"body":"_get_template_edit_filename( ${1:\\$fullpath}${2:, \\$containingfolder} )"
"Get the subset of $terms that are descendants of $term_id.":
"prefix":"_get_term_children"
"body":"_get_term_children( ${1:\\$term_id}${2:, \\$terms}${3:, \\$taxonomy}${4:, \\$ancestors = array()} )"
"Retrieves children of taxonomy as Term IDs.":
"prefix":"_get_term_hierarchy"
"body":"_get_term_hierarchy( ${1:\\$taxonomy} )"
"Retrieves the widget ID base value.":
"prefix":"_get_widget_id_base"
"body":"_get_widget_id_base( ${1:\\$id} )"
"Retrieve the regular expression for shortcodes.":
"prefix":"_get_wptexturize_shortcode_regex"
"body":"_get_wptexturize_shortcode_regex( ${1:\\$tagnames} )"
"Retrieve the combined regular expression for HTML and shortcodes.":
"prefix":"_get_wptexturize_split_regex"
"body":"_get_wptexturize_split_regex( ${1:\\$shortcode_regex = ''} )"
"Internal compat function to mimic hash_hmac().":
"prefix":"_hash_hmac"
"body":"_hash_hmac( ${1:\\$algo}${2:, \\$data}${3:, \\$key}${4:, \\$raw_output = false} )"
"From php.net (modified by <NAME> to behave like the native PHP5 function).":
"prefix":"_http_build_query"
"body":"_http_build_query( ${1:\\$data}${2:, \\$prefix = null}${3:, \\$sep = null}${4:, \\$key = ''}${5:, \\$urlencode = true} )"
"Image preview ratio. Internal use only.":
"prefix":"_image_get_preview_ratio"
"body":"_image_get_preview_ratio( ${1:\\$w}${2:, \\$h} )"
"This was once used to display an 'Insert into Post' button.":
"prefix":"_insert_into_post_button"
"body":"_insert_into_post_button()"
"_ipad_meta":
"prefix":"_ipad_meta"
"body":"_ipad_meta()"
"Return if a menu item is valid.":
"prefix":"_is_valid_nav_menu_item"
"body":"_is_valid_nav_menu_item( ${1:\\$item} )"
"_json_decode_object_helper":
"prefix":"_json_decode_object_helper"
"body":"_json_decode_object_helper( ${1:\\$data} )"
"Callback to add a base url to relative links in passed content.":
"prefix":"_links_add_base"
"body":"_links_add_base( ${1:\\$m} )"
"Callback to add a target attribute to all links in passed content.":
"prefix":"_links_add_target"
"body":"_links_add_target( ${1:\\$m} )"
"Outputs a single row of public meta data in the Custom Fields meta box.":
"prefix":"_list_meta_row"
"body":"_list_meta_row( ${1:\\$entry}${2:, \\$count} )"
"Retrieve the path or url of an attachment's attached file.":
"prefix":"_load_image_to_edit_path"
"body":"_load_image_to_edit_path( ${1:\\$attachment_id}${2:, \\$size = 'full'} )"
"Loads plugin and theme textdomains just-in-time.":
"prefix":"_load_textdomain_just_in_time"
"body":"_load_textdomain_just_in_time( ${1:\\$domain} )"
"Output the HTML for restoring the post data from DOM storage":
"prefix":"_local_storage_notice"
"body":"_local_storage_notice()"
"Update category structure to old pre 2.3 from new taxonomy structure.":
"prefix":"_make_cat_compat"
"body":"_make_cat_compat( ${1:\\$category} )"
"Callback to convert email address match to HTML A element.":
"prefix":"_make_email_clickable_cb"
"body":"_make_email_clickable_cb( ${1:\\$matches} )"
"Callback to convert URI match to HTML A element.":
"prefix":"_make_url_clickable_cb"
"body":"_make_url_clickable_cb( ${1:\\$matches} )"
"Callback to convert URL match to HTML A element.":
"prefix":"_make_web_ftp_clickable_cb"
"body":"_make_web_ftp_clickable_cb( ${1:\\$matches} )"
"Determines whether core should be updated.":
"prefix":"_maybe_update_core"
"body":"_maybe_update_core()"
"Check the last time plugins were run before checking plugin versions.":
"prefix":"_maybe_update_plugins"
"body":"_maybe_update_plugins()"
"Check themes versions only after a duration of time.":
"prefix":"_maybe_update_themes"
"body":"_maybe_update_themes()"
"Internal compat function to mimic mb_strlen().":
"prefix":"_mb_strlen"
"body":"_mb_strlen( ${1:\\$str}${2:, \\$encoding = null} )"
"Internal compat function to mimic mb_substr().":
"prefix":"_mb_substr"
"body":"_mb_substr( ${1:\\$str}${2:, \\$start}${3:, \\$length = null}${4:, \\$encoding = null} )"
"Set the localized direction for MCE plugin.":
"prefix":"_mce_set_direction"
"body":"_mce_set_direction( ${1:\\$mce_init} )"
"This was once used to display a media button.":
"prefix":"_media_button"
"body":"_media_button()"
"_media_states":
"prefix":"_media_states"
"body":"_media_states( ${1:\\$post} )"
"Translates and retrieves the singular or plural form based on the supplied number.":
"prefix":"_n"
"body":"_n( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$domain = 'default'} )"
"Registers plural strings in POT file, but does not translate them.":
"prefix":"_n_noop"
"body":"_n_noop( ${1:\\$singular}${2:, \\$plural}${3:, \\$domain = null} )"
"Prevents a menu item ID from being used more than once.":
"prefix":"_nav_menu_item_id_use_once"
"body":"_nav_menu_item_id_use_once( ${1:\\$id}${2:, \\$item} )"
"Wraps passed links in navigational markup.":
"prefix":"_navigation_markup"
"body":"_navigation_markup( ${1:\\$links}${2:, \\$class = 'posts-navigation'}${3:, \\$screen_reader_text = ''} )"
"Legacy version of _n(), which supports contexts.":
"prefix":"_nc"
"body":"_nc( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$domain = 'default'} )"
"Translates and retrieves the singular or plural form based on the supplied number, with gettext context.":
"prefix":"_nx"
"body":"_nx( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$context}${5:, \\$domain = 'default'} )"
"Registers plural strings with gettext context in POT file, but does not translate them.":
"prefix":"_nx_noop"
"body":"_nx_noop( ${1:\\$singular}${2:, \\$plural}${3:, \\$context}${4:, \\$domain = null} )"
"Creates an XML string from a given array.":
"prefix":"_oembed_create_xml"
"body":"_oembed_create_xml( ${1:\\$data}${2:, \\$node = null} )"
"Prepare the oembed HTML to be displayed in an RSS feed.":
"prefix":"_oembed_filter_feed_content"
"body":"_oembed_filter_feed_content( ${1:\\$content} )"
"Hooks into the REST API output to print XML instead of JSON.":
"prefix":"_oembed_rest_pre_serve_request"
"body":"_oembed_rest_pre_serve_request( ${1:\\$served}${2:, \\$result}${3:, \\$request}${4:, \\$server} )"
"Add count of children to parent count.":
"prefix":"_pad_term_counts"
"body":"_pad_term_counts( ${1:\\$terms}${2:, \\$taxonomy} )"
"Traverse and return all the nested children post names of a root page.":
"prefix":"_page_traverse_name"
"body":"_page_traverse_name( ${1:\\$page_id}${2:, \\$children}${3:, \\$result} )"
"Remove the post format prefix from the name property of the term object created by get_term().":
"prefix":"_post_format_get_term"
"body":"_post_format_get_term( ${1:\\$term} )"
"Remove the post format prefix from the name property of the term objects created by get_terms().":
"prefix":"_post_format_get_terms"
"body":"_post_format_get_terms( ${1:\\$terms}${2:, \\$taxonomies}${3:, \\$args} )"
"Filters the post format term link to remove the format prefix.":
"prefix":"_post_format_link"
"body":"_post_format_link( ${1:\\$link}${2:, \\$term}${3:, \\$taxonomy} )"
"Filters the request to allow for the format prefix.":
"prefix":"_post_format_request"
"body":"_post_format_request( ${1:\\$qvs} )"
"Remove the post format prefix from the name property of the term objects created by wp_get_object_terms().":
"prefix":"_post_format_wp_get_object_terms"
"body":"_post_format_wp_get_object_terms( ${1:\\$terms} )"
"_post_states":
"prefix":"_post_states"
"body":"_post_states( ${1:\\$post} )"
"Store or return a list of post type meta caps for map_meta_cap().":
"prefix":"_post_type_meta_capabilities"
"body":"_post_type_meta_capabilities( ${1:\\$capabilities = null} )"
"Private function to modify the current stylesheet when previewing a theme":
"prefix":"_preview_theme_stylesheet_filter"
"body":"_preview_theme_stylesheet_filter()"
"Private function to modify the current template when previewing a theme":
"prefix":"_preview_theme_template_filter"
"body":"_preview_theme_template_filter()"
"Adds any comments from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_comment_caches"
"body":"_prime_comment_caches( ${1:\\$comment_ids}${2:, \\$update_meta_cache = true} )"
"Adds any networks from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_network_caches"
"body":"_prime_network_caches( ${1:\\$network_ids} )"
"Adds any posts from the given ids to the cache that do not already exist in cache":
"prefix":"_prime_post_caches"
"body":"_prime_post_caches( ${1:\\$ids}${2:, \\$update_term_cache = true}${3:, \\$update_meta_cache = true} )"
"Adds any sites from the given ids to the cache that do not already exist in cache.":
"prefix":"_prime_site_caches"
"body":"_prime_site_caches( ${1:\\$ids} )"
"Adds any terms from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_term_caches"
"body":"_prime_term_caches( ${1:\\$term_ids}${2:, \\$update_meta_cache = true} )"
"Prints inline Emoji dection script":
"prefix":"_print_emoji_detection_script"
"body":"_print_emoji_detection_script()"
"Print scripts (internal use only)":
"prefix":"_print_scripts"
"body":"_print_scripts()"
"Print styles (internal use only)":
"prefix":"_print_styles"
"body":"_print_styles()"
"Hook to schedule pings and enclosures when a post is published.":
"prefix":"_publish_post_hook"
"body":"_publish_post_hook( ${1:\\$post_id} )"
"Redirect to the About WordPress page after a successful upgrade.":
"prefix":"_redirect_to_about_wordpress"
"body":"_redirect_to_about_wordpress( ${1:\\$new_version} )"
"Registers the form callback for a widget.":
"prefix":"_register_widget_form_callback"
"body":"_register_widget_form_callback( ${1:\\$id}${2:, \\$name}${3:, \\$form_callback}${4:, \\$options = array()} )"
"Registers the update callback for a widget.":
"prefix":"_register_widget_update_callback"
"body":"_register_widget_update_callback( ${1:\\$id_base}${2:, \\$update_callback}${3:, \\$options = array()} )"
"This was once used to move child posts to a new parent.":
"prefix":"_relocate_children"
"body":"_relocate_children( ${1:\\$old_ID}${2:, \\$new_ID} )"
"Removes arguments from a query string if they are not present in a URL
DO NOT use this in plugin code.":
"prefix":"_remove_qs_args_if_not_in_url"
"body":"_remove_qs_args_if_not_in_url( ${1:\\$query_string}${2:, \\$args_to_check}${3:, \\$url} )"
"Do not use. Removes theme support internally, ignorant of the blacklist.":
"prefix":"_remove_theme_support"
"body":"_remove_theme_support( ${1:\\$feature} )"
"Reset the page_on_front, show_on_front, and page_for_post settings when
a linked page is deleted or trashed.":
"prefix":"_reset_front_page_settings_for_post"
"body":"_reset_front_page_settings_for_post( ${1:\\$post_id} )"
"Retrieve":
"prefix":"_response_to_rss"
"body":"_response_to_rss( ${1:\\$resp} )"
"Returns an image resource. Internal use only.":
"prefix":"_rotate_image_resource"
"body":"_rotate_image_resource( ${1:\\$img}${2:, \\$angle} )"
"Internal helper function to sanitize a string from user input or from the db":
"prefix":"_sanitize_text_fields"
"body":"_sanitize_text_fields( ${1:\\$str}${2:, \\$keep_newlines = false} )"
"Callback formerly fired on the save_post hook. No longer needed.":
"prefix":"_save_post_hook"
"body":"_save_post_hook()"
"Kill WordPress execution.":
"prefix":"_scalar_wp_die_handler"
"body":"_scalar_wp_die_handler( ${1:\\$message = ''} )"
"Formerly used internally to tidy up the search terms.":
"prefix":"_search_terms_tidy"
"body":"_search_terms_tidy( ${1:\\$t} )"
"Updates the CRON option with the new CRON array.":
"prefix":"_set_cron_array"
"body":"_set_cron_array( ${1:\\$cron} )"
"Sets up the post object for preview based on the post autosave.":
"prefix":"_set_preview"
"body":"_set_preview( ${1:\\$post} )"
"Filters the latest content for preview from the post autosave.":
"prefix":"_show_post_preview"
"body":"_show_post_preview()"
"Callback to sort array by a 'name' key.":
"prefix":"_sort_name_callback"
"body":"_sort_name_callback()"
"Sort menu items by the desired key.":
"prefix":"_sort_nav_menu_items"
"body":"_sort_nav_menu_items( ${1:\\$a}${2:, \\$b} )"
"Callback to sort array by a 'Name' key.":
"prefix":"_sort_uname_callback"
"body":"_sort_uname_callback()"
"Create a new term for a term_taxonomy item that currently shares its term
with another term_taxonomy.":
"prefix":"_split_shared_term"
"body":"_split_shared_term( ${1:\\$term_id}${2:, \\$term_taxonomy_id}${3:, \\$record = true} )"
"Breaks a string into chunks by splitting at whitespace characters.":
"prefix":"_split_str_by_whitespace"
"body":"_split_str_by_whitespace( ${1:\\$string}${2:, \\$goal} )"
"Thickbox image paths for Network Admin.":
"prefix":"_thickbox_path_admin_subfolder"
"body":"_thickbox_path_admin_subfolder()"
"Hook for managing future post transitions to published.":
"prefix":"_transition_post_status"
"body":"_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Truncate a post slug.":
"prefix":"_truncate_post_slug"
"body":"_truncate_post_slug( ${1:\\$slug}${2:, \\$length = 200} )"
"This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the PclZip library.":
"prefix":"_unzip_file_pclzip"
"body":"_unzip_file_pclzip( ${1:\\$file}${2:, \\$to}${3:, \\$needed_dirs = array()} )"
"This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the ZipArchive class.":
"prefix":"_unzip_file_ziparchive"
"body":"_unzip_file_ziparchive( ${1:\\$file}${2:, \\$to}${3:, \\$needed_dirs = array()} )"
"Handler for updating the blog date when a published post is deleted.":
"prefix":"_update_blog_date_on_post_delete"
"body":"_update_blog_date_on_post_delete( ${1:\\$post_id} )"
"Handler for updating the blog date when a post is published or an already published post is changed.":
"prefix":"_update_blog_date_on_post_publish"
"body":"_update_blog_date_on_post_publish( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Will update term count based on number of objects.":
"prefix":"_update_generic_term_count"
"body":"_update_generic_term_count( ${1:\\$terms}${2:, \\$taxonomy} )"
"Will update term count based on object types of the current taxonomy.":
"prefix":"_update_post_term_count"
"body":"_update_post_term_count( ${1:\\$terms}${2:, \\$taxonomy} )"
"Handler for updating the blog posts count date when a post is deleted.":
"prefix":"_update_posts_count_on_delete"
"body":"_update_posts_count_on_delete( ${1:\\$post_id} )"
"Handler for updating the blog posts count date when a post status changes.":
"prefix":"_update_posts_count_on_transition_post_status"
"body":"_update_posts_count_on_transition_post_status( ${1:\\$new_status}${2:, \\$old_status} )"
"Update the custom taxonomies' term counts when a post's status is changed.":
"prefix":"_update_term_count_on_transition_post_status"
"body":"_update_term_count_on_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Recursively find Genericons example files in a given folder.":
"prefix":"_upgrade_422_find_genericons_files_in_folder"
"body":"_upgrade_422_find_genericons_files_in_folder( ${1:\\$directory} )"
"Cleans up Genericons example files.":
"prefix":"_upgrade_422_remove_genericons"
"body":"_upgrade_422_remove_genericons()"
"_upgrade_440_force_deactivate_incompatible_plugins":
"prefix":"_upgrade_440_force_deactivate_incompatible_plugins"
"body":"_upgrade_440_force_deactivate_incompatible_plugins()"
"Upgrade a Cron info array.":
"prefix":"_upgrade_cron_array"
"body":"_upgrade_cron_array( ${1:\\$cron} )"
"Sorts a multidimensional array by first member of each top level member":
"prefix":"_usort_by_first_member"
"body":"_usort_by_first_member( ${1:\\$a}${2:, \\$b} )"
"Sort categories by ID.":
"prefix":"_usort_terms_by_id"
"body":"_usort_terms_by_id( ${1:\\$a}${2:, \\$b} )"
"Sort categories by name.":
"prefix":"_usort_terms_by_name"
"body":"_usort_terms_by_name( ${1:\\$a}${2:, \\$b} )"
"The formatted output of a list of bookmarks.":
"prefix":"_walk_bookmarks"
"body":"_walk_bookmarks( ${1:\\$bookmarks}${2:, \\$args = ''} )"
"Helper function to add global attributes to a tag in the allowed html list.":
"prefix":"_wp_add_global_attributes"
"body":"_wp_add_global_attributes( ${1:\\$value} )"
"Instantiate the admin bar object and set it up as a global for access elsewhere.":
"prefix":"_wp_admin_bar_init"
"body":"_wp_admin_bar_init()"
"_wp_admin_html_begin":
"prefix":"_wp_admin_html_begin"
"body":"_wp_admin_html_begin()"
"Ajax handler for adding a hierarchical term.":
"prefix":"_wp_ajax_add_hierarchical_term"
"body":"_wp_ajax_add_hierarchical_term()"
"Sends back current comment total and new page links if they need to be updated.":
"prefix":"_wp_ajax_delete_comment_response"
"body":"_wp_ajax_delete_comment_response( ${1:\\$comment_id}${2:, \\$delta = -1} )"
"Prints the appropriate response to a menu quick search.":
"prefix":"_wp_ajax_menu_quick_search"
"body":"_wp_ajax_menu_quick_search( ${1:\\$request = array()} )"
"Automatically add newly published page objects to menus with that as an option.":
"prefix":"_wp_auto_add_pages_to_menu"
"body":"_wp_auto_add_pages_to_menu( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Splits a batch of shared taxonomy terms.":
"prefix":"_wp_batch_split_terms"
"body":"_wp_batch_split_terms()"
"Call the 'all' hook, which will process the functions hooked into it.":
"prefix":"_wp_call_all_hook"
"body":"_wp_call_all_hook( ${1:\\$args} )"
"Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.":
"prefix":"_wp_can_use_pcre_u"
"body":"_wp_can_use_pcre_u( ${1:\\$set = null} )"
"In order to avoid the _wp_batch_split_terms() job being accidentally removed,
check that it's still scheduled while we haven't finished splitting terms.":
"prefix":"_wp_check_for_scheduled_split_terms"
"body":"_wp_check_for_scheduled_split_terms()"
"Check default categories when a term gets split to see if any of them need to be updated.":
"prefix":"_wp_check_split_default_terms"
"body":"_wp_check_split_default_terms( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"If the term being split is a nav_menu, change associations.":
"prefix":"_wp_check_split_nav_menu_terms"
"body":"_wp_check_split_nav_menu_terms( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"Check menu items when a term gets split to see if any of them need to be updated.":
"prefix":"_wp_check_split_terms_in_menus"
"body":"_wp_check_split_terms_in_menus( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"Retrieve the link to a contributor's WordPress.org profile page.":
"prefix":"_wp_credits_add_profile_link"
"body":"_wp_credits_add_profile_link( ${1:\\$display_name}${2:, \\$username}${3:, \\$profiles} )"
"Retrieve the link to an external library used in WordPress.":
"prefix":"_wp_credits_build_object_link"
"body":"_wp_credits_build_object_link( ${1:\\$data} )"
"Filters changeset post data upon insert to ensure post_name is intact.":
"prefix":"_wp_customize_changeset_filter_insert_post_data"
"body":"_wp_customize_changeset_filter_insert_post_data( ${1:\\$post_data}${2:, \\$supplied_post_data} )"
"Includes and instantiates the WP_Customize_Manager class.":
"prefix":"_wp_customize_include"
"body":"_wp_customize_include()"
"Adds settings for the customize-loader script.":
"prefix":"_wp_customize_loader_settings"
"body":"_wp_customize_loader_settings()"
"Publish a snapshot's changes.":
"prefix":"_wp_customize_publish_changeset"
"body":"_wp_customize_publish_changeset( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$changeset_post} )"
"Outputs controls for the current dashboard widget.":
"prefix":"_wp_dashboard_control_callback"
"body":"_wp_dashboard_control_callback( ${1:\\$dashboard}${2:, \\$meta_box} )"
"Outputs a row for the Recent Comments widget.":
"prefix":"_wp_dashboard_recent_comments_row"
"body":"_wp_dashboard_recent_comments_row( ${1:\\$comment}${2:, \\$show_date = true} )"
"Delete auto-draft posts associated with the supplied changeset.":
"prefix":"_wp_delete_customize_changeset_dependent_auto_drafts"
"body":"_wp_delete_customize_changeset_dependent_auto_drafts( ${1:\\$post_id} )"
"Deletes orphaned draft menu items":
"prefix":"_wp_delete_orphaned_draft_menu_items"
"body":"_wp_delete_orphaned_draft_menu_items()"
"Callback for handling a menu item when its original object is deleted.":
"prefix":"_wp_delete_post_menu_item"
"body":"_wp_delete_post_menu_item( ${1:\\$object_id} )"
"Serves as a callback for handling a menu item when its original object is deleted.":
"prefix":"_wp_delete_tax_menu_item"
"body":"_wp_delete_tax_menu_item( ${1:\\$object_id}${2:, \\$tt_id}${3:, \\$taxonomy} )"
"If a JSON blob of navigation menu data is in POST data, expand it and inject
it into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.":
"prefix":"_wp_expand_nav_menu_post_data"
"body":"_wp_expand_nav_menu_post_data()"
"Build Unique ID for storage and retrieval.":
"prefix":"_wp_filter_build_unique_id"
"body":"_wp_filter_build_unique_id( ${1:\\$tag}${2:, \\$function}${3:, \\$priority} )"
"Filters the URL base for taxonomies.":
"prefix":"_wp_filter_taxonomy_base"
"body":"_wp_filter_taxonomy_base( ${1:\\$base} )"
"Private, for use in *_footer_scripts hooks":
"prefix":"_wp_footer_scripts"
"body":"_wp_footer_scripts()"
"Get the attachment path relative to the upload directory.":
"prefix":"_wp_get_attachment_relative_path"
"body":"_wp_get_attachment_relative_path( ${1:\\$file} )"
"Retrieves the current user object.":
"prefix":"_wp_get_current_user"
"body":"_wp_get_current_user()"
"Get the image size as array from its meta data.":
"prefix":"_wp_get_image_size_from_meta"
"body":"_wp_get_image_size_from_meta( ${1:\\$size_name}${2:, \\$image_meta} )"
"Gets the post revision version.":
"prefix":"_wp_get_post_revision_version"
"body":"_wp_get_post_revision_version( ${1:\\$revision} )"
"The old private function for setting up user contact methods.":
"prefix":"_wp_get_user_contactmethods"
"body":"_wp_get_user_contactmethods( ${1:\\$user = null} )"
"Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type,
and moving the file to the appropriate directory within the uploads directory.":
"prefix":"_wp_handle_upload"
"body":"_wp_handle_upload( ${1:\\$file}${2:, \\$overrides}${3:, \\$time}${4:, \\$action} )"
"Returns the initialized WP_Http Object":
"prefix":"_wp_http_get_object"
"body":"_wp_http_get_object()"
"Tests which editors are capable of supporting the request.":
"prefix":"_wp_image_editor_choose"
"body":"_wp_image_editor_choose( ${1:\\$args = array()} )"
"Helper function to convert hex encoded chars to ASCII":
"prefix":"_wp_iso_convert"
"body":"_wp_iso_convert( ${1:\\$match} )"
"Convert a string to UTF-8, so that it can be safely encoded to JSON.":
"prefix":"_wp_json_convert_string"
"body":"_wp_json_convert_string( ${1:\\$string} )"
"Prepares response data to be serialized to JSON.":
"prefix":"_wp_json_prepare_data"
"body":"_wp_json_prepare_data( ${1:\\$data} )"
"Perform sanity checks on data that shall be encoded to JSON.":
"prefix":"_wp_json_sanity_check"
"body":"_wp_json_sanity_check( ${1:\\$data}${2:, \\$depth} )"
"Make sure that auto-draft posts get their post_date bumped to prevent premature garbage-collection.":
"prefix":"_wp_keep_alive_customize_changeset_dependent_auto_drafts"
"body":"_wp_keep_alive_customize_changeset_dependent_auto_drafts( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Regex callback for wp_kses_decode_entities":
"prefix":"_wp_kses_decode_entities_chr"
"body":"_wp_kses_decode_entities_chr( ${1:\\$match} )"
"Regex callback for wp_kses_decode_entities()":
"prefix":"_wp_kses_decode_entities_chr_hexdec"
"body":"_wp_kses_decode_entities_chr_hexdec( ${1:\\$match} )"
"Callback for wp_kses_split.":
"prefix":"_wp_kses_split_callback"
"body":"_wp_kses_split_callback()"
"Helper function for wp_link_pages().":
"prefix":"_wp_link_page"
"body":"_wp_link_page( ${1:\\$i} )"
"Add the class property classes for the current context, if applicable.":
"prefix":"_wp_menu_item_classes_by_context"
"body":"_wp_menu_item_classes_by_context( ${1:\\$menu_items} )"
"Display menu.":
"prefix":"_wp_menu_output"
"body":"_wp_menu_output( ${1:\\$menu}${2:, \\$submenu}${3:, \\$submenu_as_parent = true} )"
"Return a MySQL expression for selecting the week number based on the start_of_week option.":
"prefix":"_wp_mysql_week"
"body":"_wp_mysql_week( ${1:\\$column} )"
"Adds custom arguments to some of the meta box object types.":
"prefix":"_wp_nav_menu_meta_box_object"
"body":"_wp_nav_menu_meta_box_object( ${1:\\$object = null} )"
"Serves as a callback for comparing objects based on count.":
"prefix":"_wp_object_count_sort_cb"
"body":"_wp_object_count_sort_cb( ${1:\\$a}${2:, \\$b} )"
"Serves as a callback for comparing objects based on name.":
"prefix":"_wp_object_name_sort_cb"
"body":"_wp_object_name_sort_cb( ${1:\\$a}${2:, \\$b} )"
"Returns the initialized WP_oEmbed object.":
"prefix":"_wp_oembed_get_object"
"body":"_wp_oembed_get_object()"
"Returns a post array ready to be inserted into the posts table as a post revision.":
"prefix":"_wp_post_revision_data"
"body":"_wp_post_revision_data( ${1:\\$post = array()}${2:, \\$autosave = false} )"
"Determines which fields of posts are to be saved in revisions.":
"prefix":"_wp_post_revision_fields"
"body":"_wp_post_revision_fields( ${1:\\$post = array()}${2:, \\$deprecated = false} )"
"Adds a 'wp-post-image' class to post thumbnails. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter"
"body":"_wp_post_thumbnail_class_filter( ${1:\\$attr} )"
"Adds '_wp_post_thumbnail_class_filter' callback to the 'wp_get_attachment_image_attributes'
filter hook. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter_add"
"body":"_wp_post_thumbnail_class_filter_add( ${1:\\$attr} )"
"Removes the '_wp_post_thumbnail_class_filter' callback from the 'wp_get_attachment_image_attributes'
filter hook. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter_remove"
"body":"_wp_post_thumbnail_class_filter_remove( ${1:\\$attr} )"
"Output HTML for the post thumbnail meta-box.":
"prefix":"_wp_post_thumbnail_html"
"body":"_wp_post_thumbnail_html( ${1:\\$thumbnail_id = null}${2:, \\$post = null} )"
"Output a notice when editing the page for posts (internal use only).":
"prefix":"_wp_posts_page_notice"
"body":"_wp_posts_page_notice()"
"Filters post thumbnail lookup to set the post thumbnail.":
"prefix":"_wp_preview_post_thumbnail_filter"
"body":"_wp_preview_post_thumbnail_filter( ${1:\\$value}${2:, \\$post_id}${3:, \\$meta_key} )"
"Filters terms lookup to set the post format.":
"prefix":"_wp_preview_terms_filter"
"body":"_wp_preview_terms_filter( ${1:\\$terms}${2:, \\$post_id}${3:, \\$taxonomy} )"
"Inserts post data into the posts table as a post revision.":
"prefix":"_wp_put_post_revision"
"body":"_wp_put_post_revision( ${1:\\$post = null}${2:, \\$autosave = false} )"
"Filter out `register_meta()` args based on a whitelist.":
"prefix":"_wp_register_meta_args_whitelist"
"body":"_wp_register_meta_args_whitelist( ${1:\\$args}${2:, \\$default_args} )"
"Return relative path to an uploaded file.":
"prefix":"_wp_relative_upload_path"
"body":"_wp_relative_upload_path( ${1:\\$path} )"
"Displays title tag with content.":
"prefix":"_wp_render_title_tag"
"body":"_wp_render_title_tag()"
"URL encode UTF-8 characters in a URL.":
"prefix":"_wp_sanitize_utf8_in_redirect"
"body":"_wp_sanitize_utf8_in_redirect( ${1:\\$matches} )"
"Helper function to output a _doing_it_wrong message when applicable.":
"prefix":"_wp_scripts_maybe_doing_it_wrong"
"body":"_wp_scripts_maybe_doing_it_wrong( ${1:\\$function} )"
"Handle sidebars config after theme change":
"prefix":"_wp_sidebars_changed"
"body":"_wp_sidebars_changed()"
"Converts a number of special characters into their HTML entities.":
"prefix":"_wp_specialchars"
"body":"_wp_specialchars( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES}${3:, \\$charset = false}${4:, \\$double_encode = false} )"
"Sort-helper for timezones.":
"prefix":"_wp_timezone_choice_usort_callback"
"body":"_wp_timezone_choice_usort_callback( ${1:\\$a}${2:, \\$b} )"
"Translate a PHP_URL_* constant to the named array keys PHP uses.":
"prefix":"_wp_translate_php_url_constant_to_key"
"body":"_wp_translate_php_url_constant_to_key( ${1:\\$constant} )"
"Rename $_POST data from form names to DB post columns.":
"prefix":"_wp_translate_postdata"
"body":"_wp_translate_postdata( ${1:\\$update = false}${2:, \\$post_data = null} )"
"Upgrade the revisions author, add the current post as a revision and set the revisions version to 1":
"prefix":"_wp_upgrade_revisions_of_post"
"body":"_wp_upgrade_revisions_of_post( ${1:\\$post}${2:, \\$revisions} )"
"A non-filtered, non-cached version of wp_upload_dir() that doesn't check the path.":
"prefix":"_wp_upload_dir"
"body":"_wp_upload_dir( ${1:\\$time = null} )"
"Search for disabled element tags. Push element to stack on tag open and pop
on tag close.":
"prefix":"_wptexturize_pushpop_element"
"body":"_wptexturize_pushpop_element( ${1:\\$text}${2:, \\$stack}${3:, \\$disabled_elements} )"
"Retrieve translated string with gettext context.":
"prefix":"_x"
"body":"_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Kill WordPress execution and display XML message with error message.":
"prefix":"_xmlrpc_wp_die_handler"
"body":"_xmlrpc_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Convert a value to non-negative integer.":
"prefix":"absint"
"body":"absint( ${1:\\$maybeint} )"
"Attempts activation of plugin in a "sandbox" and redirects on success.":
"prefix":"activate_plugin"
"body":"activate_plugin( ${1:\\$plugin}${2:, \\$redirect = ''}${3:, \\$network_wide = false}${4:, \\$silent = false} )"
"Activate multiple plugins.":
"prefix":"activate_plugins"
"body":"activate_plugins( ${1:\\$plugins}${2:, \\$redirect = ''}${3:, \\$network_wide = false}${4:, \\$silent = false} )"
"Deprecated functionality for activating a network-only plugin.":
"prefix":"activate_sitewide_plugin"
"body":"activate_sitewide_plugin()"
"Hooks a function on to a specific action.":
"prefix":"add_action"
"body":"add_action( ${1:\\$tag}${2:, \\$function_to_add}${3:, \\$priority = 10}${4:, \\$accepted_args = 1} )"
"Add a new option for a given blog id.":
"prefix":"add_blog_option"
"body":"add_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$value} )"
"Adds an index to a specified table.":
"prefix":"add_clean_index"
"body":"add_clean_index( ${1:\\$table}${2:, \\$index} )"
"Add meta data field to a comment.":
"prefix":"add_comment_meta"
"body":"add_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Add submenu page to the Comments main menu.":
"prefix":"add_comments_page"
"body":"add_comments_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add contextual help text for a page.":
"prefix":"add_contextual_help"
"body":"add_contextual_help( ${1:\\$screen}${2:, \\$help} )"
"add_cssclass":
"prefix":"add_cssclass"
"body":"add_cssclass( ${1:\\$add}${2:, \\$class} )"
"Add callbacks for background image display.":
"prefix":"add_custom_background"
"body":"add_custom_background( ${1:\\$wp_head_callback = ''}${2:, \\$admin_head_callback = ''}${3:, \\$admin_preview_callback = ''} )"
"Add callbacks for image header display.":
"prefix":"add_custom_image_header"
"body":"add_custom_image_header( ${1:\\$wp_head_callback}${2:, \\$admin_head_callback}${3:, \\$admin_preview_callback = ''} )"
"Add submenu page to the Dashboard main menu.":
"prefix":"add_dashboard_page"
"body":"add_dashboard_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add callback for custom TinyMCE editor stylesheets.":
"prefix":"add_editor_style"
"body":"add_editor_style( ${1:\\$stylesheet = 'editor-style.css'} )"
"Add a user to a blog based on details from maybe_add_existing_user_to_blog().":
"prefix":"add_existing_user_to_blog"
"body":"add_existing_user_to_blog( ${1:\\$details = false} )"
"Add a new feed type like /atom1/.":
"prefix":"add_feed"
"body":"add_feed( ${1:\\$feedname}${2:, \\$function} )"
"Hook a function or method to a specific filter action.":
"prefix":"add_filter"
"body":"add_filter( ${1:\\$tag}${2:, \\$function_to_add}${3:, \\$priority = 10}${4:, \\$accepted_args = 1} )"
"Register a new image size.":
"prefix":"add_image_size"
"body":"add_image_size( ${1:\\$name}${2:, \\$width}${3:, \\$height}${4:, \\$crop = false} )"
"Add a link to using values provided in $_POST.":
"prefix":"add_link"
"body":"add_link()"
"Add submenu page to the Links main menu.":
"prefix":"add_links_page"
"body":"add_links_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Walks the array while sanitizing the contents.":
"prefix":"add_magic_quotes"
"body":"add_magic_quotes( ${1:\\$array} )"
"Add submenu page to the Tools main menu.":
"prefix":"add_management_page"
"body":"add_management_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add submenu page to the Media main menu.":
"prefix":"add_media_page"
"body":"add_media_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"add_menu_classes":
"prefix":"add_menu_classes"
"body":"add_menu_classes( ${1:\\$menu} )"
"Add a top-level menu page.":
"prefix":"add_menu_page"
"body":"add_menu_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''}${7:, \\$position = null} )"
"Add post meta data defined in $_POST superglobal for post with given ID.":
"prefix":"add_meta"
"body":"add_meta( ${1:\\$post_ID} )"
"Adds a meta box to one or more screens.":
"prefix":"add_meta_box"
"body":"add_meta_box( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$screen = null}${5:, \\$context = 'advanced'}${6:, \\$priority = 'default'}${7:, \\$callback_args = null} )"
"Add metadata for the specified object.":
"prefix":"add_metadata"
"body":"add_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value}${5:, \\$unique = false} )"
"Add a new network option.":
"prefix":"add_network_option"
"body":"add_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$value} )"
"Adds a newly created user to the appropriate blog":
"prefix":"add_new_user_to_blog"
"body":"add_new_user_to_blog( ${1:\\$user_id}${2:, \\$password}${3:, \\$meta} )"
"Add a top-level menu page in the 'objects' section.":
"prefix":"add_object_page"
"body":"add_object_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''} )"
"Add a new option.":
"prefix":"add_option"
"body":"add_option( ${1:\\$option}${2:, \\$value = ''}${3:, \\$deprecated = ''}${4:, \\$autoload = 'yes'} )"
"Register a setting and its sanitization callback":
"prefix":"add_option_update_handler"
"body":"add_option_update_handler( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$sanitize_callback = ''} )"
"Adds an array of options to the options whitelist.":
"prefix":"add_option_whitelist"
"body":"add_option_whitelist( ${1:\\$new_options}${2:, \\$options = ''} )"
"Add submenu page to the Settings main menu.":
"prefix":"add_options_page"
"body":"add_options_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add submenu page to the Pages main menu.":
"prefix":"add_pages_page"
"body":"add_pages_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add permalink structure.":
"prefix":"add_permastruct"
"body":"add_permastruct( ${1:\\$name}${2:, \\$struct}${3:, \\$args = array()} )"
"Add a URL to those already pinged.":
"prefix":"add_ping"
"body":"add_ping( ${1:\\$post_id}${2:, \\$uri} )"
"Add submenu page to the Plugins main menu.":
"prefix":"add_plugins_page"
"body":"add_plugins_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add meta data field to a post.":
"prefix":"add_post_meta"
"body":"add_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Register support of certain features for a post type.":
"prefix":"add_post_type_support"
"body":"add_post_type_support( ${1:\\$post_type}${2:, \\$feature} )"
"Add submenu page to the Posts main menu.":
"prefix":"add_posts_page"
"body":"add_posts_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Retrieves a modified URL query string.":
"prefix":"add_query_arg"
"body":"add_query_arg( ${1:\\$key}${2:, \\$value}${3:, \\$url} )"
"Add an endpoint, like /trackback/.":
"prefix":"add_rewrite_endpoint"
"body":"add_rewrite_endpoint( ${1:\\$name}${2:, \\$places}${3:, \\$query_var = true} )"
"Adds a rewrite rule that transforms a URL structure to a set of query vars.":
"prefix":"add_rewrite_rule"
"body":"add_rewrite_rule( ${1:\\$regex}${2:, \\$query}${3:, \\$after = 'bottom'} )"
"Add a new rewrite tag (like %postname%).":
"prefix":"add_rewrite_tag"
"body":"add_rewrite_tag( ${1:\\$tag}${2:, \\$regex}${3:, \\$query = ''} )"
"Add role, if it does not exist.":
"prefix":"add_role"
"body":"add_role( ${1:\\$role}${2:, \\$display_name}${3:, \\$capabilities = array()} )"
"Register and configure an admin screen option":
"prefix":"add_screen_option"
"body":"add_screen_option( ${1:\\$option}${2:, \\$args = array()} )"
"Register a settings error to be displayed to the user":
"prefix":"add_settings_error"
"body":"add_settings_error( ${1:\\$setting}${2:, \\$code}${3:, \\$message}${4:, \\$type = 'error'} )"
"Add a new field to a section of a settings page":
"prefix":"add_settings_field"
"body":"add_settings_field( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$page}${5:, \\$section = 'default'}${6:, \\$args = array()} )"
"Add a new section to a settings page.":
"prefix":"add_settings_section"
"body":"add_settings_section( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$page} )"
"Add hook for shortcode tag.":
"prefix":"add_shortcode"
"body":"add_shortcode( ${1:\\$tag}${2:, \\$func} )"
"Add a new option for the current network.":
"prefix":"add_site_option"
"body":"add_site_option( ${1:\\$option}${2:, \\$value} )"
"Add a submenu page.":
"prefix":"add_submenu_page"
"body":"add_submenu_page( ${1:\\$parent_slug}${2:, \\$page_title}${3:, \\$menu_title}${4:, \\$capability}${5:, \\$menu_slug}${6:, \\$function = ''} )"
"Adds metadata to a term.":
"prefix":"add_term_meta"
"body":"add_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Add submenu page to the Appearance main menu.":
"prefix":"add_theme_page"
"body":"add_theme_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Registers theme support for a given feature.":
"prefix":"add_theme_support"
"body":"add_theme_support( ${1:\\$feature}${2:, \\$args,...} )"
"Enqueues the default ThickBox js and css.":
"prefix":"add_thickbox"
"body":"add_thickbox()"
"Creates a new user from the "Users" form using $_POST information.":
"prefix":"add_user"
"body":"add_user()"
"Add meta data field to a user.":
"prefix":"add_user_meta"
"body":"add_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Adds a user to a blog.":
"prefix":"add_user_to_blog"
"body":"add_user_to_blog( ${1:\\$blog_id}${2:, \\$user_id}${3:, \\$role} )"
"Add submenu page to the Users/Profile main menu.":
"prefix":"add_users_page"
"body":"add_users_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add a top-level menu page in the 'utility' section.":
"prefix":"add_utility_page"
"body":"add_utility_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''} )"
"Adds slashes to escape strings.":
"prefix":"addslashes_gpc"
"body":"addslashes_gpc( ${1:\\$gpc} )"
"Displays next or previous image link that has the same post parent.":
"prefix":"adjacent_image_link"
"body":"adjacent_image_link( ${1:\\$prev = true}${2:, \\$size = 'thumbnail'}${3:, \\$text = false} )"
"Displays the adjacent post link.":
"prefix":"adjacent_post_link"
"body":"adjacent_post_link( ${1:\\$format}${2:, \\$link}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$previous = true}${6:, \\$taxonomy = 'category'} )"
"Displays the relational links for the posts adjacent to the current post.":
"prefix":"adjacent_posts_rel_link"
"body":"adjacent_posts_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Displays relational links for the posts adjacent to the current post for single post pages.":
"prefix":"adjacent_posts_rel_link_wp_head"
"body":"adjacent_posts_rel_link_wp_head()"
"Display the default admin color scheme picker (Used in user-edit.php)":
"prefix":"admin_color_scheme_picker"
"body":"admin_color_scheme_picker( ${1:\\$user_id} )"
"admin_created_user_email":
"prefix":"admin_created_user_email"
"body":"admin_created_user_email( ${1:\\$text} )"
"Retrieves the URL to the admin area for the current site.":
"prefix":"admin_url"
"body":"admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Allow subdirectory install.":
"prefix":"allow_subdirectory_install"
"body":"allow_subdirectory_install()"
"Allow subdomain install":
"prefix":"allow_subdomain_install"
"body":"allow_subdomain_install()"
"Whitelists allowed redirect hosts for safe HTTP requests as well.":
"prefix":"allowed_http_request_hosts"
"body":"allowed_http_request_hosts( ${1:\\$is_external}${2:, \\$host} )"
"Display all of the allowed tags in HTML format with attributes.":
"prefix":"allowed_tags"
"body":"allowed_tags()"
"Converts email addresses characters to HTML entities to block spam bots.":
"prefix":"antispambot"
"body":"antispambot( ${1:\\$email_address}${2:, \\$hex_encoding} )"
"Does the specified module exist in the Apache config?":
"prefix":"apache_mod_loaded"
"body":"apache_mod_loaded( ${1:\\$mod}${2:, \\$default = false} )"
"Call the functions added to a filter hook.":
"prefix":"apply_filters"
"body":"apply_filters( ${1:\\$tag}${2:, \\$value}${3:, \\$var,...} )"
"Fires functions attached to a deprecated filter hook.":
"prefix":"apply_filters_deprecated"
"body":"apply_filters_deprecated( ${1:\\$tag}${2:, \\$args}${3:, \\$version}${4:, \\$replacement = false}${5:, \\$message = null} )"
"Execute functions hooked on a specific filter hook, specifying arguments in an array.":
"prefix":"apply_filters_ref_array"
"body":"apply_filters_ref_array( ${1:\\$tag}${2:, \\$args} )"
"PHP-agnostic version of {@link array_replace_recursive()}.":
"prefix":"array_replace_recursive"
"body":"array_replace_recursive( ${1:\\$base = array()}${2:, \\$replacements = array()} )"
"Display the atom enclosure for the current post.":
"prefix":"atom_enclosure"
"body":"atom_enclosure()"
"Displays Site Icon in atom feeds.":
"prefix":"atom_site_icon"
"body":"atom_site_icon()"
"Display fields for ID3 data":
"prefix":"attachment_id3_data_meta_box"
"body":"attachment_id3_data_meta_box( ${1:\\$post} )"
"Display attachment submit form fields.":
"prefix":"attachment_submit_meta_box"
"body":"attachment_submit_meta_box( ${1:\\$post} )"
"Displays non-editable attachment metadata in the publish meta box.":
"prefix":"attachment_submitbox_metadata"
"body":"attachment_submitbox_metadata()"
"Tries to convert an attachment URL into a post ID.":
"prefix":"attachment_url_to_postid"
"body":"attachment_url_to_postid( ${1:\\$url} )"
"Escaping for HTML attributes":
"prefix":"attribute_escape"
"body":"attribute_escape( ${1:\\$text} )"
"Checks if a user is logged in, if not it redirects them to the login page.":
"prefix":"auth_redirect"
"body":"auth_redirect()"
"Whether author of supplied post has capability or role.":
"prefix":"author_can"
"body":"author_can( ${1:\\$post}${2:, \\$capability} )"
"Enable/disable automatic general feed link outputting.":
"prefix":"automatic_feed_links"
"body":"automatic_feed_links( ${1:\\$add = true} )"
"Avoids a collision between a site slug and a permalink slug.":
"prefix":"avoid_blog_page_permalink_collision"
"body":"avoid_blog_page_permalink_collision( ${1:\\$data}${2:, \\$postarr} )"
"Display background color value.":
"prefix":"background_color"
"body":"background_color()"
"Display background image path.":
"prefix":"background_image"
"body":"background_image()"
"Adds backslashes before letters and before a number at the start of a string.":
"prefix":"backslashit"
"body":"backslashit( ${1:\\$string} )"
"Balances tags if forced to, or if the 'use_balanceTags' option is set to true.":
"prefix":"balancetags"
"body":"balancetags( ${1:\\$text}${2:, \\$force = false} )"
"Remove last item on a pipe-delimited string.":
"prefix":"before_last_bar"
"body":"before_last_bar( ${1:\\$string} )"
"Displays information about the current site.":
"prefix":"bloginfo"
"body":"bloginfo( ${1:\\$show = ''} )"
"Display RSS container for the bloginfo function.":
"prefix":"bloginfo_rss"
"body":"bloginfo_rss( ${1:\\$show = ''} )"
"Display the classes for the body element.":
"prefix":"body_class"
"body":"body_class( ${1:\\$class = ''} )"
"Whether input is yes or no.":
"prefix":"bool_from_yn"
"body":"bool_from_yn( ${1:\\$yn} )"
"Build URL query based on an associative and, or indexed array.":
"prefix":"build_query"
"body":"build_query( ${1:\\$data} )"
"Process the post data for the bulk editing of posts.":
"prefix":"bulk_edit_posts"
"body":"bulk_edit_posts( ${1:\\$post_data = null} )"
"Set the headers for caching for 10 days with JavaScript content type.":
"prefix":"cache_javascript_headers"
"body":"cache_javascript_headers()"
"Retrieve info for user lists to prevent multiple queries by get_userdata()":
"prefix":"cache_users"
"body":"cache_users( ${1:\\$user_ids} )"
"Get number of days since the start of the week.":
"prefix":"calendar_week_mod"
"body":"calendar_week_mod( ${1:\\$num} )"
"Whether or not we can edit this network from this page.":
"prefix":"can_edit_network"
"body":"can_edit_network( ${1:\\$site_id} )"
"Display HTML content for cancel comment reply link.":
"prefix":"cancel_comment_reply_link"
"body":"cancel_comment_reply_link( ${1:\\$text = ''} )"
"Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).":
"prefix":"capital_p_dangit"
"body":"capital_p_dangit( ${1:\\$text} )"
"Check if a category is an ancestor of another category.":
"prefix":"cat_is_ancestor_of"
"body":"cat_is_ancestor_of( ${1:\\$cat1}${2:, \\$cat2} )"
"Retrieve category description.":
"prefix":"category_description"
"body":"category_description( ${1:\\$category} )"
"Check whether a category exists.":
"prefix":"category_exists"
"body":"category_exists( ${1:\\$cat_name}${2:, \\$parent = null} )"
"Makes sure that a user was referred from another admin page.":
"prefix":"check_admin_referer"
"body":"check_admin_referer( ${1:\\$action = -1}${2:, \\$query_arg = '_wpnonce'} )"
"Verifies the Ajax request to prevent processing requests external of the blog.":
"prefix":"check_ajax_referer"
"body":"check_ajax_referer( ${1:\\$action = -1}${2:, \\$query_arg = false}${3:, \\$die = true} )"
"Publish future post and make sure post ID has future post status.":
"prefix":"check_and_publish_future_post"
"body":"check_and_publish_future_post( ${1:\\$post_id} )"
"Check column matches criteria.":
"prefix":"check_column"
"body":"check_column( ${1:\\$table_name}${2:, \\$col_name}${3:, \\$col_type}${4:, \\$is_null = null}${5:, \\$key = null}${6:, \\$default = null}${7:, \\$extra = null} )"
"Check whether a comment passes internal checks to be allowed to add.":
"prefix":"check_comment"
"body":"check_comment( ${1:\\$author}${2:, \\$email}${3:, \\$url}${4:, \\$comment}${5:, \\$user_ip}${6:, \\$user_agent}${7:, \\$comment_type} )"
"Hooks WP's native database-based comment-flood check.":
"prefix":"check_comment_flood_db"
"body":"check_comment_flood_db()"
"Checks if the current user has permissions to import new users.":
"prefix":"check_import_new_users"
"body":"check_import_new_users( ${1:\\$permission} )"
"Retrieves a user row based on password reset key and login":
"prefix":"check_password_reset_key"
"body":"check_password_reset_key( ${1:\\$key}${2:, \\$login} )"
"Checks if a theme has been changed and runs 'after_switch_theme' hook on the next WP load.":
"prefix":"check_theme_switched"
"body":"check_theme_switched()"
"Check an array of MIME types against a whitelist.":
"prefix":"check_upload_mimes"
"body":"check_upload_mimes( ${1:\\$mimes} )"
"Determine if uploaded file exceeds space quota.":
"prefix":"check_upload_size"
"body":"check_upload_size( ${1:\\$file} )"
"Outputs the html checked attribute.":
"prefix":"checked"
"body":"checked( ${1:\\$checked}${2:, \\$current = true}${3:, \\$echo = true} )"
"Handles the display of choosing a user's primary site.":
"prefix":"choose_primary_blog"
"body":"choose_primary_blog()"
"Will clean the attachment in the cache.":
"prefix":"clean_attachment_cache"
"body":"clean_attachment_cache( ${1:\\$id}${2:, \\$clean_terms = false} )"
"Clean the blog cache":
"prefix":"clean_blog_cache"
"body":"clean_blog_cache( ${1:\\$blog} )"
"Deletes the bookmark cache.":
"prefix":"clean_bookmark_cache"
"body":"clean_bookmark_cache( ${1:\\$bookmark_id} )"
"Remove the category cache data based on ID.":
"prefix":"clean_category_cache"
"body":"clean_category_cache( ${1:\\$id} )"
"Removes a comment from the object cache.":
"prefix":"clean_comment_cache"
"body":"clean_comment_cache( ${1:\\$ids} )"
"Removes a network from the object cache.":
"prefix":"clean_network_cache"
"body":"clean_network_cache( ${1:\\$ids} )"
"Removes the taxonomy relationship to terms from the cache.":
"prefix":"clean_object_term_cache"
"body":"clean_object_term_cache( ${1:\\$object_ids}${2:, \\$object_type} )"
"Will clean the page in the cache.":
"prefix":"clean_page_cache"
"body":"clean_page_cache( ${1:\\$id} )"
"Will clean the post in the cache.":
"prefix":"clean_post_cache"
"body":"clean_post_cache( ${1:\\$post} )"
"Accepts matches array from preg_replace_callback in wpautop() or a string.":
"prefix":"clean_pre"
"body":"clean_pre( ${1:\\$matches} )"
"Cleans the site details cache for a site.":
"prefix":"clean_site_details_cache"
"body":"clean_site_details_cache( ${1:\\$site_id} )"
"Clean the caches for a taxonomy.":
"prefix":"clean_taxonomy_cache"
"body":"clean_taxonomy_cache( ${1:\\$taxonomy} )"
"Will remove all of the term ids from the cache.":
"prefix":"clean_term_cache"
"body":"clean_term_cache( ${1:\\$ids}${2:, \\$taxonomy = ''}${3:, \\$clean_taxonomy = true} )"
"Checks and cleans a URLr":
"prefix":"clean_url"
"body":"clean_url( ${1:\\$url}${2:, \\$protocols = null}${3:, \\$context = 'display'} )"
"Clean all user caches":
"prefix":"clean_user_cache"
"body":"clean_user_cache( ${1:\\$user} )"
"Deprecated functionality to clear the global post cache.":
"prefix":"clear_global_post_cache"
"body":"clear_global_post_cache( ${1:\\$post_id} )"
"Adds JavaScript required to make CodePress work on the theme/plugin editors.":
"prefix":"codepress_footer_js"
"body":"codepress_footer_js()"
"Determines the language to use for CodePress syntax highlighting.":
"prefix":"codepress_get_lang"
"body":"codepress_get_lang( ${1:\\$filename} )"
"Displays the author of the current comment.":
"prefix":"comment_author"
"body":"comment_author( ${1:\\$comment_ID} )"
"Display the email of the author of the current global $comment.":
"prefix":"comment_author_email"
"body":"comment_author_email( ${1:\\$comment_ID} )"
"Display the html email link to the author of the current comment.":
"prefix":"comment_author_email_link"
"body":"comment_author_email_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment = null} )"
"Display the IP address of the author of the current comment.":
"prefix":"comment_author_ip"
"body":"comment_author_ip( ${1:\\$comment_ID} )"
"Display the html link to the url of the author of the current comment.":
"prefix":"comment_author_link"
"body":"comment_author_link( ${1:\\$comment_ID} )"
"Display the current comment author in the feed.":
"prefix":"comment_author_rss"
"body":"comment_author_rss()"
"Display the url of the author of the current comment.":
"prefix":"comment_author_url"
"body":"comment_author_url( ${1:\\$comment_ID} )"
"Displays the HTML link of the url of the author of the current comment.":
"prefix":"comment_author_url_link"
"body":"comment_author_url_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment} )"
"Generates semantic classes for each comment element.":
"prefix":"comment_class"
"body":"comment_class( ${1:\\$class = ''}${2:, \\$comment = null}${3:, \\$post_id = null}${4:, \\$echo = true} )"
"Display the comment date of the current comment.":
"prefix":"comment_date"
"body":"comment_date( ${1:\\$d = ''}${2:, \\$comment_ID} )"
"Display the excerpt of the current comment.":
"prefix":"comment_excerpt"
"body":"comment_excerpt( ${1:\\$comment_ID} )"
"Determine if a comment exists based on author and date.":
"prefix":"comment_exists"
"body":"comment_exists( ${1:\\$comment_author}${2:, \\$comment_date}${3:, \\$timezone = 'blog'} )"
"Display error message at bottom of comments.":
"prefix":"comment_footer_die"
"body":"comment_footer_die( ${1:\\$msg} )"
"Outputs a complete commenting form for use within a template.":
"prefix":"comment_form"
"body":"comment_form( ${1:\\$args = array()}${2:, \\$post_id = null} )"
"Display text based on comment reply status.":
"prefix":"comment_form_title"
"body":"comment_form_title( ${1:\\$noreplytext = false}${2:, \\$replytext = false}${3:, \\$linktoparent = true} )"
"Display the feed GUID for the current comment.":
"prefix":"comment_guid"
"body":"comment_guid( ${1:\\$comment_id = null} )"
"Display the comment id of the current comment.":
"prefix":"comment_id"
"body":"comment_id()"
"Output hidden input HTML for replying to comments.":
"prefix":"comment_id_fields"
"body":"comment_id_fields( ${1:\\$id} )"
"Display the link to the comments.":
"prefix":"comment_link"
"body":"comment_link( ${1:\\$comment = null} )"
"Displays the HTML content for reply to comment link.":
"prefix":"comment_reply_link"
"body":"comment_reply_link( ${1:\\$args = array()}${2:, \\$comment = null}${3:, \\$post = null} )"
"Display the text of the current comment.":
"prefix":"comment_text"
"body":"comment_text( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Display the current comment content for use in the feeds.":
"prefix":"comment_text_rss"
"body":"comment_text_rss()"
"Display the comment time of the current comment.":
"prefix":"comment_time"
"body":"comment_time( ${1:\\$d = ''} )"
"Display the comment type of the current comment.":
"prefix":"comment_type"
"body":"comment_type( ${1:\\$commenttxt = false}${2:, \\$trackbacktxt = false}${3:, \\$pingbacktxt = false} )"
"Display the link to the current post comments.":
"prefix":"comments_link"
"body":"comments_link( ${1:\\$deprecated = ''}${2:, \\$deprecated_2 = ''} )"
"Outputs the link to the comments for the current post in an xml safe way":
"prefix":"comments_link_feed"
"body":"comments_link_feed()"
"Display the language string for the number of comments the current post has.":
"prefix":"comments_number"
"body":"comments_number( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false}${4:, \\$deprecated = ''} )"
"Whether the current post is open for comments.":
"prefix":"comments_open"
"body":"comments_open( ${1:\\$post_id = null} )"
"Displays the link to the comments for the current post ID.":
"prefix":"comments_popup_link"
"body":"comments_popup_link( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false}${4:, \\$css_class = ''}${5:, \\$none = false} )"
"Display the JS popup script to show a comment.":
"prefix":"comments_popup_script"
"body":"comments_popup_script()"
"Return link to the post RSS feed.":
"prefix":"comments_rss"
"body":"comments_rss()"
"Print RSS comment feed link.":
"prefix":"comments_rss_link"
"body":"comments_rss_link( ${1:\\$link_text = 'Comments RSS'} )"
"Load the comment template specified in $file.":
"prefix":"comments_template"
"body":"comments_template( ${1:\\$file = '/comments.php'}${2:, \\$separate_comments = false} )"
"Test support for compressing JavaScript from PHP":
"prefix":"compression_test"
"body":"compression_test()"
"Confirm a new site signup.":
"prefix":"confirm_another_blog_signup"
"body":"confirm_another_blog_signup( ${1:\\$domain}${2:, \\$path}${3:, \\$blog_title}${4:, \\$user_name}${5:, \\$user_email = ''}${6:, \\$meta = array()}${7:, \\$blog_id} )"
"New site signup confirmation":
"prefix":"confirm_blog_signup"
"body":"confirm_blog_signup( ${1:\\$domain}${2:, \\$path}${3:, \\$blog_title}${4:, \\$user_name = ''}${5:, \\$user_email = ''}${6:, \\$meta = array()} )"
"confirm_delete_users":
"prefix":"confirm_delete_users"
"body":"confirm_delete_users( ${1:\\$users} )"
"New user signup confirmation":
"prefix":"confirm_user_signup"
"body":"confirm_user_signup( ${1:\\$user_name}${2:, \\$user_email} )"
"Retrieves the URL to the content directory.":
"prefix":"content_url"
"body":"content_url( ${1:\\$path = ''} )"
"Converts lone & characters into `&#038;` (a.k.a. `&amp;`)":
"prefix":"convert_chars"
"body":"convert_chars( ${1:\\$content}${2:, \\$deprecated = ''} )"
"Converts invalid Unicode references range to valid range.":
"prefix":"convert_invalid_entities"
"body":"convert_invalid_entities( ${1:\\$content} )"
"Convert text equivalent of smilies to images.":
"prefix":"convert_smilies"
"body":"convert_smilies( ${1:\\$text} )"
"Convert a screen string to a screen object":
"prefix":"convert_to_screen"
"body":"convert_to_screen( ${1:\\$hook_name} )"
"Copies a directory from one location to another via the WordPress Filesystem Abstraction.":
"prefix":"copy_dir"
"body":"copy_dir( ${1:\\$from}${2:, \\$to}${3:, \\$skip_list = array()} )"
"core_update_footer":
"prefix":"core_update_footer"
"body":"core_update_footer( ${1:\\$msg = ''} )"
"Display upgrade WordPress for downloading latest or upgrading automatically form.":
"prefix":"core_upgrade_preamble"
"body":"core_upgrade_preamble()"
"Number of posts written by a list of users.":
"prefix":"count_many_users_posts"
"body":"count_many_users_posts( ${1:\\$users}${2:, \\$post_type = 'post'}${3:, \\$public_only = false} )"
"Number of posts user has written.":
"prefix":"count_user_posts"
"body":"count_user_posts( ${1:\\$userid}${2:, \\$post_type = 'post'}${3:, \\$public_only = false} )"
"Count number of users who have each of the user roles.":
"prefix":"count_users"
"body":"count_users( ${1:\\$strategy = 'time'} )"
"Create an empty blog.":
"prefix":"create_empty_blog"
"body":"create_empty_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$weblog_title}${4:, \\$site_id = 1} )"
"Creates the initial post types when 'init' action is fired.":
"prefix":"create_initial_post_types"
"body":"create_initial_post_types()"
"Registers default REST API routes.":
"prefix":"create_initial_rest_routes"
"body":"create_initial_rest_routes()"
"Creates the initial taxonomies.":
"prefix":"create_initial_taxonomies"
"body":"create_initial_taxonomies()"
"An alias of wp_create_user().":
"prefix":"create_user"
"body":"create_user( ${1:\\$username}${2:, \\$password}${3:, \\$email} )"
"Retrieve the name of the current action.":
"prefix":"current_action"
"body":"current_action()"
"Retrieve the name of the current filter or action.":
"prefix":"current_filter"
"body":"current_filter()"
"Retrieves information on the current active theme.":
"prefix":"current_theme_info"
"body":"current_theme_info()"
"Checks a theme's support for a given feature":
"prefix":"current_theme_supports"
"body":"current_theme_supports( ${1:\\$feature} )"
"Retrieve the current time based on specified type.":
"prefix":"current_time"
"body":"current_time( ${1:\\$type}${2:, \\$gmt} )"
"Whether the current user has a specific capability.":
"prefix":"current_user_can"
"body":"current_user_can( ${1:\\$capability}${2:, \\$object_id} )"
"Whether current user has a capability or role for a given site.":
"prefix":"current_user_can_for_blog"
"body":"current_user_can_for_blog( ${1:\\$blog_id}${2:, \\$capability} )"
"Print JS templates for the theme-browsing UI in the Customizer.":
"prefix":"customize_themes_print_templates"
"body":"customize_themes_print_templates()"
"dashboard_browser_nag_class":
"prefix":"dashboard_browser_nag_class"
"body":"dashboard_browser_nag_class( ${1:\\$classes} )"
"Retrieve the date in localized format, based on timestamp.":
"prefix":"date_i18n"
"body":"date_i18n( ${1:\\$dateformatstring}${2:, \\$unixtimestamp = false}${3:, \\$gmt = false} )"
"Modifies the database based on specified SQL statements.":
"prefix":"dbdelta"
"body":"dbdelta( ${1:\\$queries = ''}${2:, \\$execute = true} )"
"Deactivate a single plugin or multiple plugins.":
"prefix":"deactivate_plugins"
"body":"deactivate_plugins( ${1:\\$plugins}${2:, \\$silent = false}${3:, \\$network_wide = null} )"
"Deprecated functionality for deactivating a network-only plugin.":
"prefix":"deactivate_sitewide_plugin"
"body":"deactivate_sitewide_plugin()"
"Load custom DB error or display WordPress DB error.":
"prefix":"dead_db"
"body":"dead_db()"
"Close the debugging file handle.":
"prefix":"debug_fclose"
"body":"debug_fclose( ${1:\\$fp} )"
"Open the file handle for debugging.":
"prefix":"debug_fopen"
"body":"debug_fopen( ${1:\\$filename}${2:, \\$mode} )"
"Write contents to the file used for debugging.":
"prefix":"debug_fwrite"
"body":"debug_fwrite( ${1:\\$fp}${2:, \\$string} )"
"default_password_nag":
"prefix":"default_password_nag"
"body":"default_password_nag()"
"default_password_nag_edit_user":
"prefix":"default_password_nag_edit_user"
"body":"default_password_nag_edit_user( ${1:\\$user_ID}${2:, \\$old_data} )"
"default_password_nag_handler":
"prefix":"default_password_nag_handler"
"body":"default_password_nag_handler( ${1:\\$errors = false} )"
"Default topic count scaling for tag links.":
"prefix":"default_topic_count_scale"
"body":"default_topic_count_scale( ${1:\\$count} )"
"Old callback for tag link tooltips.":
"prefix":"default_topic_count_text"
"body":"default_topic_count_text( ${1:\\$count} )"
"Delete the user settings of the current user.":
"prefix":"delete_all_user_settings"
"body":"delete_all_user_settings()"
"Removes option by name for a given blog id. Prevents removal of protected WordPress options.":
"prefix":"delete_blog_option"
"body":"delete_blog_option( ${1:\\$id}${2:, \\$option} )"
"Remove metadata matching criteria from a comment.":
"prefix":"delete_comment_meta"
"body":"delete_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Purge the cached results of get_calendar.":
"prefix":"delete_get_calendar_cache"
"body":"delete_get_calendar_cache()"
"Delete post meta data by meta ID.":
"prefix":"delete_meta"
"body":"delete_meta( ${1:\\$mid} )"
"Delete metadata for the specified object.":
"prefix":"delete_metadata"
"body":"delete_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value = ''}${5:, \\$delete_all = false} )"
"Delete meta data by meta ID":
"prefix":"delete_metadata_by_mid"
"body":"delete_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id} )"
"Removes a network option by name.":
"prefix":"delete_network_option"
"body":"delete_network_option( ${1:\\$network_id}${2:, \\$option} )"
"Removes option by name. Prevents removal of protected WordPress options.":
"prefix":"delete_option"
"body":"delete_option( ${1:\\$option} )"
"Remove directory and files of a plugin for a list of plugins.":
"prefix":"delete_plugins"
"body":"delete_plugins( ${1:\\$plugins}${2:, \\$deprecated = ''} )"
"Remove metadata matching criteria from a post.":
"prefix":"delete_post_meta"
"body":"delete_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Delete everything from post meta matching meta key.":
"prefix":"delete_post_meta_by_key"
"body":"delete_post_meta_by_key( ${1:\\$post_meta_key} )"
"Remove a post thumbnail.":
"prefix":"delete_post_thumbnail"
"body":"delete_post_thumbnail( ${1:\\$post} )"
"Removes a option by name for the current network.":
"prefix":"delete_site_option"
"body":"delete_site_option( ${1:\\$option} )"
"Delete a site transient.":
"prefix":"delete_site_transient"
"body":"delete_site_transient( ${1:\\$transient} )"
"Removes metadata matching criteria from a term.":
"prefix":"delete_term_meta"
"body":"delete_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Remove a theme":
"prefix":"delete_theme"
"body":"delete_theme( ${1:\\$stylesheet}${2:, \\$redirect = ''} )"
"Delete a transient.":
"prefix":"delete_transient"
"body":"delete_transient( ${1:\\$transient} )"
"Remove metadata matching criteria from a user.":
"prefix":"delete_user_meta"
"body":"delete_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Delete user option with global blog capability.":
"prefix":"delete_user_option"
"body":"delete_user_option( ${1:\\$user_id}${2:, \\$option_name}${3:, \\$global = false} )"
"Delete user interface settings.":
"prefix":"delete_user_setting"
"body":"delete_user_setting( ${1:\\$names} )"
"Remove user meta data.":
"prefix":"delete_usermeta"
"body":"delete_usermeta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"delete_users_add_js":
"prefix":"delete_users_add_js"
"body":"delete_users_add_js()"
"Filters for content to remove unnecessary slashes.":
"prefix":"deslash"
"body":"deslash( ${1:\\$content} )"
"Retrieve the number of times an action is fired.":
"prefix":"did_action"
"body":"did_action( ${1:\\$tag} )"
"Outputs the html disabled attribute.":
"prefix":"disabled"
"body":"disabled( ${1:\\$disabled}${2:, \\$current = true}${3:, \\$echo = true} )"
"Finds a pingback server URI based on the given URL.":
"prefix":"discover_pingback_server_uri"
"body":"discover_pingback_server_uri( ${1:\\$url}${2:, \\$deprecated = ''} )"
"dismiss_core_update":
"prefix":"dismiss_core_update"
"body":"dismiss_core_update( ${1:\\$update} )"
"dismissed_updates":
"prefix":"dismissed_updates"
"body":"dismissed_updates()"
"Display install header.":
"prefix":"display_header"
"body":"display_header( ${1:\\$body_classes = ''} )"
"Whether to display the header text.":
"prefix":"display_header_text"
"body":"display_header_text()"
"Display plugin content based on plugin list.":
"prefix":"display_plugins_table"
"body":"display_plugins_table()"
"Display installer setup form.":
"prefix":"display_setup_form"
"body":"display_setup_form( ${1:\\$error = null} )"
"Displays the amount of disk space used by the current site. Not used in core.":
"prefix":"display_space_usage"
"body":"display_space_usage()"
"Prints a theme on the Install Themes pages.":
"prefix":"display_theme"
"body":"display_theme( ${1:\\$theme} )"
"Display theme content based on theme list.":
"prefix":"display_themes"
"body":"display_themes()"
"Meta Box Accordion Template Function":
"prefix":"do_accordion_sections"
"body":"do_accordion_sections( ${1:\\$screen}${2:, \\$context}${3:, \\$object} )"
"Execute functions hooked on a specific action hook.":
"prefix":"do_action"
"body":"do_action( ${1:\\$tag}${2:, \\$arg,... = ''} )"
"Fires functions attached to a deprecated action hook.":
"prefix":"do_action_deprecated"
"body":"do_action_deprecated( ${1:\\$tag}${2:, \\$args}${3:, \\$version}${4:, \\$replacement = false}${5:, \\$message = null} )"
"Execute functions hooked on a specific action hook, specifying arguments in an array.":
"prefix":"do_action_ref_array"
"body":"do_action_ref_array( ${1:\\$tag}${2:, \\$args} )"
"Adds an action hook specific to this page.":
"prefix":"do_activate_header"
"body":"do_activate_header()"
"Perform all pingbacks, enclosures, trackbacks, and send to pingback services.":
"prefix":"do_all_pings"
"body":"do_all_pings()"
"Upgrade WordPress core display.":
"prefix":"do_core_upgrade"
"body":"do_core_upgrade( ${1:\\$reinstall = false} )"
"do_dismiss_core_update":
"prefix":"do_dismiss_core_update"
"body":"do_dismiss_core_update()"
"Check content for video and audio links to add as enclosures.":
"prefix":"do_enclose"
"body":"do_enclose( ${1:\\$content}${2:, \\$post_ID} )"
"Load the feed template from the use of an action hook.":
"prefix":"do_feed"
"body":"do_feed()"
"Load either Atom comment feed or Atom posts feed.":
"prefix":"do_feed_atom"
"body":"do_feed_atom( ${1:\\$for_comments} )"
"Load the RDF RSS 0.91 Feed template.":
"prefix":"do_feed_rdf"
"body":"do_feed_rdf()"
"Load the RSS 1.0 Feed Template.":
"prefix":"do_feed_rss"
"body":"do_feed_rss()"
"Load either the RSS2 comment feed or the RSS2 posts feed.":
"prefix":"do_feed_rss2"
"body":"do_feed_rss2( ${1:\\$for_comments} )"
"Meta-Box template function":
"prefix":"do_meta_boxes"
"body":"do_meta_boxes( ${1:\\$screen}${2:, \\$context}${3:, \\$object} )"
"Display the robots.txt file content.":
"prefix":"do_robots"
"body":"do_robots()"
"Print out the settings fields for a particular settings section":
"prefix":"do_settings_fields"
"body":"do_settings_fields( ${1:\\$page}${2:, \\$section} )"
"Prints out all settings sections added to a particular settings page":
"prefix":"do_settings_sections"
"body":"do_settings_sections( ${1:\\$page} )"
"Search content for shortcodes and filter shortcodes through their hooks.":
"prefix":"do_shortcode"
"body":"do_shortcode( ${1:\\$content}${2:, \\$ignore_html = false} )"
"Regular Expression callable for do_shortcode() for calling shortcode hook.":
"prefix":"do_shortcode_tag"
"body":"do_shortcode_tag( ${1:\\$m} )"
"Search only inside HTML elements for shortcodes and process them.":
"prefix":"do_shortcodes_in_html_tags"
"body":"do_shortcodes_in_html_tags( ${1:\\$content}${2:, \\$ignore_html}${3:, \\$tagnames} )"
"Prints signup_header via wp_head":
"prefix":"do_signup_header"
"body":"do_signup_header()"
"Perform trackbacks.":
"prefix":"do_trackbacks"
"body":"do_trackbacks( ${1:\\$post_id} )"
"do_undismiss_core_update":
"prefix":"do_undismiss_core_update"
"body":"do_undismiss_core_update()"
"Unused Admin function.":
"prefix":"documentation_link"
"body":"documentation_link()"
"Retrieve the name of an action currently being processed.":
"prefix":"doing_action"
"body":"doing_action( ${1:\\$action = null} )"
"Retrieve the name of a filter currently being processed.":
"prefix":"doing_filter"
"body":"doing_filter( ${1:\\$filter = null} )"
"Check whether a blogname is already taken.":
"prefix":"domain_exists"
"body":"domain_exists( ${1:\\$domain}${2:, \\$path}${3:, \\$site_id = 1} )"
"Downloads a URL to a local temporary file using the WordPress HTTP Class.":
"prefix":"download_url"
"body":"download_url( ${1:\\$url}${2:, \\$timeout = 300} )"
"Drops a specified index from a table.":
"prefix":"drop_index"
"body":"drop_index( ${1:\\$table}${2:, \\$index} )"
"Legacy function used to generate the categories checklist control.":
"prefix":"dropdown_categories"
"body":"dropdown_categories( ${1:\\$default}${2:, \\$parent}${3:, \\$popular_ids = array()} )"
"Deprecated method for generating a drop-down of categories.":
"prefix":"dropdown_cats"
"body":"dropdown_cats( ${1:\\$optionall = 1}${2:, \\$all = 'All'}${3:, \\$orderby = 'ID'}${4:, \\$order = 'asc'}${5:, \\$show_last_update}${6:, \\$show_count}${7:, \\$hide_empty = 1}${8:, \\$optionnone = false}${9:, \\$selected}${10:, \\$exclude} )"
"Legacy function used to generate a link categories checklist control.":
"prefix":"dropdown_link_categories"
"body":"dropdown_link_categories( ${1:\\$default} )"
"Display dynamic sidebar.":
"prefix":"dynamic_sidebar"
"body":"dynamic_sidebar( ${1:\\$index = 1} )"
"Displays the edit bookmark link anchor content.":
"prefix":"edit_bookmark_link"
"body":"edit_bookmark_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$bookmark = null} )"
"Update a comment with values provided in $_POST.":
"prefix":"edit_comment"
"body":"edit_comment()"
"Displays the edit comment link with formatting.":
"prefix":"edit_comment_link"
"body":"edit_comment_link( ${1:\\$text = null}${2:, \\$before = ''}${3:, \\$after = ''} )"
"Displays the image and editor in the post editor":
"prefix":"edit_form_image_editor"
"body":"edit_form_image_editor( ${1:\\$post} )"
"Updates or inserts a link using values provided in $_POST.":
"prefix":"edit_link"
"body":"edit_link( ${1:\\$link_id} )"
"Update an existing post with values provided in $_POST.":
"prefix":"edit_post"
"body":"edit_post( ${1:\\$post_data = null} )"
"Displays the edit post link for post.":
"prefix":"edit_post_link"
"body":"edit_post_link( ${1:\\$text = null}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$id}${5:, \\$class = 'post-edit-link'} )"
"Displays or retrieves the edit link for a tag with formatting.":
"prefix":"edit_tag_link"
"body":"edit_tag_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$tag = null} )"
"Displays or retrieves the edit term link with formatting.":
"prefix":"edit_term_link"
"body":"edit_term_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$term = null}${5:, \\$echo = true} )"
"Edit user settings based on contents of $_POST":
"prefix":"edit_user"
"body":"edit_user( ${1:\\$user_id} )"
"Checks whether the given email exists.":
"prefix":"email_exists"
"body":"email_exists( ${1:\\$email} )"
"XML callback function that is called at the end of a XML tag.":
"prefix":"endelement"
"body":"endelement( ${1:\\$parser}${2:, \\$tagName} )"
"enqueue_comment_hotkeys_js":
"prefix":"enqueue_comment_hotkeys_js"
"body":"enqueue_comment_hotkeys_js()"
"Enqueue embed iframe default CSS and JS & fire do_action('enqueue_embed_scripts')":
"prefix":"enqueue_embed_scripts"
"body":"enqueue_embed_scripts()"
"Converts named entities into numbered entities.":
"prefix":"ent2ncr"
"body":"ent2ncr( ${1:\\$text} )"
"Escaping for HTML attributes.":
"prefix":"esc_attr"
"body":"esc_attr( ${1:\\$text} )"
"Retrieve the translation of $text and escapes it for safe use in an attribute.":
"prefix":"esc_attr__"
"body":"esc_attr__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated text that has been escaped for safe use in an attribute.":
"prefix":"esc_attr_e"
"body":"esc_attr_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate string with gettext context, and escapes it for safe use in an attribute.":
"prefix":"esc_attr_x"
"body":"esc_attr_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Escaping for HTML blocks.":
"prefix":"esc_html"
"body":"esc_html( ${1:\\$text} )"
"Retrieve the translation of $text and escapes it for safe use in HTML output.":
"prefix":"esc_html__"
"body":"esc_html__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated text that has been escaped for safe use in HTML output.":
"prefix":"esc_html_e"
"body":"esc_html_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate string with gettext context, and escapes it for safe use in HTML output.":
"prefix":"esc_html_x"
"body":"esc_html_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Escape single quotes, htmlspecialchar " < > &, and fix line endings.":
"prefix":"esc_js"
"body":"esc_js( ${1:\\$text} )"
"Escapes data for use in a MySQL query.":
"prefix":"esc_sql"
"body":"esc_sql( ${1:\\$data} )"
"Escaping for textarea values.":
"prefix":"esc_textarea"
"body":"esc_textarea( ${1:\\$text} )"
"Checks and cleans a URL.":
"prefix":"esc_url"
"body":"esc_url( ${1:\\$url}${2:, \\$protocols = null}${3:, \\$_context = 'display'} )"
"Performs esc_url() for database usage.":
"prefix":"esc_url_raw"
"body":"esc_url_raw( ${1:\\$url}${2:, \\$protocols = null} )"
"Display JavaScript on the page.":
"prefix":"export_add_js"
"body":"export_add_js()"
"Create the date options fields for exporting a given post type.":
"prefix":"export_date_options"
"body":"export_date_options( ${1:\\$post_type = 'post'} )"
"Generates the WXR export file for download.":
"prefix":"export_wp"
"body":"export_wp( ${1:\\$args = array()} )"
"Extracts strings from between the BEGIN and END markers in the .htaccess file.":
"prefix":"extract_from_markers"
"body":"extract_from_markers( ${1:\\$filename}${2:, \\$marker} )"
"Favorite actions were deprecated in version 3.2. Use the admin bar instead.":
"prefix":"favorite_actions"
"body":"favorite_actions()"
"Return the content type for specified feed type.":
"prefix":"feed_content_type"
"body":"feed_content_type( ${1:\\$type = ''} )"
"Display the links to the general feeds.":
"prefix":"feed_links"
"body":"feed_links( ${1:\\$args = array()} )"
"Display the links to the extra feeds such as category feeds.":
"prefix":"feed_links_extra"
"body":"feed_links_extra( ${1:\\$args = array()} )"
"Build SimplePie object based on RSS or Atom feed from URL.":
"prefix":"fetch_feed"
"body":"fetch_feed( ${1:\\$url} )"
"Build Magpie object based on RSS from URL.":
"prefix":"fetch_rss"
"body":"fetch_rss( ${1:\\$url} )"
"Validate that file is suitable for displaying within a web page.":
"prefix":"file_is_displayable_image"
"body":"file_is_displayable_image( ${1:\\$path} )"
"Validate that file is an image.":
"prefix":"file_is_valid_image"
"body":"file_is_valid_image( ${1:\\$path} )"
"Filter the default value for the option.":
"prefix":"filter_default_option"
"body":"filter_default_option( ${1:\\$default}${2:, \\$option}${3:, \\$passed_default} )"
"Formats a URL to use https.":
"prefix":"filter_ssl"
"body":"filter_ssl( ${1:\\$url} )"
"Gets the best available (and enabled) Auto-Update for WordPress Core.":
"prefix":"find_core_auto_update"
"body":"find_core_auto_update()"
"find_core_update":
"prefix":"find_core_update"
"body":"find_core_update( ${1:\\$version}${2:, \\$locale} )"
"Outputs the modal window used for attaching media to posts or pages in the media-listing screen.":
"prefix":"find_posts_div"
"body":"find_posts_div( ${1:\\$found_action = ''} )"
"Get the remaining upload space for this site.":
"prefix":"fix_import_form_size"
"body":"fix_import_form_size( ${1:\\$size} )"
"Correct From host on outgoing mail to match the site domain":
"prefix":"fix_phpmailer_messageid"
"body":"fix_phpmailer_messageid( ${1:\\$phpmailer} )"
"Add avatars to relevant places in admin, or try to.":
"prefix":"floated_admin_avatar"
"body":"floated_admin_avatar( ${1:\\$name} )"
"Remove rewrite rules and then recreate rewrite rules.":
"prefix":"flush_rewrite_rules"
"body":"flush_rewrite_rules( ${1:\\$hard = true} )"
"Balances tags of string using a modified stack.":
"prefix":"force_balance_tags"
"body":"force_balance_tags( ${1:\\$text} )"
"Whether to force SSL used for the Administration Screens.":
"prefix":"force_ssl_admin"
"body":"force_ssl_admin( ${1:\\$force = null} )"
"Whether to force SSL on content.":
"prefix":"force_ssl_content"
"body":"force_ssl_content( ${1:\\$force = ''} )"
"Whether SSL login should be forced.":
"prefix":"force_ssl_login"
"body":"force_ssl_login( ${1:\\$force = null} )"
"Print option value after sanitizing for forms.":
"prefix":"form_option"
"body":"form_option( ${1:\\$option} )"
"Returns the language for a language code.":
"prefix":"format_code_lang"
"body":"format_code_lang( ${1:\\$code = ''} )"
"Formats text for the editor.":
"prefix":"format_for_editor"
"body":"format_for_editor( ${1:\\$text}${2:, \\$default_editor = null} )"
"Acts on text which is about to be edited.":
"prefix":"format_to_edit"
"body":"format_to_edit( ${1:\\$content}${2:, \\$rich_text = false} )"
"Formerly used to escape strings before inserting into the DB.":
"prefix":"format_to_post"
"body":"format_to_post( ${1:\\$content} )"
"Callback used to change %uXXXX to &#YYY; syntax":
"prefix":"funky_javascript_callback"
"body":"funky_javascript_callback( ${1:\\$matches} )"
"Fixes JavaScript bugs in browsers.":
"prefix":"funky_javascript_fix"
"body":"funky_javascript_fix( ${1:\\$text} )"
"Builds the Gallery shortcode output.":
"prefix":"gallery_shortcode"
"body":"gallery_shortcode( ${1:\\$attr} )"
"Check if the installed version of GD supports particular image type":
"prefix":"gd_edit_image_support"
"body":"gd_edit_image_support( ${1:\\$mime_type} )"
"Generates a random password.":
"prefix":"generate_random_password"
"body":"generate_random_password( ${1:\\$len = 8} )"
"Sends pings to all of the ping site services.":
"prefix":"generic_ping"
"body":"generic_ping( ${1:\\$post_id} )"
"Retrieve path of 404 template in current or parent template.":
"prefix":"get_404_template"
"body":"get_404_template()"
"Get one of a user's active blogs":
"prefix":"get_active_blog_for_user"
"body":"get_active_blog_for_user( ${1:\\$user_id} )"
"Retrieves the adjacent post.":
"prefix":"get_adjacent_post"
"body":"get_adjacent_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$previous = true}${4:, \\$taxonomy = 'category'} )"
"Retrieves the adjacent post link.":
"prefix":"get_adjacent_post_link"
"body":"get_adjacent_post_link( ${1:\\$format}${2:, \\$link}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$previous = true}${6:, \\$taxonomy = 'category'} )"
"Retrieves the adjacent post relational link.":
"prefix":"get_adjacent_post_rel_link"
"body":"get_adjacent_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$previous = true}${5:, \\$taxonomy = 'category'} )"
"get_admin_page_parent":
"prefix":"get_admin_page_parent"
"body":"get_admin_page_parent()"
"get_admin_page_title":
"prefix":"get_admin_page_title"
"body":"get_admin_page_title()"
"Retrieves the URL to the admin area for a given site.":
"prefix":"get_admin_url"
"body":"get_admin_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = 'admin'} )"
"Get the admin for a domain/path combination.":
"prefix":"get_admin_users_for_domain"
"body":"get_admin_users_for_domain( ${1:\\$sitedomain = ''}${2:, \\$path = ''} )"
"Retrieves all category IDs.":
"prefix":"get_all_category_ids"
"body":"get_all_category_ids()"
"Get a list of page IDs.":
"prefix":"get_all_page_ids"
"body":"get_all_page_ids()"
"Get all the post type features":
"prefix":"get_all_post_type_supports"
"body":"get_all_post_type_supports( ${1:\\$post_type} )"
"Retrieve all user interface settings.":
"prefix":"get_all_user_settings"
"body":"get_all_user_settings()"
"Retrieve all autoload options, or all options if no autoloaded ones exist.":
"prefix":"get_alloptions"
"body":"get_alloptions()"
"Retrieve all options as it was for 1.2.":
"prefix":"get_alloptions_110"
"body":"get_alloptions_110()"
"Retrieve list of allowed HTTP origins.":
"prefix":"get_allowed_http_origins"
"body":"get_allowed_http_origins()"
"Retrieve list of allowed mime types and file extensions.":
"prefix":"get_allowed_mime_types"
"body":"get_allowed_mime_types( ${1:\\$user = null} )"
"Get the allowed themes for the current site.":
"prefix":"get_allowed_themes"
"body":"get_allowed_themes()"
"Get an array of ancestor IDs for a given object.":
"prefix":"get_ancestors"
"body":"get_ancestors( ${1:\\$object_id}${2:, \\$object_type = ''}${3:, \\$resource_type = ''} )"
"Retrieve the approved comments for post $post_id.":
"prefix":"get_approved_comments"
"body":"get_approved_comments( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieve path of archive template in current or parent template.":
"prefix":"get_archive_template"
"body":"get_archive_template()"
"Retrieves a list of archives.":
"prefix":"get_archives"
"body":"get_archives( ${1:\\$type = ''}${2:, \\$limit = ''}${3:, \\$format = 'html'}${4:, \\$before = ''}${5:, \\$after = ''}${6:, \\$show_post_count = false} )"
"Retrieve archive link content based on predefined or custom code.":
"prefix":"get_archives_link"
"body":"get_archives_link( ${1:\\$url}${2:, \\$text}${3:, \\$format = 'html'}${4:, \\$before = ''}${5:, \\$after = ''} )"
"Retrieve attached file path based on attachment ID.":
"prefix":"get_attached_file"
"body":"get_attached_file( ${1:\\$attachment_id}${2:, \\$unfiltered = false} )"
"Retrieves media attached to the passed post.":
"prefix":"get_attached_media"
"body":"get_attached_media( ${1:\\$type}${2:, \\$post} )"
"Retrieves the attachment fields to edit form fields.":
"prefix":"get_attachment_fields_to_edit"
"body":"get_attachment_fields_to_edit( ${1:\\$post}${2:, \\$errors = null} )"
"Retrieve HTML content of icon attachment image element.":
"prefix":"get_attachment_icon"
"body":"get_attachment_icon( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false} )"
"Retrieve icon URL and Path.":
"prefix":"get_attachment_icon_src"
"body":"get_attachment_icon_src( ${1:\\$id}${2:, \\$fullsize = false} )"
"Retrieve HTML content of image element.":
"prefix":"get_attachment_innerhtml"
"body":"get_attachment_innerhtml( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false} )"
"Retrieves the permalink for an attachment.":
"prefix":"get_attachment_link"
"body":"get_attachment_link( ${1:\\$post = null}${2:, \\$leavename = false} )"
"Retrieves taxonomies attached to given the attachment.":
"prefix":"get_attachment_taxonomies"
"body":"get_attachment_taxonomies( ${1:\\$attachment}${2:, \\$output = 'names'} )"
"Retrieve path of attachment template in current or parent template.":
"prefix":"get_attachment_template"
"body":"get_attachment_template()"
"Retrieves the feed link for a given author.":
"prefix":"get_author_feed_link"
"body":"get_author_feed_link( ${1:\\$author_id}${2:, \\$feed = ''} )"
"Returns or Prints link to the author's posts.":
"prefix":"get_author_link"
"body":"get_author_link( ${1:\\$echo}${2:, \\$author_id}${3:, \\$author_nicename = ''} )"
"Retrieve the specified author's preferred display name.":
"prefix":"get_author_name"
"body":"get_author_name( ${1:\\$auth_id = false} )"
"Retrieve the URL to the author page for the user with the ID provided.":
"prefix":"get_author_posts_url"
"body":"get_author_posts_url( ${1:\\$author_id}${2:, \\$author_nicename = ''} )"
"Print/Return link to author RSS feed.":
"prefix":"get_author_rss_link"
"body":"get_author_rss_link( ${1:\\$echo = false}${2:, \\$author_id = 1} )"
"Retrieve path of author template in current or parent template.":
"prefix":"get_author_template"
"body":"get_author_template()"
"Get all user IDs.":
"prefix":"get_author_user_ids"
"body":"get_author_user_ids()"
"Gets the auto_toggle setting.":
"prefix":"get_autotoggle"
"body":"get_autotoggle( ${1:\\$id} )"
"Get all available languages based on the presence of *.mo files in a given directory.":
"prefix":"get_available_languages"
"body":"get_available_languages( ${1:\\$dir = null} )"
"Get all available post MIME types for a given post type.":
"prefix":"get_available_post_mime_types"
"body":"get_available_post_mime_types( ${1:\\$type = 'attachment'} )"
"Get all the possible statuses for a post_type":
"prefix":"get_available_post_statuses"
"body":"get_available_post_statuses( ${1:\\$type = 'post'} )"
"Retrieve the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post.":
"prefix":"get_avatar"
"body":"get_avatar( ${1:\\$id_or_email}${2:, \\$size = 96}${3:, \\$default = ''}${4:, \\$alt = ''}${5:, \\$args = null} )"
"Retrieves default data about the avatar.":
"prefix":"get_avatar_data"
"body":"get_avatar_data( ${1:\\$id_or_email}${2:, \\$args = null} )"
"Retrieves the avatar URL.":
"prefix":"get_avatar_url"
"body":"get_avatar_url( ${1:\\$id_or_email}${2:, \\$args = null} )"
"Retrieve value for custom background color.":
"prefix":"get_background_color"
"body":"get_background_color()"
"Retrieve background image for custom background.":
"prefix":"get_background_image"
"body":"get_background_image()"
"The number of active sites on your installation.":
"prefix":"get_blog_count"
"body":"get_blog_count( ${1:\\$network_id = null} )"
"Retrieve the details for a blog from the blogs table and blog options.":
"prefix":"get_blog_details"
"body":"get_blog_details( ${1:\\$fields = null}${2:, \\$get_all = true} )"
"Get a blog's numeric ID from its URL.":
"prefix":"get_blog_id_from_url"
"body":"get_blog_id_from_url( ${1:\\$domain}${2:, \\$path = '/'} )"
"Deprecated functionality to retrieve a list of all sites.":
"prefix":"get_blog_list"
"body":"get_blog_list( ${1:\\$start}${2:, \\$num = 10}${3:, \\$deprecated = ''} )"
"Retrieve option value for a given blog id based on name of option.":
"prefix":"get_blog_option"
"body":"get_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$default = false} )"
"Get the permalink for a post on another blog.":
"prefix":"get_blog_permalink"
"body":"get_blog_permalink( ${1:\\$blog_id}${2:, \\$post_id} )"
"Get a blog post from any site on the network.":
"prefix":"get_blog_post"
"body":"get_blog_post( ${1:\\$blog_id}${2:, \\$post_id} )"
"Get a blog details field.":
"prefix":"get_blog_status"
"body":"get_blog_status( ${1:\\$id}${2:, \\$pref} )"
"Get a full blog URL, given a domain and a path.":
"prefix":"get_blogaddress_by_domain"
"body":"get_blogaddress_by_domain( ${1:\\$domain}${2:, \\$path} )"
"Get a full blog URL, given a blog id.":
"prefix":"get_blogaddress_by_id"
"body":"get_blogaddress_by_id( ${1:\\$blog_id} )"
"Get a full blog URL, given a blog name.":
"prefix":"get_blogaddress_by_name"
"body":"get_blogaddress_by_name( ${1:\\$blogname} )"
"Retrieves information about the current site.":
"prefix":"get_bloginfo"
"body":"get_bloginfo( ${1:\\$show = ''}${2:, \\$filter = 'raw'} )"
"RSS container for the bloginfo function.":
"prefix":"get_bloginfo_rss"
"body":"get_bloginfo_rss( ${1:\\$show = ''} )"
"Get the sites a user belongs to.":
"prefix":"get_blogs_of_user"
"body":"get_blogs_of_user( ${1:\\$user_id}${2:, \\$all = false} )"
"Retrieve the classes for the body element as an array.":
"prefix":"get_body_class"
"body":"get_body_class( ${1:\\$class = ''} )"
"Retrieve Bookmark data":
"prefix":"get_bookmark"
"body":"get_bookmark( ${1:\\$bookmark}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve single bookmark data item or field.":
"prefix":"get_bookmark_field"
"body":"get_bookmark_field( ${1:\\$field}${2:, \\$bookmark}${3:, \\$context = 'display'} )"
"Retrieves the list of bookmarks":
"prefix":"get_bookmarks"
"body":"get_bookmarks( ${1:\\$args = ''} )"
"Retrieves the boundary post.":
"prefix":"get_boundary_post"
"body":"get_boundary_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$start = true}${4:, \\$taxonomy = 'category'} )"
"Get boundary post relational link.":
"prefix":"get_boundary_post_rel_link"
"body":"get_boundary_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_cat = false}${3:, \\$excluded_categories = ''}${4:, \\$start = true} )"
"Retrieves a list of broken themes.":
"prefix":"get_broken_themes"
"body":"get_broken_themes()"
"Display calendar with days that have posts as links.":
"prefix":"get_calendar"
"body":"get_calendar( ${1:\\$initial = true}${2:, \\$echo = true} )"
"Retrieve HTML content for cancel comment reply link.":
"prefix":"get_cancel_comment_reply_link"
"body":"get_cancel_comment_reply_link( ${1:\\$text = ''} )"
"Retrieve the ID of a category from its name.":
"prefix":"get_cat_id"
"body":"get_cat_id( ${1:\\$cat_name} )"
"Retrieve the name of a category from its ID.":
"prefix":"get_cat_name"
"body":"get_cat_name( ${1:\\$cat_id} )"
"Retrieve list of category objects.":
"prefix":"get_categories"
"body":"get_categories( ${1:\\$args = ''} )"
"Retrieves category data given a category ID or category object.":
"prefix":"get_category"
"body":"get_category( ${1:\\$category}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve category based on URL containing the category slug.":
"prefix":"get_category_by_path"
"body":"get_category_by_path( ${1:\\$category_path}${2:, \\$full_match = true}${3:, \\$output = OBJECT} )"
"Retrieve category object by category slug.":
"prefix":"get_category_by_slug"
"body":"get_category_by_slug( ${1:\\$slug} )"
"Retrieve category children list separated before and after the term IDs.":
"prefix":"get_category_children"
"body":"get_category_children( ${1:\\$id}${2:, \\$before = '/'}${3:, \\$after = ''}${4:, \\$visited = array()} )"
"Retrieves the feed link for a category.":
"prefix":"get_category_feed_link"
"body":"get_category_feed_link( ${1:\\$cat_id}${2:, \\$feed = ''} )"
"Retrieve category link URL.":
"prefix":"get_category_link"
"body":"get_category_link( ${1:\\$category} )"
"Retrieve category parents with separator.":
"prefix":"get_category_parents"
"body":"get_category_parents( ${1:\\$id}${2:, \\$link = false}${3:, \\$separator = '/'}${4:, \\$nicename = false}${5:, \\$deprecated = array()} )"
"Print/Return link to category RSS2 feed.":
"prefix":"get_category_rss_link"
"body":"get_category_rss_link( ${1:\\$echo = false}${2:, \\$cat_ID = 1} )"
"Retrieve path of category template in current or parent template.":
"prefix":"get_category_template"
"body":"get_category_template()"
"Get category object for given ID and 'edit' filter context.":
"prefix":"get_category_to_edit"
"body":"get_category_to_edit( ${1:\\$id} )"
"Retrieve the category name by the category ID.":
"prefix":"get_catname"
"body":"get_catname( ${1:\\$cat_ID} )"
"Retrieve all children of the post parent ID.":
"prefix":"get_children"
"body":"get_children( ${1:\\$args = ''}${2:, \\$output = OBJECT} )"
"Get base domain of network.":
"prefix":"get_clean_basedomain"
"body":"get_clean_basedomain()"
"Returns value of command line params.":
"prefix":"get_cli_args"
"body":"get_cli_args( ${1:\\$param}${2:, \\$required = false} )"
"Get the column headers for a screen":
"prefix":"get_column_headers"
"body":"get_column_headers( ${1:\\$screen} )"
"Retrieves comment data given a comment ID or comment object.":
"prefix":"get_comment"
"body":"get_comment( ${1:\\$comment = null}${2:, \\$output = OBJECT} )"
"Retrieve the author of the current comment.":
"prefix":"get_comment_author"
"body":"get_comment_author( ${1:\\$comment_ID} )"
"Retrieve the email of the author of the current comment.":
"prefix":"get_comment_author_email"
"body":"get_comment_author_email( ${1:\\$comment_ID} )"
"Return the html email link to the author of the current comment.":
"prefix":"get_comment_author_email_link"
"body":"get_comment_author_email_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment = null} )"
"Retrieve the IP address of the author of the current comment.":
"prefix":"get_comment_author_ip"
"body":"get_comment_author_ip( ${1:\\$comment_ID} )"
"Retrieve the HTML link to the URL of the author of the current comment.":
"prefix":"get_comment_author_link"
"body":"get_comment_author_link( ${1:\\$comment_ID} )"
"Retrieve the current comment author for use in the feeds.":
"prefix":"get_comment_author_rss"
"body":"get_comment_author_rss()"
"Retrieve the url of the author of the current comment.":
"prefix":"get_comment_author_url"
"body":"get_comment_author_url( ${1:\\$comment_ID} )"
"Retrieves the HTML link of the url of the author of the current comment.":
"prefix":"get_comment_author_url_link"
"body":"get_comment_author_url_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment} )"
"Returns the classes for the comment div as an array.":
"prefix":"get_comment_class"
"body":"get_comment_class( ${1:\\$class = ''}${2:, \\$comment_id = null}${3:, \\$post_id = null} )"
"The amount of comments in a post or total comments.":
"prefix":"get_comment_count"
"body":"get_comment_count( ${1:\\$post_id} )"
"Retrieve the comment date of the current comment.":
"prefix":"get_comment_date"
"body":"get_comment_date( ${1:\\$d = ''}${2:, \\$comment_ID} )"
"Retrieve the excerpt of the current comment.":
"prefix":"get_comment_excerpt"
"body":"get_comment_excerpt( ${1:\\$comment_ID} )"
"Retrieve the feed GUID for the current comment.":
"prefix":"get_comment_guid"
"body":"get_comment_guid( ${1:\\$comment_id = null} )"
"Retrieve the comment id of the current comment.":
"prefix":"get_comment_id"
"body":"get_comment_id()"
"Retrieve hidden input HTML for replying to comments.":
"prefix":"get_comment_id_fields"
"body":"get_comment_id_fields( ${1:\\$id} )"
"Retrieve the link to a given comment.":
"prefix":"get_comment_link"
"body":"get_comment_link( ${1:\\$comment = null}${2:, \\$args = array()} )"
"Retrieve comment meta field for a comment.":
"prefix":"get_comment_meta"
"body":"get_comment_meta( ${1:\\$comment_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Calculate the total number of comment pages.":
"prefix":"get_comment_pages_count"
"body":"get_comment_pages_count( ${1:\\$comments = null}${2:, \\$per_page = null}${3:, \\$threaded = null} )"
"Retrieve HTML content for reply to comment link.":
"prefix":"get_comment_reply_link"
"body":"get_comment_reply_link( ${1:\\$args = array()}${2:, \\$comment = null}${3:, \\$post = null} )"
"Retrieve all of the WordPress supported comment statuses.":
"prefix":"get_comment_statuses"
"body":"get_comment_statuses()"
"Retrieve the text of the current comment.":
"prefix":"get_comment_text"
"body":"get_comment_text( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Retrieve the comment time of the current comment.":
"prefix":"get_comment_time"
"body":"get_comment_time( ${1:\\$d = ''}${2:, \\$gmt = false}${3:, \\$translate = true} )"
"Returns a WP_Comment object based on comment ID.":
"prefix":"get_comment_to_edit"
"body":"get_comment_to_edit( ${1:\\$id} )"
"Retrieve the comment type of the current comment.":
"prefix":"get_comment_type"
"body":"get_comment_type( ${1:\\$comment_ID} )"
"Retrieve an array of comment data about comment $comment_ID.":
"prefix":"get_commentdata"
"body":"get_commentdata( ${1:\\$comment_ID}${2:, \\$no_cache}${3:, \\$include_unapproved = false} )"
"Retrieve a list of comments.":
"prefix":"get_comments"
"body":"get_comments( ${1:\\$args = ''} )"
"Retrieves the link to the current post comments.":
"prefix":"get_comments_link"
"body":"get_comments_link( ${1:\\$post_id} )"
"Retrieve the amount of comments a post has.":
"prefix":"get_comments_number"
"body":"get_comments_number( ${1:\\$post_id} )"
"Display the language string for the number of comments the current post has":
"prefix":"get_comments_number_text"
"body":"get_comments_number_text( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false} )"
"Retrieves the comments page number link.":
"prefix":"get_comments_pagenum_link"
"body":"get_comments_pagenum_link( ${1:\\$pagenum = 1}${2:, \\$max_page} )"
"Retrieve path of comment popup template in current or parent template.":
"prefix":"get_comments_popup_template"
"body":"get_comments_popup_template()"
"get_compat_media_markup":
"prefix":"get_compat_media_markup"
"body":"get_compat_media_markup( ${1:\\$attachment_id}${2:, \\$args = null} )"
"Gets and caches the checksums for the given version of WordPress.":
"prefix":"get_core_checksums"
"body":"get_core_checksums( ${1:\\$version}${2:, \\$locale} )"
"Get available core updates.":
"prefix":"get_core_updates"
"body":"get_core_updates( ${1:\\$options = array()} )"
"Retrieve the current site ID.":
"prefix":"get_current_blog_id"
"body":"get_current_blog_id()"
"Retrieves the current network ID.":
"prefix":"get_current_network_id"
"body":"get_current_network_id()"
"Get the current screen object":
"prefix":"get_current_screen"
"body":"get_current_screen()"
"Get the current network.":
"prefix":"get_current_site"
"body":"get_current_site()"
"This deprecated function formerly set the site_name property of the $current_site object.":
"prefix":"get_current_site_name"
"body":"get_current_site_name( ${1:\\$current_site} )"
"Retrieve current theme name.":
"prefix":"get_current_theme"
"body":"get_current_theme()"
"Get the current user's ID":
"prefix":"get_current_user_id"
"body":"get_current_user_id()"
"Populate global variables with information about the currently logged in user.":
"prefix":"get_currentuserinfo"
"body":"get_currentuserinfo()"
"Get the header image data.":
"prefix":"get_custom_header"
"body":"get_custom_header()"
"Retrieve the markup for a custom header.":
"prefix":"get_custom_header_markup"
"body":"get_custom_header_markup()"
"Returns a custom logo, linked to home.":
"prefix":"get_custom_logo"
"body":"get_custom_logo( ${1:\\$blog_id} )"
"Get the "dashboard blog", the blog where users without a blog edit their profile data.":
"prefix":"get_dashboard_blog"
"body":"get_dashboard_blog()"
"Retrieves the URL to the user's dashboard.":
"prefix":"get_dashboard_url"
"body":"get_dashboard_url( ${1:\\$user_id}${2:, \\$path = ''}${3:, \\$scheme = 'admin'} )"
"Converts a GMT date into the correct format for the blog.":
"prefix":"get_date_from_gmt"
"body":"get_date_from_gmt( ${1:\\$string}${2:, \\$format = 'Y-m-d H:i:s'} )"
"Retrieve path of date template in current or parent template.":
"prefix":"get_date_template"
"body":"get_date_template()"
"Retrieves the permalink for the day archives with year and month.":
"prefix":"get_day_link"
"body":"get_day_link( ${1:\\$year}${2:, \\$month}${3:, \\$day} )"
"Gets the default comment status for a post type.":
"prefix":"get_default_comment_status"
"body":"get_default_comment_status( ${1:\\$post_type = 'post'}${2:, \\$comment_type = 'comment'} )"
"Retrieve the default feed.":
"prefix":"get_default_feed"
"body":"get_default_feed()"
"Retrieves the default link for editing.":
"prefix":"get_default_link_to_edit"
"body":"get_default_link_to_edit()"
"Gets the default page information to use.":
"prefix":"get_default_page_to_edit"
"body":"get_default_page_to_edit()"
"Default post information to use when populating the "Write Post" form.":
"prefix":"get_default_post_to_edit"
"body":"get_default_post_to_edit( ${1:\\$post_type = 'post'}${2:, \\$create_in_db = false} )"
"Retrieves the delete posts link for post.":
"prefix":"get_delete_post_link"
"body":"get_delete_post_link( ${1:\\$id}${2:, \\$deprecated = ''}${3:, \\$force_delete = false} )"
"Get the size of a directory.":
"prefix":"get_dirsize"
"body":"get_dirsize( ${1:\\$directory} )"
"Check the wp-content directory and retrieve all drop-ins with any plugin data.":
"prefix":"get_dropins"
"body":"get_dropins()"
"Displays the edit bookmark link.":
"prefix":"get_edit_bookmark_link"
"body":"get_edit_bookmark_link( ${1:\\$link} )"
"Retrieves the edit comment link.":
"prefix":"get_edit_comment_link"
"body":"get_edit_comment_link( ${1:\\$comment_id} )"
"Retrieves the edit post link for post.":
"prefix":"get_edit_post_link"
"body":"get_edit_post_link( ${1:\\$id}${2:, \\$context = 'display'} )"
"Retrieves the URL to the user's profile editor.":
"prefix":"get_edit_profile_url"
"body":"get_edit_profile_url( ${1:\\$user_id}${2:, \\$scheme = 'admin'} )"
"Retrieves the edit link for a tag.":
"prefix":"get_edit_tag_link"
"body":"get_edit_tag_link( ${1:\\$tag_id}${2:, \\$taxonomy = 'post_tag'} )"
"Retrieves the URL for editing a given term.":
"prefix":"get_edit_term_link"
"body":"get_edit_term_link( ${1:\\$term_id}${2:, \\$taxonomy = ''}${3:, \\$object_type = ''} )"
"Retrieves the edit user link.":
"prefix":"get_edit_user_link"
"body":"get_edit_user_link( ${1:\\$user_id = null} )"
"Gets author users who can edit posts.":
"prefix":"get_editable_authors"
"body":"get_editable_authors( ${1:\\$user_id} )"
"Fetch a filtered list of user roles that the current user is
allowed to edit.":
"prefix":"get_editable_roles"
"body":"get_editable_roles()"
"Gets the IDs of any users who can edit posts.":
"prefix":"get_editable_user_ids"
"body":"get_editable_user_ids( ${1:\\$user_id}${2:, \\$exclude_zeros = true} )"
"Retrieve any registered editor stylesheets":
"prefix":"get_editor_stylesheets"
"body":"get_editor_stylesheets()"
"Retrieves an embed template path in the current or parent template.":
"prefix":"get_embed_template"
"body":"get_embed_template()"
"Retrieve enclosures already enclosed for a post.":
"prefix":"get_enclosed"
"body":"get_enclosed( ${1:\\$post_id} )"
"Get extended entry info (<!--more-->).":
"prefix":"get_extended"
"body":"get_extended( ${1:\\$post} )"
"Retrieves the permalink for the feed type.":
"prefix":"get_feed_link"
"body":"get_feed_link( ${1:\\$feed = ''} )"
"Retrieve metadata from a file.":
"prefix":"get_file_data"
"body":"get_file_data( ${1:\\$file}${2:, \\$default_headers}${3:, \\$context = ''} )"
"Get the description for standard WordPress theme files and other various standard
WordPress files":
"prefix":"get_file_description"
"body":"get_file_description( ${1:\\$file} )"
"Determines which method to use for reading, writing, modifying, or deleting
files on the filesystem.":
"prefix":"get_filesystem_method"
"body":"get_filesystem_method( ${1:\\$args = array()}${2:, \\$context = ''}${3:, \\$allow_relaxed_file_ownership = false} )"
"Load footer template.":
"prefix":"get_footer"
"body":"get_footer( ${1:\\$name = null} )"
"Retrieve path of front page template in current or parent template.":
"prefix":"get_front_page_template"
"body":"get_front_page_template()"
"Returns a date in the GMT equivalent.":
"prefix":"get_gmt_from_date"
"body":"get_gmt_from_date( ${1:\\$string}${2:, \\$format = 'Y-m-d H:i:s'} )"
"Load header template.":
"prefix":"get_header"
"body":"get_header( ${1:\\$name = null} )"
"Retrieve header image for custom header.":
"prefix":"get_header_image"
"body":"get_header_image()"
"Create image tag markup for a custom header image.":
"prefix":"get_header_image_tag"
"body":"get_header_image_tag( ${1:\\$attr = array()} )"
"Retrieves the custom header text color in 3- or 6-digit hexadecimal form.":
"prefix":"get_header_textcolor"
"body":"get_header_textcolor()"
"Retrieve header video settings.":
"prefix":"get_header_video_settings"
"body":"get_header_video_settings()"
"Retrieve header video URL for custom header.":
"prefix":"get_header_video_url"
"body":"get_header_video_url()"
"Get a list of hidden columns.":
"prefix":"get_hidden_columns"
"body":"get_hidden_columns( ${1:\\$screen} )"
"Get Hidden Meta Boxes":
"prefix":"get_hidden_meta_boxes"
"body":"get_hidden_meta_boxes( ${1:\\$screen} )"
"Get the absolute filesystem path to the root of the WordPress installation":
"prefix":"get_home_path"
"body":"get_home_path()"
"Retrieve path of home template in current or parent template.":
"prefix":"get_home_template"
"body":"get_home_template()"
"Retrieves the URL for a given site where the front end is accessible.":
"prefix":"get_home_url"
"body":"get_home_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = null} )"
"Retrieve the regular expression for an HTML element.":
"prefix":"get_html_split_regex"
"body":"get_html_split_regex()"
"Get the HTTP Origin of the current request.":
"prefix":"get_http_origin"
"body":"get_http_origin()"
"Retrieves a sites ID given its (subdomain or directory) slug.":
"prefix":"get_id_from_blogname"
"body":"get_id_from_blogname( ${1:\\$slug} )"
"Retrieves the image HTML to send to the editor.":
"prefix":"get_image_send_to_editor"
"body":"get_image_send_to_editor( ${1:\\$id}${2:, \\$caption}${3:, \\$title}${4:, \\$align}${5:, \\$url = ''}${6:, \\$rel = false}${7:, \\$size = 'medium'}${8:, \\$alt = ''} )"
"Gets an img tag for an image attachment, scaling it down if requested.":
"prefix":"get_image_tag"
"body":"get_image_tag( ${1:\\$id}${2:, \\$alt}${3:, \\$title}${4:, \\$align}${5:, \\$size = 'medium'} )"
"Retrieve list of importers.":
"prefix":"get_importers"
"body":"get_importers()"
"Get site index relational link.":
"prefix":"get_index_rel_link"
"body":"get_index_rel_link()"
"Retrieve path of index template in current or parent template.":
"prefix":"get_index_template"
"body":"get_index_template()"
"Adds hidden fields with the data for use in the inline editor for posts and pages.":
"prefix":"get_inline_data"
"body":"get_inline_data( ${1:\\$post} )"
"Gets the available intermediate image sizes.":
"prefix":"get_intermediate_image_sizes"
"body":"get_intermediate_image_sizes()"
"Gets the language attributes for the html tag.":
"prefix":"get_language_attributes"
"body":"get_language_attributes( ${1:\\$doctype = 'html'} )"
"Get a list of most recently updated blogs.":
"prefix":"get_last_updated"
"body":"get_last_updated( ${1:\\$deprecated = ''}${2:, \\$start}${3:, \\$quantity = 40} )"
"The date the last comment was modified.":
"prefix":"get_lastcommentmodified"
"body":"get_lastcommentmodified( ${1:\\$timezone = 'server'} )"
"Retrieve the date that the last post was published.":
"prefix":"get_lastpostdate"
"body":"get_lastpostdate( ${1:\\$timezone = 'server'}${2:, \\$post_type = 'any'} )"
"Get the timestamp of the last time any post was modified.":
"prefix":"get_lastpostmodified"
"body":"get_lastpostmodified( ${1:\\$timezone = 'server'}${2:, \\$post_type = 'any'} )"
"Retrieves bookmark data based on ID.":
"prefix":"get_link"
"body":"get_link( ${1:\\$bookmark_id}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves link data based on its ID.":
"prefix":"get_link_to_edit"
"body":"get_link_to_edit( ${1:\\$link} )"
"Gets the name of category by id.":
"prefix":"get_linkcatname"
"body":"get_linkcatname( ${1:\\$id} )"
"Gets an array of link objects associated with category n.":
"prefix":"get_linkobjects"
"body":"get_linkobjects( ${1:\\$category}${2:, \\$orderby = 'name'}${3:, \\$limit} )"
"Gets an array of link objects associated with category $cat_name.":
"prefix":"get_linkobjectsbyname"
"body":"get_linkobjectsbyname( ${1:\\$cat_name = 'noname'}${2:, \\$orderby = 'name'}${3:, \\$limit = -1} )"
"Legacy function that retrieved the value of a link's link_rating field.":
"prefix":"get_linkrating"
"body":"get_linkrating( ${1:\\$link} )"
"Gets the links associated with category by id.":
"prefix":"get_links"
"body":"get_links( ${1:\\$category = -1}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ' '}${5:, \\$show_images = true}${6:, \\$orderby = 'name'}${7:, \\$show_description = true}${8:, \\$show_rating = false}${9:, \\$limit = -1}${10:, \\$show_updated = 1}${11:, \\$echo = true} )"
"Output entire list of links by category.":
"prefix":"get_links_list"
"body":"get_links_list( ${1:\\$order = 'name'} )"
"Gets the links associated with category n and display rating stars/chars.":
"prefix":"get_links_withrating"
"body":"get_links_withrating( ${1:\\$category = -1}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$limit = -1}${9:, \\$show_updated} )"
"Gets the links associated with category $cat_name.":
"prefix":"get_linksbyname"
"body":"get_linksbyname( ${1:\\$cat_name = 'noname'}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$show_rating = false}${9:, \\$limit = -1}${10:, \\$show_updated} )"
"Gets the links associated with category 'cat_name' and display rating stars/chars.":
"prefix":"get_linksbyname_withrating"
"body":"get_linksbyname_withrating( ${1:\\$cat_name = 'noname'}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$limit = -1}${9:, \\$show_updated} )"
"Retrieves the current locale.":
"prefix":"get_locale"
"body":"get_locale()"
"Retrieves the localized stylesheet URI.":
"prefix":"get_locale_stylesheet_uri"
"body":"get_locale_stylesheet_uri()"
"Get the main network ID.":
"prefix":"get_main_network_id"
"body":"get_main_network_id()"
"Check the content blob for an audio, video, object, embed, or iframe tags.":
"prefix":"get_media_embedded_in_content"
"body":"get_media_embedded_in_content( ${1:\\$content}${2:, \\$types = null} )"
"Retrieve HTML form for modifying the image attachment.":
"prefix":"get_media_item"
"body":"get_media_item( ${1:\\$attachment_id}${2:, \\$args = null} )"
"Retrieve HTML for media items of post gallery.":
"prefix":"get_media_items"
"body":"get_media_items( ${1:\\$post_id}${2:, \\$errors} )"
"Get a list of previously defined keys.":
"prefix":"get_meta_keys"
"body":"get_meta_keys()"
"Given a meta query, generates SQL clauses to be appended to a main query.":
"prefix":"get_meta_sql"
"body":"get_meta_sql( ${1:\\$meta_query}${2:, \\$type}${3:, \\$primary_table}${4:, \\$primary_id_column}${5:, \\$context = null} )"
"Retrieve metadata for the specified object.":
"prefix":"get_metadata"
"body":"get_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key = ''}${4:, \\$single = false} )"
"Get meta data by meta ID":
"prefix":"get_metadata_by_mid"
"body":"get_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id} )"
"Retrieves the permalink for the month archives with year.":
"prefix":"get_month_link"
"body":"get_month_link( ${1:\\$year}${2:, \\$month} )"
"Deprecated functionality to retrieve a list of the most active sites.":
"prefix":"get_most_active_blogs"
"body":"get_most_active_blogs( ${1:\\$num = 10}${2:, \\$display = true} )"
"Get a user's most recent post.":
"prefix":"get_most_recent_post_of_user"
"body":"get_most_recent_post_of_user( ${1:\\$user_id} )"
"Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data.":
"prefix":"get_mu_plugins"
"body":"get_mu_plugins()"
"Retrieves all registered navigation menu locations and the menus assigned to them.":
"prefix":"get_nav_menu_locations"
"body":"get_nav_menu_locations()"
"Retrieves network data given a network ID or network object.":
"prefix":"get_network"
"body":"get_network( ${1:\\$network = null} )"
"Retrieve the closest matching network for a domain and path.":
"prefix":"get_network_by_path"
"body":"get_network_by_path( ${1:\\$domain}${2:, \\$path}${3:, \\$segments = null} )"
"Retrieve a network's option value based on the option name.":
"prefix":"get_network_option"
"body":"get_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$default = false} )"
"Retrieves a list of networks.":
"prefix":"get_networks"
"body":"get_networks( ${1:\\$args = array()} )"
"Retrieves the link to the next comments page.":
"prefix":"get_next_comments_link"
"body":"get_next_comments_link( ${1:\\$label = ''}${2:, \\$max_page} )"
"Retrieves the next post that is adjacent to the current post.":
"prefix":"get_next_post"
"body":"get_next_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$taxonomy = 'category'} )"
"Retrieves the next post link that is adjacent to the current post.":
"prefix":"get_next_post_link"
"body":"get_next_post_link( ${1:\\$format = '%link »'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Retrieves the next posts link.":
"prefix":"get_next_posts_link"
"body":"get_next_posts_link( ${1:\\$label = null}${2:, \\$max_page} )"
"Retrieves the next posts page link.":
"prefix":"get_next_posts_page_link"
"body":"get_next_posts_page_link( ${1:\\$max_page} )"
"Gets all users who are not authors.":
"prefix":"get_nonauthor_user_ids"
"body":"get_nonauthor_user_ids()"
"Retrieve the number of database queries during the WordPress execution.":
"prefix":"get_num_queries"
"body":"get_num_queries()"
"Return the names or objects of the taxonomies which are registered for the requested object or object type, such as
a post object or post type name.":
"prefix":"get_object_taxonomies"
"body":"get_object_taxonomies( ${1:\\$object}${2:, \\$output = 'names'} )"
"Retrieves the taxonomy relationship to the term object id.":
"prefix":"get_object_term_cache"
"body":"get_object_term_cache( ${1:\\$id}${2:, \\$taxonomy} )"
"Retrieve object_ids of valid taxonomy and term.":
"prefix":"get_objects_in_term"
"body":"get_objects_in_term( ${1:\\$term_ids}${2:, \\$taxonomies}${3:, \\$args = array()} )"
"Retrieves the oEmbed endpoint URL for a given permalink.":
"prefix":"get_oembed_endpoint_url"
"body":"get_oembed_endpoint_url( ${1:\\$permalink = ''}${2:, \\$format = 'json'} )"
"Retrieves the oEmbed response data for a given post.":
"prefix":"get_oembed_response_data"
"body":"get_oembed_response_data( ${1:\\$post}${2:, \\$width} )"
"Filters the oEmbed response data to return an iframe embed code.":
"prefix":"get_oembed_response_data_rich"
"body":"get_oembed_response_data_rich( ${1:\\$data}${2:, \\$post}${3:, \\$width}${4:, \\$height} )"
"Retrieves an option value based on an option name.":
"prefix":"get_option"
"body":"get_option( ${1:\\$option}${2:, \\$default = false} )"
"Retrieve drafts from other users.":
"prefix":"get_others_drafts"
"body":"get_others_drafts( ${1:\\$user_id} )"
"Retrieve pending review posts from other users.":
"prefix":"get_others_pending"
"body":"get_others_pending( ${1:\\$user_id} )"
"Retrieves editable posts from other users.":
"prefix":"get_others_unpublished_posts"
"body":"get_others_unpublished_posts( ${1:\\$user_id}${2:, \\$type = 'any'} )"
"Retrieves page data given a page ID or page object.":
"prefix":"get_page"
"body":"get_page( ${1:\\$page}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves a page given its path.":
"prefix":"get_page_by_path"
"body":"get_page_by_path( ${1:\\$page_path}${2:, \\$output = OBJECT}${3:, \\$post_type = 'page'} )"
"Retrieve a page given its title.":
"prefix":"get_page_by_title"
"body":"get_page_by_title( ${1:\\$page_title}${2:, \\$output = OBJECT}${3:, \\$post_type = 'page'} )"
"Identify descendants of a given page ID in a list of page objects.":
"prefix":"get_page_children"
"body":"get_page_children( ${1:\\$page_id}${2:, \\$pages} )"
"Order the pages with children under parents in a flat list.":
"prefix":"get_page_hierarchy"
"body":"get_page_hierarchy( ${1:\\$pages}${2:, \\$page_id} )"
"Retrieves the permalink for the current page or page ID.":
"prefix":"get_page_link"
"body":"get_page_link( ${1:\\$post = false}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Calculate what page number a comment will appear on for comment paging.":
"prefix":"get_page_of_comment"
"body":"get_page_of_comment( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Retrieve all of the WordPress support page statuses.":
"prefix":"get_page_statuses"
"body":"get_page_statuses()"
"Retrieve path of page template in current or parent template.":
"prefix":"get_page_template"
"body":"get_page_template()"
"Get the specific template name for a given post.":
"prefix":"get_page_template_slug"
"body":"get_page_template_slug( ${1:\\$post = null} )"
"Get the Page Templates available in this theme":
"prefix":"get_page_templates"
"body":"get_page_templates( ${1:\\$post = null}${2:, \\$post_type = 'page'} )"
"Build the URI path for a page.":
"prefix":"get_page_uri"
"body":"get_page_uri( ${1:\\$page} )"
"Retrieve path of paged template in current or parent template.":
"prefix":"get_paged_template"
"body":"get_paged_template()"
"Retrieves the link for a page number.":
"prefix":"get_pagenum_link"
"body":"get_pagenum_link( ${1:\\$pagenum = 1}${2:, \\$escape = true} )"
"Retrieve a list of pages (or hierarchical post type items).":
"prefix":"get_pages"
"body":"get_pages( ${1:\\$args = array()} )"
"Get parent post relational link.":
"prefix":"get_parent_post_rel_link"
"body":"get_parent_post_rel_link( ${1:\\$title = '%title'} )"
"Retrieves the path of a file in the parent theme.":
"prefix":"get_parent_theme_file_path"
"body":"get_parent_theme_file_path( ${1:\\$file = ''} )"
"Retrieves the URL of a file in the parent theme.":
"prefix":"get_parent_theme_file_uri"
"body":"get_parent_theme_file_uri( ${1:\\$file = ''} )"
"Creates, stores, then returns a password reset key for user.":
"prefix":"get_password_reset_key"
"body":"get_password_reset_key( ${1:\\$user} )"
"Get the number of pending comments on a post or posts":
"prefix":"get_pending_comments_num"
"body":"get_pending_comments_num( ${1:\\$post_id} )"
"Retrieves the full permalink for the current post or post ID.":
"prefix":"get_permalink"
"body":"get_permalink( ${1:\\$post}${2:, \\$leavename = false} )"
"Parses the plugin contents to retrieve plugin's metadata.":
"prefix":"get_plugin_data"
"body":"get_plugin_data( ${1:\\$plugin_file}${2:, \\$markup = true}${3:, \\$translate = true} )"
"Get a list of a plugin's files.":
"prefix":"get_plugin_files"
"body":"get_plugin_files( ${1:\\$plugin} )"
"get_plugin_page_hook":
"prefix":"get_plugin_page_hook"
"body":"get_plugin_page_hook( ${1:\\$plugin_page}${2:, \\$parent_page} )"
"get_plugin_page_hookname":
"prefix":"get_plugin_page_hookname"
"body":"get_plugin_page_hookname( ${1:\\$plugin_page}${2:, \\$parent_page} )"
"get_plugin_updates":
"prefix":"get_plugin_updates"
"body":"get_plugin_updates()"
"Check the plugins directory and retrieve all plugin files with plugin data.":
"prefix":"get_plugins"
"body":"get_plugins( ${1:\\$plugin_folder = ''} )"
"Retrieves post data given a post ID or post object.":
"prefix":"get_post"
"body":"get_post( ${1:\\$post = null}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve ancestors of a post.":
"prefix":"get_post_ancestors"
"body":"get_post_ancestors( ${1:\\$post} )"
"Retrieves the classes for the post div as an array.":
"prefix":"get_post_class"
"body":"get_post_class( ${1:\\$class = ''}${2:, \\$post_id = null} )"
"Retrieves the permalink for the post comments feed.":
"prefix":"get_post_comments_feed_link"
"body":"get_post_comments_feed_link( ${1:\\$post_id}${2:, \\$feed = ''} )"
"Retrieve post meta fields, based on post ID.":
"prefix":"get_post_custom"
"body":"get_post_custom( ${1:\\$post_id} )"
"Retrieve meta field names for a post.":
"prefix":"get_post_custom_keys"
"body":"get_post_custom_keys( ${1:\\$post_id} )"
"Retrieve values for a custom post field.":
"prefix":"get_post_custom_values"
"body":"get_post_custom_values( ${1:\\$key = ''}${2:, \\$post_id} )"
"Retrieves the embed code for a specific post.":
"prefix":"get_post_embed_html"
"body":"get_post_embed_html( ${1:\\$width}${2:, \\$height}${3:, \\$post = null} )"
"Retrieves the URL to embed a specific post in an iframe.":
"prefix":"get_post_embed_url"
"body":"get_post_embed_url( ${1:\\$post = null} )"
"Retrieve data from a post field based on Post ID.":
"prefix":"get_post_field"
"body":"get_post_field( ${1:\\$field}${2:, \\$post = null}${3:, \\$context = 'display'} )"
"Retrieve the format slug for a post":
"prefix":"get_post_format"
"body":"get_post_format( ${1:\\$post = null} )"
"Returns a link to a post format index.":
"prefix":"get_post_format_link"
"body":"get_post_format_link( ${1:\\$format} )"
"Retrieves an array of post format slugs.":
"prefix":"get_post_format_slugs"
"body":"get_post_format_slugs()"
"Returns a pretty, translated version of a post format slug":
"prefix":"get_post_format_string"
"body":"get_post_format_string( ${1:\\$slug} )"
"Returns an array of post format slugs to their translated and pretty display versions":
"prefix":"get_post_format_strings"
"body":"get_post_format_strings()"
"Retrieves galleries from the passed post's content.":
"prefix":"get_post_galleries"
"body":"get_post_galleries( ${1:\\$post}${2:, \\$html = true} )"
"Retrieve the image srcs from galleries from a post's content, if present":
"prefix":"get_post_galleries_images"
"body":"get_post_galleries_images( ${1:\\$post} )"
"Check a specified post's content for gallery and, if present, return the first":
"prefix":"get_post_gallery"
"body":"get_post_gallery( ${1:\\$post}${2:, \\$html = true} )"
"Checks a post's content for galleries and return the image srcs for the first found gallery":
"prefix":"get_post_gallery_images"
"body":"get_post_gallery_images( ${1:\\$post} )"
"Retrieve post meta field for a post.":
"prefix":"get_post_meta"
"body":"get_post_meta( ${1:\\$post_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Get post meta data by meta ID.":
"prefix":"get_post_meta_by_id"
"body":"get_post_meta_by_id( ${1:\\$mid} )"
"Retrieve the mime type of an attachment based on the ID.":
"prefix":"get_post_mime_type"
"body":"get_post_mime_type( ${1:\\$ID = ''} )"
"Get default post mime types.":
"prefix":"get_post_mime_types"
"body":"get_post_mime_types()"
"Retrieve the time at which the post was last modifiedre":
"prefix":"get_post_modified_time"
"body":"get_post_modified_time( ${1:\\$d = 'U'}${2:, \\$gmt = false}${3:, \\$post = null}${4:, \\$translate = false} )"
"Retrieves the permalink for a post of a custom post type.":
"prefix":"get_post_permalink"
"body":"get_post_permalink( ${1:\\$id}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Retrieve HTML content for reply to post link.":
"prefix":"get_post_reply_link"
"body":"get_post_reply_link( ${1:\\$args = array()}${2:, \\$post = null} )"
"Get a list of post statuses.":
"prefix":"get_post_stati"
"body":"get_post_stati( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieve the post status based on the Post ID.":
"prefix":"get_post_status"
"body":"get_post_status( ${1:\\$ID = ''} )"
"Retrieve a post status object by name.":
"prefix":"get_post_status_object"
"body":"get_post_status_object( ${1:\\$post_status} )"
"Retrieve all of the WordPress supported post statuses.":
"prefix":"get_post_statuses"
"body":"get_post_statuses()"
"Retrieve all taxonomies of a post with just the names.":
"prefix":"get_post_taxonomies"
"body":"get_post_taxonomies( ${1:\\$post} )"
"Retrieve post thumbnail ID.":
"prefix":"get_post_thumbnail_id"
"body":"get_post_thumbnail_id( ${1:\\$post = null} )"
"Retrieve the time at which the post was written.":
"prefix":"get_post_time"
"body":"get_post_time( ${1:\\$d = 'U'}${2:, \\$gmt = false}${3:, \\$post = null}${4:, \\$translate = false} )"
"Gets an existing post and format it for editing.":
"prefix":"get_post_to_edit"
"body":"get_post_to_edit( ${1:\\$id} )"
"Retrieves the post type of the current post or of a given post.":
"prefix":"get_post_type"
"body":"get_post_type( ${1:\\$post = null} )"
"Retrieves the permalink for a post type archive feed.":
"prefix":"get_post_type_archive_feed_link"
"body":"get_post_type_archive_feed_link( ${1:\\$post_type}${2:, \\$feed = ''} )"
"Retrieves the permalink for a post type archive.":
"prefix":"get_post_type_archive_link"
"body":"get_post_type_archive_link( ${1:\\$post_type} )"
"Retrieve path of post type archive template in current or parent template.":
"prefix":"get_post_type_archive_template"
"body":"get_post_type_archive_template()"
"Build an object with all post type capabilities out of a post type object":
"prefix":"get_post_type_capabilities"
"body":"get_post_type_capabilities( ${1:\\$args} )"
"Builds an object with all post type labels out of a post type object.":
"prefix":"get_post_type_labels"
"body":"get_post_type_labels( ${1:\\$post_type_object} )"
"Retrieves a post type object by name.":
"prefix":"get_post_type_object"
"body":"get_post_type_object( ${1:\\$post_type} )"
"Get a list of all registered post type objects.":
"prefix":"get_post_types"
"body":"get_post_types( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieves a list of post type names that support a specific feature.":
"prefix":"get_post_types_by_support"
"body":"get_post_types_by_support( ${1:\\$feature}${2:, \\$operator = 'and'} )"
"Retrieves all post data for a given post.":
"prefix":"get_postdata"
"body":"get_postdata( ${1:\\$postid} )"
"Retrieve list of latest posts or posts matching criteria.":
"prefix":"get_posts"
"body":"get_posts( ${1:\\$args = null} )"
"Retrieve the post SQL based on capability, author, and type.":
"prefix":"get_posts_by_author_sql"
"body":"get_posts_by_author_sql( ${1:\\$post_type}${2:, \\$full = true}${3:, \\$post_author = null}${4:, \\$public_only = false} )"
"Retrieves the post pages link navigation for previous and next pages.":
"prefix":"get_posts_nav_link"
"body":"get_posts_nav_link( ${1:\\$args = array()} )"
"Selects the first update version from the update_core option.":
"prefix":"get_preferred_from_update_core"
"body":"get_preferred_from_update_core()"
"Retrieves the URL used for the post preview.":
"prefix":"get_preview_post_link"
"body":"get_preview_post_link( ${1:\\$post = null}${2:, \\$query_args = array()}${3:, \\$preview_link = ''} )"
"Retrieves the link to the previous comments page.":
"prefix":"get_previous_comments_link"
"body":"get_previous_comments_link( ${1:\\$label = ''} )"
"Retrieves the previous post that is adjacent to the current post.":
"prefix":"get_previous_post"
"body":"get_previous_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$taxonomy = 'category'} )"
"Retrieves the previous post link that is adjacent to the current post.":
"prefix":"get_previous_post_link"
"body":"get_previous_post_link( ${1:\\$format = '« %link'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Retrieves the previous posts link.":
"prefix":"get_previous_posts_link"
"body":"get_previous_posts_link( ${1:\\$label = null} )"
"Retrieves the previous posts page link.":
"prefix":"get_previous_posts_page_link"
"body":"get_previous_posts_page_link()"
"Retrieve the private post SQL based on capability.":
"prefix":"get_private_posts_cap_sql"
"body":"get_private_posts_cap_sql( ${1:\\$post_type} )"
"Retrieve user data based on field.":
"prefix":"get_profile"
"body":"get_profile( ${1:\\$field}${2:, \\$user = false} )"
"Retrieve URLs already pinged for a post.":
"prefix":"get_pung"
"body":"get_pung( ${1:\\$post_id} )"
"Retrieve the currently-queried object.":
"prefix":"get_queried_object"
"body":"get_queried_object()"
"Retrieve ID of the current queried object.":
"prefix":"get_queried_object_id"
"body":"get_queried_object_id()"
"Retrieve path to a template":
"prefix":"get_query_template"
"body":"get_query_template( ${1:\\$type}${2:, \\$templates = array()} )"
"Retrieve variable in the WP_Query class.":
"prefix":"get_query_var"
"body":"get_query_var( ${1:\\$var}${2:, \\$default = ''} )"
"Get random header image url from registered images in theme.":
"prefix":"get_random_header_image"
"body":"get_random_header_image()"
"Get the raw theme root relative to the content directory with no filters applied.":
"prefix":"get_raw_theme_root"
"body":"get_raw_theme_root( ${1:\\$stylesheet_or_template}${2:, \\$skip_cache = false} )"
"Get the real filesystem path to a file to edit within the admin.":
"prefix":"get_real_file_to_edit"
"body":"get_real_file_to_edit( ${1:\\$file} )"
"Retrieves a list of registered meta keys for an object type.":
"prefix":"get_registered_meta_keys"
"body":"get_registered_meta_keys( ${1:\\$object_type} )"
"Retrieves registered metadata for a specified object.":
"prefix":"get_registered_metadata"
"body":"get_registered_metadata( ${1:\\$object_type}${2:, \\$object_id}${3:, \\$meta_key = ''} )"
"Retrieves all registered navigation menu locations in a theme.":
"prefix":"get_registered_nav_menus"
"body":"get_registered_nav_menus()"
"Retrieves an array of registered settings.":
"prefix":"get_registered_settings"
"body":"get_registered_settings()"
"Retrieves the URL to a REST endpoint on a site.":
"prefix":"get_rest_url"
"body":"get_rest_url( ${1:\\$blog_id = null}${2:, \\$path = '/'}${3:, \\$scheme = 'rest'} )"
"Retrieve role object.":
"prefix":"get_role"
"body":"get_role( ${1:\\$role} )"
"Display RSS items in HTML list items.":
"prefix":"get_rss"
"body":"get_rss( ${1:\\$url}${2:, \\$num_items = 5} )"
"Get a sample permalink based off of the post name.":
"prefix":"get_sample_permalink"
"body":"get_sample_permalink( ${1:\\$id}${2:, \\$title = null}${3:, \\$name = null} )"
"Returns the HTML of the sample permalink slug editor.":
"prefix":"get_sample_permalink_html"
"body":"get_sample_permalink_html( ${1:\\$id}${2:, \\$new_title = null}${3:, \\$new_slug = null} )"
"Retrieves the screen icon (no longer used in 3.8+).":
"prefix":"get_screen_icon"
"body":"get_screen_icon()"
"Retrieves the permalink for the search results comments feed.":
"prefix":"get_search_comments_feed_link"
"body":"get_search_comments_feed_link( ${1:\\$search_query = ''}${2:, \\$feed = ''} )"
"Retrieves the permalink for the search results feed.":
"prefix":"get_search_feed_link"
"body":"get_search_feed_link( ${1:\\$search_query = ''}${2:, \\$feed = ''} )"
"Display search form.":
"prefix":"get_search_form"
"body":"get_search_form( ${1:\\$echo = true} )"
"Retrieves the permalink for a search.":
"prefix":"get_search_link"
"body":"get_search_link( ${1:\\$query = ''} )"
"Retrieves the contents of the search WordPress query variable.":
"prefix":"get_search_query"
"body":"get_search_query( ${1:\\$escaped = true} )"
"Retrieve path of search template in current or parent template.":
"prefix":"get_search_template"
"body":"get_search_template()"
"Get value based on option.":
"prefix":"get_settings"
"body":"get_settings( ${1:\\$option} )"
"Fetch settings errors registered by add_settings_error()":
"prefix":"get_settings_errors"
"body":"get_settings_errors( ${1:\\$setting = ''}${2:, \\$sanitize = false} )"
"Retrieve the shortcode attributes regex.":
"prefix":"get_shortcode_atts_regex"
"body":"get_shortcode_atts_regex()"
"Retrieve the shortcode regular expression for searching.":
"prefix":"get_shortcode_regex"
"body":"get_shortcode_regex( ${1:\\$tagnames = null} )"
"Retrieves the Press This bookmarklet link.":
"prefix":"get_shortcut_link"
"body":"get_shortcut_link()"
"Load sidebar template.":
"prefix":"get_sidebar"
"body":"get_sidebar( ${1:\\$name = null} )"
"Retrieve path of single template in current or parent template. Applies to single Posts,
single Attachments, and single custom post types.":
"prefix":"get_single_template"
"body":"get_single_template()"
"Retrieves the path of the singular template in current or parent template.":
"prefix":"get_singular_template"
"body":"get_singular_template()"
"Retrieves site data given a site ID or site object.":
"prefix":"get_site"
"body":"get_site( ${1:\\$site = null} )"
"Deprecated functionality for getting themes network-enabled themes.":
"prefix":"get_site_allowed_themes"
"body":"get_site_allowed_themes()"
"Retrieves the closest matching site object by its domain and path.":
"prefix":"get_site_by_path"
"body":"get_site_by_path( ${1:\\$domain}${2:, \\$path}${3:, \\$segments = null} )"
"Returns the Site Icon URL.":
"prefix":"get_site_icon_url"
"body":"get_site_icon_url( ${1:\\$size = 512}${2:, \\$url = ''}${3:, \\$blog_id} )"
"Retrieve an option value for the current network based on name of option.":
"prefix":"get_site_option"
"body":"get_site_option( ${1:\\$option}${2:, \\$default = false}${3:, \\$deprecated = true} )"
"Get the value of a site transient.":
"prefix":"get_site_transient"
"body":"get_site_transient( ${1:\\$transient} )"
"Retrieves the URL for a given site where WordPress application files
(e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.":
"prefix":"get_site_url"
"body":"get_site_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = null} )"
"Retrieves a list of sites matching requested arguments.":
"prefix":"get_sites"
"body":"get_sites( ${1:\\$args = array()} )"
"Gets the network's site and user counts.":
"prefix":"get_sitestats"
"body":"get_sitestats()"
"Returns the upload quota for the current blog.":
"prefix":"get_space_allowed"
"body":"get_space_allowed()"
"Returns the space used by the current blog.":
"prefix":"get_space_used"
"body":"get_space_used()"
"Retrieve the description for the HTTP status.":
"prefix":"get_status_header_desc"
"body":"get_status_header_desc( ${1:\\$code} )"
"Retrieve name of the current stylesheet.":
"prefix":"get_stylesheet"
"body":"get_stylesheet()"
"Retrieve stylesheet directory path for current theme.":
"prefix":"get_stylesheet_directory"
"body":"get_stylesheet_directory()"
"Retrieve stylesheet directory URI.":
"prefix":"get_stylesheet_directory_uri"
"body":"get_stylesheet_directory_uri()"
"Retrieves the URI of current theme stylesheet.":
"prefix":"get_stylesheet_uri"
"body":"get_stylesheet_uri()"
"Retrieves a list of reserved site on a sub-directory Multisite install.":
"prefix":"get_subdirectory_reserved_names"
"body":"get_subdirectory_reserved_names()"
"Returns a submit button, with provided text and appropriate class":
"prefix":"get_submit_button"
"body":"get_submit_button( ${1:\\$text = ''}${2:, \\$type = 'primary large'}${3:, \\$name = 'submit'}${4:, \\$wrap = true}${5:, \\$other_attributes = ''} )"
"Retrieve a list of super admins.":
"prefix":"get_super_admins"
"body":"get_super_admins()"
"Retrieve post tag by tag ID or tag object.":
"prefix":"get_tag"
"body":"get_tag( ${1:\\$tag}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves the permalink for a tag feed.":
"prefix":"get_tag_feed_link"
"body":"get_tag_feed_link( ${1:\\$tag_id}${2:, \\$feed = ''} )"
"Retrieve the link to the tag.":
"prefix":"get_tag_link"
"body":"get_tag_link( ${1:\\$tag} )"
"Return RegEx body to liberally match an opening HTML tag.":
"prefix":"get_tag_regex"
"body":"get_tag_regex( ${1:\\$tag} )"
"Retrieve path of tag template in current or parent template.":
"prefix":"get_tag_template"
"body":"get_tag_template()"
"Retrieves all post tags.":
"prefix":"get_tags"
"body":"get_tags( ${1:\\$args = ''} )"
"Get comma-separated list of tags available to edit.":
"prefix":"get_tags_to_edit"
"body":"get_tags_to_edit( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'} )"
"Given a taxonomy query, generates SQL to be appended to a main query.":
"prefix":"get_tax_sql"
"body":"get_tax_sql( ${1:\\$tax_query}${2:, \\$primary_table}${3:, \\$primary_id_column} )"
"Retrieves a list of registered taxonomy names or objects.":
"prefix":"get_taxonomies"
"body":"get_taxonomies( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieves all of the taxonomy names that are registered for attachments.":
"prefix":"get_taxonomies_for_attachments"
"body":"get_taxonomies_for_attachments( ${1:\\$output = 'names'} )"
"Retrieves the taxonomy object of $taxonomy.":
"prefix":"get_taxonomy"
"body":"get_taxonomy( ${1:\\$taxonomy} )"
"Builds an object with all taxonomy labels out of a taxonomy object.":
"prefix":"get_taxonomy_labels"
"body":"get_taxonomy_labels( ${1:\\$tax} )"
"Retrieve path of custom taxonomy term template in current or parent template.":
"prefix":"get_taxonomy_template"
"body":"get_taxonomy_template()"
"Determine a writable directory for temporary files.":
"prefix":"get_temp_dir"
"body":"get_temp_dir()"
"Retrieve name of the current theme.":
"prefix":"get_template"
"body":"get_template()"
"Retrieve current theme directory.":
"prefix":"get_template_directory"
"body":"get_template_directory()"
"Retrieve theme directory URI.":
"prefix":"get_template_directory_uri"
"body":"get_template_directory_uri()"
"Loads a template part into a template.":
"prefix":"get_template_part"
"body":"get_template_part( ${1:\\$slug}${2:, \\$name = null} )"
"Get all Term data from database by Term ID.":
"prefix":"get_term"
"body":"get_term( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$output = OBJECT}${4:, \\$filter = 'raw'} )"
"Get all Term data from database by Term field and data.":
"prefix":"get_term_by"
"body":"get_term_by( ${1:\\$field}${2:, \\$value}${3:, \\$taxonomy = ''}${4:, \\$output = OBJECT}${5:, \\$filter = 'raw'} )"
"Merge all term children into a single array of their IDs.":
"prefix":"get_term_children"
"body":"get_term_children( ${1:\\$term_id}${2:, \\$taxonomy} )"
"Retrieves the feed link for a term.":
"prefix":"get_term_feed_link"
"body":"get_term_feed_link( ${1:\\$term_id}${2:, \\$taxonomy = 'category'}${3:, \\$feed = ''} )"
"Get sanitized Term field.":
"prefix":"get_term_field"
"body":"get_term_field( ${1:\\$field}${2:, \\$term}${3:, \\$taxonomy = ''}${4:, \\$context = 'display'} )"
"Generate a permalink for a taxonomy term archive.":
"prefix":"get_term_link"
"body":"get_term_link( ${1:\\$term}${2:, \\$taxonomy = ''} )"
"Retrieves metadata for a term.":
"prefix":"get_term_meta"
"body":"get_term_meta( ${1:\\$term_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Retrieve term parents with separator.":
"prefix":"get_term_parents_list"
"body":"get_term_parents_list( ${1:\\$term_id}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Sanitizes Term for editing.":
"prefix":"get_term_to_edit"
"body":"get_term_to_edit( ${1:\\$id}${2:, \\$taxonomy} )"
"Retrieve the terms in a given taxonomy or list of taxonomies.":
"prefix":"get_terms"
"body":"get_terms( ${1:\\$args = array()}${2:, \\$deprecated = ''} )"
"Get comma-separated list of terms available to edit for the given post ID.":
"prefix":"get_terms_to_edit"
"body":"get_terms_to_edit( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'} )"
"Retrieves the description for an author, post type, or term archive.":
"prefix":"get_the_archive_description"
"body":"get_the_archive_description()"
"Retrieve the archive title based on the queried object.":
"prefix":"get_the_archive_title"
"body":"get_the_archive_title()"
"Retrieve HTML content of attachment image with link.":
"prefix":"get_the_attachment_link"
"body":"get_the_attachment_link( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false}${4:, \\$permalink = false} )"
"Retrieve the author of the current post.":
"prefix":"get_the_author"
"body":"get_the_author( ${1:\\$deprecated = ''} )"
"Retrieve the AIM address of the author of the current post.":
"prefix":"get_the_author_aim"
"body":"get_the_author_aim()"
"Retrieve the description of the author of the current post.":
"prefix":"get_the_author_description"
"body":"get_the_author_description()"
"Retrieve the email of the author of the current post.":
"prefix":"get_the_author_email"
"body":"get_the_author_email()"
"Retrieve the first name of the author of the current post.":
"prefix":"get_the_author_firstname"
"body":"get_the_author_firstname()"
"Retrieve the ICQ number of the author of the current post.":
"prefix":"get_the_author_icq"
"body":"get_the_author_icq()"
"Retrieve the ID of the author of the current post.":
"prefix":"get_the_author_id"
"body":"get_the_author_id()"
"Retrieve the last name of the author of the current post.":
"prefix":"get_the_author_lastname"
"body":"get_the_author_lastname()"
"Retrieve either author's link or author's name.":
"prefix":"get_the_author_link"
"body":"get_the_author_link()"
"Retrieve the login name of the author of the current post.":
"prefix":"get_the_author_login"
"body":"get_the_author_login()"
"Retrieves the requested data of the author of the current post.":
"prefix":"get_the_author_meta"
"body":"get_the_author_meta( ${1:\\$field = ''}${2:, \\$user_id = false} )"
"Retrieve the MSN address of the author of the current post.":
"prefix":"get_the_author_msn"
"body":"get_the_author_msn()"
"Retrieve the nickname of the author of the current post.":
"prefix":"get_the_author_nickname"
"body":"get_the_author_nickname()"
"Retrieve the number of posts by the author of the current post.":
"prefix":"get_the_author_posts"
"body":"get_the_author_posts()"
"Retrieves an HTML link to the author page of the current post's author.":
"prefix":"get_the_author_posts_link"
"body":"get_the_author_posts_link()"
"Retrieve the URL to the home page of the author of the current post.":
"prefix":"get_the_author_url"
"body":"get_the_author_url()"
"Retrieve the Yahoo! IM name of the author of the current post.":
"prefix":"get_the_author_yim"
"body":"get_the_author_yim()"
"Retrieve post categories.":
"prefix":"get_the_category"
"body":"get_the_category( ${1:\\$id = false} )"
"Retrieve category name based on category ID.":
"prefix":"get_the_category_by_id"
"body":"get_the_category_by_id( ${1:\\$cat_ID} )"
"Retrieve category list for a post in either HTML list or custom format.":
"prefix":"get_the_category_list"
"body":"get_the_category_list( ${1:\\$separator = ''}${2:, \\$parents = ''}${3:, \\$post_id = false} )"
"Retrieve all of the post categories, formatted for use in feeds.":
"prefix":"get_the_category_rss"
"body":"get_the_category_rss( ${1:\\$type = null} )"
"Retrieves navigation to next/previous set of comments, when applicable.":
"prefix":"get_the_comments_navigation"
"body":"get_the_comments_navigation( ${1:\\$args = array()} )"
"Retrieves a paginated navigation to next/previous set of comments, when applicable.":
"prefix":"get_the_comments_pagination"
"body":"get_the_comments_pagination( ${1:\\$args = array()} )"
"Retrieve the post content.":
"prefix":"get_the_content"
"body":"get_the_content( ${1:\\$more_link_text = null}${2:, \\$strip_teaser = false} )"
"Retrieve the post content for feeds.":
"prefix":"get_the_content_feed"
"body":"get_the_content_feed( ${1:\\$feed_type = null} )"
"Retrieve the date on which the post was written.":
"prefix":"get_the_date"
"body":"get_the_date( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieves the post excerpt.":
"prefix":"get_the_excerpt"
"body":"get_the_excerpt( ${1:\\$post = null} )"
"Creates the generator XML or Comment for RSS, ATOM, etc.":
"prefix":"get_the_generator"
"body":"get_the_generator( ${1:\\$type = ''} )"
"Retrieve the Post Global Unique Identifier (guid).":
"prefix":"get_the_guid"
"body":"get_the_guid( ${1:\\$post} )"
"Retrieve the ID of the current item in the WordPress Loop.":
"prefix":"get_the_id"
"body":"get_the_id()"
"Retrieve the author who last edited the current post.":
"prefix":"get_the_modified_author"
"body":"get_the_modified_author()"
"Retrieve the date on which the post was last modified.":
"prefix":"get_the_modified_date"
"body":"get_the_modified_date( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve the time at which the post was last modified.":
"prefix":"get_the_modified_time"
"body":"get_the_modified_time( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve protected post password form content.":
"prefix":"get_the_password_form"
"body":"get_the_password_form( ${1:\\$post} )"
"Retrieves the full permalink for the current post or post ID":
"prefix":"get_the_permalink"
"body":"get_the_permalink( ${1:\\$post}${2:, \\$leavename = false} )"
"Retrieves the navigation to next/previous post, when applicable.":
"prefix":"get_the_post_navigation"
"body":"get_the_post_navigation( ${1:\\$args = array()} )"
"Retrieve the post thumbnail.":
"prefix":"get_the_post_thumbnail"
"body":"get_the_post_thumbnail( ${1:\\$post = null}${2:, \\$size = 'post-thumbnail'}${3:, \\$attr = ''} )"
"Returns the post thumbnail caption.":
"prefix":"get_the_post_thumbnail_caption"
"body":"get_the_post_thumbnail_caption( ${1:\\$post = null} )"
"Return the post thumbnail URL.":
"prefix":"get_the_post_thumbnail_url"
"body":"get_the_post_thumbnail_url( ${1:\\$post = null}${2:, \\$size = 'post-thumbnail'} )"
"Returns the navigation to next/previous set of posts, when applicable.":
"prefix":"get_the_posts_navigation"
"body":"get_the_posts_navigation( ${1:\\$args = array()} )"
"Retrieves a paginated navigation to next/previous set of posts, when applicable.":
"prefix":"get_the_posts_pagination"
"body":"get_the_posts_pagination( ${1:\\$args = array()} )"
"Retrieve the tags for a post formatted as a string.":
"prefix":"get_the_tag_list"
"body":"get_the_tag_list( ${1:\\$before = ''}${2:, \\$sep = ''}${3:, \\$after = ''}${4:, \\$id} )"
"Retrieve the tags for a post. get_the_tags":
"prefix":"get_the_tags"
"body":"get_the_tags( ${1:\\$id} )"
"Retrieve all taxonomies associated with a post.":
"prefix":"get_the_taxonomies"
"body":"get_the_taxonomies( ${1:\\$post}${2:, \\$args = array()} )"
"Retrieve a post's terms as a list with specified format.":
"prefix":"get_the_term_list"
"body":"get_the_term_list( ${1:\\$id}${2:, \\$taxonomy}${3:, \\$before = ''}${4:, \\$sep = ''}${5:, \\$after = ''} )"
"Retrieve the terms of the taxonomy that are attached to the post.":
"prefix":"get_the_terms"
"body":"get_the_terms( ${1:\\$post}${2:, \\$taxonomy} )"
"Retrieve the time at which the post was written":
"prefix":"get_the_time"
"body":"get_the_time( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve post title.":
"prefix":"get_the_title"
"body":"get_the_title( ${1:\\$post} )"
"Retrieve the current post title for the feed.":
"prefix":"get_the_title_rss"
"body":"get_the_title_rss()"
"Retrieve theme data.":
"prefix":"get_theme"
"body":"get_theme( ${1:\\$theme} )"
"Retrieve theme data from parsed theme file.":
"prefix":"get_theme_data"
"body":"get_theme_data( ${1:\\$theme_file} )"
"Retrieve list of WordPress theme features (aka theme tags)":
"prefix":"get_theme_feature_list"
"body":"get_theme_feature_list( ${1:\\$api = true} )"
"Retrieves the path of a file in the theme.":
"prefix":"get_theme_file_path"
"body":"get_theme_file_path( ${1:\\$file = ''} )"
"Retrieves the URL of a file in the theme.":
"prefix":"get_theme_file_uri"
"body":"get_theme_file_uri( ${1:\\$file = ''} )"
"Retrieve theme modification value for the current theme.":
"prefix":"get_theme_mod"
"body":"get_theme_mod( ${1:\\$name}${2:, \\$default = false} )"
"Retrieve all theme modifications.":
"prefix":"get_theme_mods"
"body":"get_theme_mods()"
"Retrieve path to themes directory.":
"prefix":"get_theme_root"
"body":"get_theme_root( ${1:\\$stylesheet_or_template = false} )"
"Retrieve URI for themes directory.":
"prefix":"get_theme_root_uri"
"body":"get_theme_root_uri( ${1:\\$stylesheet_or_template = false}${2:, \\$theme_root = false} )"
"Retrieve theme roots.":
"prefix":"get_theme_roots"
"body":"get_theme_roots()"
"Expand a theme's starter content configuration using core-provided data.":
"prefix":"get_theme_starter_content"
"body":"get_theme_starter_content()"
"Gets the theme support arguments passed when registering that support":
"prefix":"get_theme_support"
"body":"get_theme_support( ${1:\\$feature} )"
"Retrieve the update link if there is a theme update available.":
"prefix":"get_theme_update_available"
"body":"get_theme_update_available( ${1:\\$theme} )"
"get_theme_updates":
"prefix":"get_theme_updates"
"body":"get_theme_updates()"
"Retrieve list of themes with theme data in theme directory.":
"prefix":"get_themes"
"body":"get_themes()"
"Retrieve URLs that need to be pinged.":
"prefix":"get_to_ping"
"body":"get_to_ping( ${1:\\$post_id} )"
"Retrieve The current post's trackback URL.":
"prefix":"get_trackback_url"
"body":"get_trackback_url()"
"Get the value of a transient.":
"prefix":"get_transient"
"body":"get_transient( ${1:\\$transient} )"
"Return the Translations instance for a text domain.":
"prefix":"get_translations_for_domain"
"body":"get_translations_for_domain( ${1:\\$domain} )"
"Calculated the new dimensions for a downsampled image.":
"prefix":"get_udims"
"body":"get_udims( ${1:\\$width}${2:, \\$height} )"
"get_upload_iframe_src":
"prefix":"get_upload_iframe_src"
"body":"get_upload_iframe_src( ${1:\\$type = null}${2:, \\$post_id = null}${3:, \\$tab = null} )"
"Determines if there is any upload space left in the current blog's quota":
"prefix":"get_upload_space_available"
"body":"get_upload_space_available()"
"Get the header images uploaded for the current theme.":
"prefix":"get_uploaded_header_images"
"body":"get_uploaded_header_images()"
"Extract and return the first URL from passed content.":
"prefix":"get_url_in_content"
"body":"get_url_in_content( ${1:\\$content} )"
"Retrieve user info by a given field":
"prefix":"get_user_by"
"body":"get_user_by( ${1:\\$field}${2:, \\$value} )"
"Retrieve user info by email.":
"prefix":"get_user_by_email"
"body":"get_user_by_email( ${1:\\$email} )"
"The number of active users in your installation.":
"prefix":"get_user_count"
"body":"get_user_count( ${1:\\$network_id = null} )"
"Deprecated functionality to retrieve user information.":
"prefix":"get_user_details"
"body":"get_user_details( ${1:\\$username} )"
"Get a numeric user ID from either an email address or a login.":
"prefix":"get_user_id_from_string"
"body":"get_user_id_from_string( ${1:\\$string} )"
"Retrieves the locale of a user.":
"prefix":"get_user_locale"
"body":"get_user_locale( ${1:\\$user_id} )"
"Retrieve user meta field for a user.":
"prefix":"get_user_meta"
"body":"get_user_meta( ${1:\\$user_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users":
"prefix":"get_user_metavalues"
"body":"get_user_metavalues( ${1:\\$ids} )"
"Retrieve user option that can be either per Site or per Network.":
"prefix":"get_user_option"
"body":"get_user_option( ${1:\\$option}${2:, \\$user}${3:, \\$deprecated = ''} )"
"Retrieve user interface setting value based on setting name.":
"prefix":"get_user_setting"
"body":"get_user_setting( ${1:\\$name}${2:, \\$default = false} )"
"Retrieve user data and filter it.":
"prefix":"get_user_to_edit"
"body":"get_user_to_edit( ${1:\\$user_id} )"
"Retrieve user info by user ID.":
"prefix":"get_userdata"
"body":"get_userdata( ${1:\\$user_id} )"
"Retrieve user info by login name.":
"prefix":"get_userdatabylogin"
"body":"get_userdatabylogin( ${1:\\$user_login} )"
"Retrieve user metadata.":
"prefix":"get_usermeta"
"body":"get_usermeta( ${1:\\$user_id}${2:, \\$meta_key = ''} )"
"Retrieves the number of posts a user has written.":
"prefix":"get_usernumposts"
"body":"get_usernumposts( ${1:\\$userid} )"
"Retrieve list of users matching criteria.":
"prefix":"get_users"
"body":"get_users( ${1:\\$args = array()} )"
"Retrieve the user's drafts.":
"prefix":"get_users_drafts"
"body":"get_users_drafts( ${1:\\$user_id} )"
"Get users for the site.":
"prefix":"get_users_of_blog"
"body":"get_users_of_blog( ${1:\\$id = ''} )"
"Get the week start and end from the datetime or date string from MySQL.":
"prefix":"get_weekstartend"
"body":"get_weekstartend( ${1:\\$mysqlstring}${2:, \\$start_of_week = ''} )"
"Retrieve the blog title for the feed title.":
"prefix":"get_wp_title_rss"
"body":"get_wp_title_rss( ${1:\\$deprecated = '–'} )"
"Retrieves the permalink for the year archives.":
"prefix":"get_year_link"
"body":"get_year_link( ${1:\\$year} )"
"Maintains a canonical list of terms by syncing terms created for each blog with the global terms table.":
"prefix":"global_terms"
"body":"global_terms( ${1:\\$term_id}${2:, \\$deprecated = ''} )"
"Determine whether global terms are enabled.":
"prefix":"global_terms_enabled"
"body":"global_terms_enabled()"
"Returns whether the server is running Apache with the mod_rewrite module loaded.":
"prefix":"got_mod_rewrite"
"body":"got_mod_rewrite()"
"Returns whether the server supports URL rewriting.":
"prefix":"got_url_rewrite"
"body":"got_url_rewrite()"
"Deprecated functionality to gracefully fail.":
"prefix":"graceful_fail"
"body":"graceful_fail()"
"Grants Super Admin privileges.":
"prefix":"grant_super_admin"
"body":"grant_super_admin( ${1:\\$user_id} )"
"Unused function.":
"prefix":"gzip_compression"
"body":"gzip_compression()"
"Check if any action has been registered for a hook.":
"prefix":"has_action"
"body":"has_action( ${1:\\$tag}${2:, \\$function_to_check = false} )"
"Check if the current post has any of given category.":
"prefix":"has_category"
"body":"has_category( ${1:\\$category = ''}${2:, \\$post = null} )"
"Check whether a custom header is set or not.":
"prefix":"has_custom_header"
"body":"has_custom_header()"
"Determines whether the site has a custom logo.":
"prefix":"has_custom_logo"
"body":"has_custom_logo( ${1:\\$blog_id} )"
"Whether the post has a custom excerpt.":
"prefix":"has_excerpt"
"body":"has_excerpt( ${1:\\$post} )"
"Check if any filter has been registered for a hook.":
"prefix":"has_filter"
"body":"has_filter( ${1:\\$tag}${2:, \\$function_to_check = false} )"
"Check whether a header image is set or not.":
"prefix":"has_header_image"
"body":"has_header_image()"
"Check whether a header video is set or not.":
"prefix":"has_header_video"
"body":"has_header_video()"
"Check if an image size exists.":
"prefix":"has_image_size"
"body":"has_image_size( ${1:\\$name} )"
"Get meta data for the given post ID.":
"prefix":"has_meta"
"body":"has_meta( ${1:\\$postid} )"
"Determines whether a registered nav menu location has a menu assigned to it.":
"prefix":"has_nav_menu"
"body":"has_nav_menu( ${1:\\$location} )"
"Check if a post has any of the given formats, or any format.":
"prefix":"has_post_format"
"body":"has_post_format( ${1:\\$format = array()}${2:, \\$post = null} )"
"Check if post has an image attached.":
"prefix":"has_post_thumbnail"
"body":"has_post_thumbnail( ${1:\\$post = null} )"
"Whether the passed content contains the specified shortcode":
"prefix":"has_shortcode"
"body":"has_shortcode( ${1:\\$content}${2:, \\$tag} )"
"Whether the site has a Site Icon.":
"prefix":"has_site_icon"
"body":"has_site_icon( ${1:\\$blog_id} )"
"Check if the current post has any of given tags.":
"prefix":"has_tag"
"body":"has_tag( ${1:\\$tag = ''}${2:, \\$post = null} )"
"Check if the current post has any of given terms.":
"prefix":"has_term"
"body":"has_term( ${1:\\$term = ''}${2:, \\$taxonomy = ''}${3:, \\$post = null} )"
"Get all meta data, including meta IDs, for the given term ID.":
"prefix":"has_term_meta"
"body":"has_term_meta( ${1:\\$term_id} )"
"Timing attack safe string comparison":
"prefix":"hash_equals"
"body":"hash_equals( ${1:\\$a}${2:, \\$b} )"
"Whether there are comments to loop over.":
"prefix":"have_comments"
"body":"have_comments()"
"Whether current WordPress query has results to loop over.":
"prefix":"have_posts"
"body":"have_posts()"
"Display header image URL.":
"prefix":"header_image"
"body":"header_image()"
"Displays the custom header text color in 3- or 6-digit hexadecimal form (minus the hash symbol).":
"prefix":"header_textcolor"
"body":"header_textcolor()"
"Autosave with heartbeat":
"prefix":"heartbeat_autosave"
"body":"heartbeat_autosave( ${1:\\$response}${2:, \\$data} )"
"Retrieves the URL for the current site where the front end is accessible.":
"prefix":"home_url"
"body":"home_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Display the HTML type based on the blog setting.":
"prefix":"html_type_rss"
"body":"html_type_rss()"
"Convert entities, while preserving already-encoded entities.":
"prefix":"htmlentities2"
"body":"htmlentities2( ${1:\\$myHTML} )"
"Determines the difference between two timestamps.":
"prefix":"human_time_diff"
"body":"human_time_diff( ${1:\\$from}${2:, \\$to = ''} )"
"Generic Iframe footer for use with Thickbox":
"prefix":"iframe_footer"
"body":"iframe_footer()"
"Generic Iframe header for use with Thickbox":
"prefix":"iframe_header"
"body":"iframe_header( ${1:\\$title = ''}${2:, \\$deprecated = false} )"
"Add WordPress rewrite rule to the IIS 7+ configuration file.":
"prefix":"iis7_add_rewrite_rule"
"body":"iis7_add_rewrite_rule( ${1:\\$filename}${2:, \\$rewrite_rule} )"
"Delete WordPress rewrite rule from web.config file if it exists there":
"prefix":"iis7_delete_rewrite_rule"
"body":"iis7_delete_rewrite_rule( ${1:\\$filename} )"
"Check if rewrite rule for WordPress already exists in the IIS 7+ configuration file":
"prefix":"iis7_rewrite_rule_exists"
"body":"iis7_rewrite_rule_exists( ${1:\\$filename} )"
"Updates the IIS web.config file with the current rules if it is writable.":
"prefix":"iis7_save_url_rewrite_rules"
"body":"iis7_save_url_rewrite_rules()"
"Check if IIS 7+ supports pretty permalinks.":
"prefix":"iis7_supports_permalinks"
"body":"iis7_supports_permalinks()"
"Adds image shortcode with caption to editor":
"prefix":"image_add_caption"
"body":"image_add_caption( ${1:\\$html}${2:, \\$id}${3:, \\$caption}${4:, \\$title}${5:, \\$align}${6:, \\$url}${7:, \\$size}${8:, \\$alt = ''} )"
"Retrieve HTML for the image alignment radio buttons with the specified one checked.":
"prefix":"image_align_input_fields"
"body":"image_align_input_fields( ${1:\\$post}${2:, \\$checked = ''} )"
"Retrieves the image attachment fields to edit form fields.":
"prefix":"image_attachment_fields_to_edit"
"body":"image_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Filters input from media_upload_form_handler() and assigns a default
post_title from the file name if none supplied.":
"prefix":"image_attachment_fields_to_save"
"body":"image_attachment_fields_to_save( ${1:\\$post}${2:, \\$attachment} )"
"Scale down the default size of an image.":
"prefix":"image_constrain_size_for_editor"
"body":"image_constrain_size_for_editor( ${1:\\$width}${2:, \\$height}${3:, \\$size = 'medium'}${4:, \\$context = null} )"
"Scale an image to fit a particular size (such as 'thumb' or 'medium').":
"prefix":"image_downsize"
"body":"image_downsize( ${1:\\$id}${2:, \\$size = 'medium'} )"
"Performs group of changes on Editor specified.":
"prefix":"image_edit_apply_changes"
"body":"image_edit_apply_changes( ${1:\\$image}${2:, \\$changes} )"
"Retrieves the image's intermediate size (resized) path, width, and height.":
"prefix":"image_get_intermediate_size"
"body":"image_get_intermediate_size( ${1:\\$post_id}${2:, \\$size = 'thumbnail'} )"
"Retrieve width and height attributes using given width and height values.":
"prefix":"image_hwstring"
"body":"image_hwstring( ${1:\\$width}${2:, \\$height} )"
"Retrieve HTML for the Link URL buttons with the default link type as specified.":
"prefix":"image_link_input_fields"
"body":"image_link_input_fields( ${1:\\$post}${2:, \\$url_type = ''} )"
"Resizes an image to make a thumbnail or intermediate size.":
"prefix":"image_make_intermediate_size"
"body":"image_make_intermediate_size( ${1:\\$file}${2:, \\$width}${3:, \\$height}${4:, \\$crop = false} )"
"Retrieves the media element HTML to send to the editor.":
"prefix":"image_media_send_to_editor"
"body":"image_media_send_to_editor( ${1:\\$html}${2:, \\$attachment_id}${3:, \\$attachment} )"
"Scale down an image to fit a particular size and save a new copy of the image.":
"prefix":"image_resize"
"body":"image_resize( ${1:\\$file}${2:, \\$max_w}${3:, \\$max_h}${4:, \\$crop = false}${5:, \\$suffix = null}${6:, \\$dest_path = null}${7:, \\$jpeg_quality = 90} )"
"Retrieves calculated resize dimensions for use in WP_Image_Editor.":
"prefix":"image_resize_dimensions"
"body":"image_resize_dimensions( ${1:\\$orig_w}${2:, \\$orig_h}${3:, \\$dest_w}${4:, \\$dest_h}${5:, \\$crop = false} )"
"Retrieve HTML for the size radio buttons with the specified one checked.":
"prefix":"image_size_input_fields"
"body":"image_size_input_fields( ${1:\\$post}${2:, \\$check = ''} )"
"Builds the Caption shortcode output.":
"prefix":"img_caption_shortcode"
"body":"img_caption_shortcode( ${1:\\$attr}${2:, \\$content = null} )"
"Check if the current post is within any of the given categories.":
"prefix":"in_category"
"body":"in_category( ${1:\\$category}${2:, \\$post = null} )"
"Whether the caller is in the Loop.":
"prefix":"in_the_loop"
"body":"in_the_loop()"
"Retrieves the URL to the includes directory.":
"prefix":"includes_url"
"body":"includes_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Display relational link for the site index.":
"prefix":"index_rel_link"
"body":"index_rel_link()"
"Store basic site info in the blogs table.":
"prefix":"insert_blog"
"body":"insert_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$site_id} )"
"Inserts an array of strings into a file (.htaccess ), placing it between
BEGIN and END markers.":
"prefix":"insert_with_markers"
"body":"insert_with_markers( ${1:\\$filename}${2:, \\$marker}${3:, \\$insertion} )"
"Install an empty blog.":
"prefix":"install_blog"
"body":"install_blog( ${1:\\$blog_id}${2:, \\$blog_title = ''} )"
"Set blog defaults.":
"prefix":"install_blog_defaults"
"body":"install_blog_defaults( ${1:\\$blog_id}${2:, \\$user_id} )"
"install_dashboard":
"prefix":"install_dashboard"
"body":"install_dashboard()"
"Install global terms.":
"prefix":"install_global_terms"
"body":"install_global_terms()"
"Install Network.":
"prefix":"install_network"
"body":"install_network()"
"Display plugin information in dialog box form.":
"prefix":"install_plugin_information"
"body":"install_plugin_information()"
"Determine the status we can perform on a plugin.":
"prefix":"install_plugin_install_status"
"body":"install_plugin_install_status( ${1:\\$api}${2:, \\$loop = false} )"
"Show a username form for the favorites page":
"prefix":"install_plugins_favorites_form"
"body":"install_plugins_favorites_form()"
"Upload from zip":
"prefix":"install_plugins_upload"
"body":"install_plugins_upload()"
"Retrieve popular WordPress plugin tags.":
"prefix":"install_popular_tags"
"body":"install_popular_tags( ${1:\\$args = array()} )"
"Displays a search form for searching plugins.":
"prefix":"install_search_form"
"body":"install_search_form( ${1:\\$deprecated = true} )"
"Display theme information in dialog box form.":
"prefix":"install_theme_information"
"body":"install_theme_information()"
"Display search form for searching themes.":
"prefix":"install_theme_search_form"
"body":"install_theme_search_form( ${1:\\$type_selector = true} )"
"Display tags filter for themes.":
"prefix":"install_themes_dashboard"
"body":"install_themes_dashboard()"
"Retrieve list of WordPress theme features (aka theme tags).":
"prefix":"install_themes_feature_list"
"body":"install_themes_feature_list()"
"install_themes_upload":
"prefix":"install_themes_upload"
"body":"install_themes_upload()"
"Is the query a 404 (returns no results)?":
"prefix":"is_404"
"body":"is_404()"
"Whether a sidebar is in use.":
"prefix":"is_active_sidebar"
"body":"is_active_sidebar( ${1:\\$index} )"
"Whether widget is displayed on the front end.":
"prefix":"is_active_widget"
"body":"is_active_widget( ${1:\\$callback = false}${2:, \\$widget_id = false}${3:, \\$id_base = false}${4:, \\$skip_inactive = true} )"
"Whether the current request is for an administrative interface page.":
"prefix":"is_admin"
"body":"is_admin()"
"Determine whether the admin bar should be showing.":
"prefix":"is_admin_bar_showing"
"body":"is_admin_bar_showing()"
"Determines if the HTTP origin is an authorized one.":
"prefix":"is_allowed_http_origin"
"body":"is_allowed_http_origin( ${1:\\$origin = null} )"
"Is the query for an existing archive page?":
"prefix":"is_archive"
"body":"is_archive()"
"Check if a particular blog is archived.":
"prefix":"is_archived"
"body":"is_archived( ${1:\\$id} )"
"Is the query for an existing attachment page?":
"prefix":"is_attachment"
"body":"is_attachment( ${1:\\$attachment = ''} )"
"Is the query for an existing author archive page?":
"prefix":"is_author"
"body":"is_author( ${1:\\$author = ''} )"
"Whether the current request is for a site's admininstrative interface.":
"prefix":"is_blog_admin"
"body":"is_blog_admin()"
"Test whether WordPress is already installed.":
"prefix":"is_blog_installed"
"body":"is_blog_installed()"
"Checks if the current user belong to a given site.":
"prefix":"is_blog_user"
"body":"is_blog_user( ${1:\\$blog_id} )"
"Is the query for an existing category archive page?":
"prefix":"is_category"
"body":"is_category( ${1:\\$category = ''} )"
"Whether a child theme is in use.":
"prefix":"is_child_theme"
"body":"is_child_theme()"
"is_client_error":
"prefix":"is_client_error"
"body":"is_client_error()"
"Is the query for a comments feed?":
"prefix":"is_comment_feed"
"body":"is_comment_feed()"
"Whether the current URL is within the comments popup window.":
"prefix":"is_comments_popup"
"body":"is_comments_popup()"
"Whether the site is being previewed in the Customizer.":
"prefix":"is_customize_preview"
"body":"is_customize_preview()"
"Is the query for an existing date archive?":
"prefix":"is_date"
"body":"is_date()"
"Is the query for an existing day archive?":
"prefix":"is_day"
"body":"is_day()"
"Whether the dynamic sidebar is enabled and used by theme.":
"prefix":"is_dynamic_sidebar"
"body":"is_dynamic_sidebar()"
"Verifies that an email is valid.":
"prefix":"is_email"
"body":"is_email( ${1:\\$email}${2:, \\$deprecated = false} )"
"Checks an email address against a list of banned domains.":
"prefix":"is_email_address_unsafe"
"body":"is_email_address_unsafe( ${1:\\$user_email} )"
"Is the query for an embedded post?":
"prefix":"is_embed"
"body":"is_embed()"
"is_error":
"prefix":"is_error"
"body":"is_error()"
"Is the query for a feed?":
"prefix":"is_feed"
"body":"is_feed( ${1:\\$feeds = ''} )"
"Is the query for the front page of the site?":
"prefix":"is_front_page"
"body":"is_front_page()"
"Checks whether the custom header video is eligible to show on the current page.":
"prefix":"is_header_video_active"
"body":"is_header_video_active()"
"Determines if the query is for the blog homepage.":
"prefix":"is_home"
"body":"is_home()"
"is_info":
"prefix":"is_info"
"body":"is_info()"
"Is the server running earlier than 1.5.0 version of lighttpd?":
"prefix":"is_lighttpd_before_150"
"body":"is_lighttpd_before_150()"
"Check if the attachment URI is local one and is really an attachment.":
"prefix":"is_local_attachment"
"body":"is_local_attachment( ${1:\\$url} )"
"Whether switch_to_locale() is in effect.":
"prefix":"is_locale_switched"
"body":"is_locale_switched()"
"Deprecated functionality to determin if the current site is the main site.":
"prefix":"is_main_blog"
"body":"is_main_blog()"
"Determine whether a network is the main network of the Multisite install.":
"prefix":"is_main_network"
"body":"is_main_network( ${1:\\$network_id = null} )"
"Is the query the main query?":
"prefix":"is_main_query"
"body":"is_main_query()"
"Determine whether a site is the main site of the current network.":
"prefix":"is_main_site"
"body":"is_main_site( ${1:\\$site_id = null} )"
"Is the query for an existing month archive?":
"prefix":"is_month"
"body":"is_month()"
"Does this site have more than one author":
"prefix":"is_multi_author"
"body":"is_multi_author()"
"If Multisite is enabled.":
"prefix":"is_multisite"
"body":"is_multisite()"
"Check if the given ID is a navigation menu.":
"prefix":"is_nav_menu"
"body":"is_nav_menu( ${1:\\$menu} )"
"Determines whether the given ID is a nav menu item.":
"prefix":"is_nav_menu_item"
"body":"is_nav_menu_item( ${1:\\$menu_item_id} )"
"Whether the current request is for the network administrative interface.":
"prefix":"is_network_admin"
"body":"is_network_admin()"
"Checks for "Network: true" in the plugin header to see if this should
be activated only as a network wide plugin. The plugin would also work
when Multisite is not enabled.":
"prefix":"is_network_only_plugin"
"body":"is_network_only_plugin( ${1:\\$plugin} )"
"Whether the publish date of the current post in the loop is different from the
publish date of the previous post in the loop.":
"prefix":"is_new_day"
"body":"is_new_day()"
"Determine if the given object type is associated with the given taxonomy.":
"prefix":"is_object_in_taxonomy"
"body":"is_object_in_taxonomy( ${1:\\$object_type}${2:, \\$taxonomy} )"
"Determine if the given object is associated with any of the given terms.":
"prefix":"is_object_in_term"
"body":"is_object_in_term( ${1:\\$object_id}${2:, \\$taxonomy}${3:, \\$terms = null} )"
"Is the query for an existing single page?":
"prefix":"is_page"
"body":"is_page( ${1:\\$page = ''} )"
"Whether currently in a page template.":
"prefix":"is_page_template"
"body":"is_page_template( ${1:\\$template = ''} )"
"Is the query for paged result and not for the first page?":
"prefix":"is_paged"
"body":"is_paged()"
"Check whether a plugin is active.":
"prefix":"is_plugin_active"
"body":"is_plugin_active( ${1:\\$plugin} )"
"Check whether the plugin is active for the entire network.":
"prefix":"is_plugin_active_for_network"
"body":"is_plugin_active_for_network( ${1:\\$plugin} )"
"Check whether the plugin is inactive.":
"prefix":"is_plugin_inactive"
"body":"is_plugin_inactive( ${1:\\$plugin} )"
"Is the current admin page generated by a plugin?":
"prefix":"is_plugin_page"
"body":"is_plugin_page()"
"Is the query for an existing post type archive page?":
"prefix":"is_post_type_archive"
"body":"is_post_type_archive( ${1:\\$post_types = ''} )"
"Whether the post type is hierarchical.":
"prefix":"is_post_type_hierarchical"
"body":"is_post_type_hierarchical( ${1:\\$post_type} )"
"Determines whether a post type is considered "viewable".":
"prefix":"is_post_type_viewable"
"body":"is_post_type_viewable( ${1:\\$post_type} )"
"Is the query for a post or page preview?":
"prefix":"is_preview"
"body":"is_preview()"
"Determine whether a meta key is protected.":
"prefix":"is_protected_meta"
"body":"is_protected_meta( ${1:\\$meta_key}${2:, \\$meta_type = null} )"
"Check if random header image is in use.":
"prefix":"is_random_header_image"
"body":"is_random_header_image( ${1:\\$type = 'any'} )"
"is_redirect":
"prefix":"is_redirect"
"body":"is_redirect()"
"Checks if a sidebar is registered.":
"prefix":"is_registered_sidebar"
"body":"is_registered_sidebar( ${1:\\$sidebar_id} )"
"Is the query for the robots file?":
"prefix":"is_robots"
"body":"is_robots()"
"Checks if current locale is RTL.":
"prefix":"is_rtl"
"body":"is_rtl()"
"Is the query for a search?":
"prefix":"is_search"
"body":"is_search()"
"Check value to find if it was serialized.":
"prefix":"is_serialized"
"body":"is_serialized( ${1:\\$data}${2:, \\$strict = true} )"
"Check whether serialized data is of string type.":
"prefix":"is_serialized_string"
"body":"is_serialized_string( ${1:\\$data} )"
"is_server_error":
"prefix":"is_server_error"
"body":"is_server_error()"
"Is the query for an existing single post?":
"prefix":"is_single"
"body":"is_single( ${1:\\$post = ''} )"
"Is the query for an existing single post of any post type (post, attachment, page,
custom post types)?":
"prefix":"is_singular"
"body":"is_singular( ${1:\\$post_types = ''} )"
"Determine if user is a site admin.":
"prefix":"is_site_admin"
"body":"is_site_admin( ${1:\\$user_login = ''} )"
"Determines if SSL is used.":
"prefix":"is_ssl"
"body":"is_ssl()"
"Check if post is sticky.":
"prefix":"is_sticky"
"body":"is_sticky( ${1:\\$post_id} )"
"Whether a subdomain configuration is enabled.":
"prefix":"is_subdomain_install"
"body":"is_subdomain_install()"
"is_success":
"prefix":"is_success"
"body":"is_success()"
"Determine if user is a site admin":
"prefix":"is_super_admin"
"body":"is_super_admin( ${1:\\$user_id = false} )"
"Is the query for an existing tag archive page?":
"prefix":"is_tag"
"body":"is_tag( ${1:\\$tag = ''} )"
"Is the query for an existing custom taxonomy archive page?":
"prefix":"is_tax"
"body":"is_tax( ${1:\\$taxonomy = ''}${2:, \\$term = ''} )"
"Checks that the taxonomy name exists.":
"prefix":"is_taxonomy"
"body":"is_taxonomy( ${1:\\$taxonomy} )"
"Whether the taxonomy object is hierarchical.":
"prefix":"is_taxonomy_hierarchical"
"body":"is_taxonomy_hierarchical( ${1:\\$taxonomy} )"
"Check if Term exists.":
"prefix":"is_term"
"body":"is_term( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$parent} )"
"Whether there are translations for the text domain.":
"prefix":"is_textdomain_loaded"
"body":"is_textdomain_loaded( ${1:\\$domain} )"
"Is the query for a specific time?":
"prefix":"is_time"
"body":"is_time()"
"Is the query for a trackback endpoint call?":
"prefix":"is_trackback"
"body":"is_trackback()"
"Whether the plugin can be uninstalled.":
"prefix":"is_uninstallable_plugin"
"body":"is_uninstallable_plugin( ${1:\\$plugin} )"
"Determines if there is any upload space left in the current blog's quota.":
"prefix":"is_upload_space_available"
"body":"is_upload_space_available()"
"Whether the current request is for a user admin screen.":
"prefix":"is_user_admin"
"body":"is_user_admin()"
"Checks if the current visitor is a logged in user.":
"prefix":"is_user_logged_in"
"body":"is_user_logged_in()"
"Find out whether a user is a member of a given blog.":
"prefix":"is_user_member_of_blog"
"body":"is_user_member_of_blog( ${1:\\$user_id}${2:, \\$blog_id} )"
"Check whether a usermeta key has to do with the current blog.":
"prefix":"is_user_option_local"
"body":"is_user_option_local( ${1:\\$key}${2:, \\$user_id}${3:, \\$blog_id} )"
"Check to see whether a user is marked as a spammer, based on user login.":
"prefix":"is_user_spammy"
"body":"is_user_spammy( ${1:\\$user = null} )"
"Check whether variable is a WordPress Error.":
"prefix":"is_wp_error"
"body":"is_wp_error( ${1:\\$thing} )"
"Deprecated functionality for determining if the current plugin is network-only.":
"prefix":"is_wpmu_sitewide_plugin"
"body":"is_wpmu_sitewide_plugin()"
"Is the query for an existing year archive?":
"prefix":"is_year"
"body":"is_year()"
"Computes an offset in seconds from an iso8601 timezone.":
"prefix":"iso8601_timezone_to_offset"
"body":"iso8601_timezone_to_offset( ${1:\\$timezone} )"
"Converts an iso8601 date to MySQL DateTime format used by post_date[_gmt].":
"prefix":"iso8601_to_datetime"
"body":"iso8601_to_datetime( ${1:\\$date_string}${2:, \\$timezone = 'user'} )"
"Escape single quotes, specialchar double quotes, and fix line endings.":
"prefix":"js_escape"
"body":"js_escape( ${1:\\$text} )"
"Retrieves the error string of the last json_encode() or json_decode() call.":
"prefix":"json_last_error_msg"
"body":"json_last_error_msg()"
"Sets up most of the Kses filters for input form content.":
"prefix":"kses_init"
"body":"kses_init()"
"Adds all Kses input form content filters.":
"prefix":"kses_init_filters"
"body":"kses_init_filters()"
"Removes all Kses input form content filters.":
"prefix":"kses_remove_filters"
"body":"kses_remove_filters()"
"Displays the language attributes for the html tag.":
"prefix":"language_attributes"
"body":"language_attributes( ${1:\\$doctype = 'html'} )"
"Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described.":
"prefix":"like_escape"
"body":"like_escape( ${1:\\$text} )"
"Display advanced link options form fields.":
"prefix":"link_advanced_meta_box"
"body":"link_advanced_meta_box( ${1:\\$link} )"
"Display link categories form fields.":
"prefix":"link_categories_meta_box"
"body":"link_categories_meta_box( ${1:\\$link} )"
"Print list of pages based on arguments.":
"prefix":"link_pages"
"body":"link_pages( ${1:\\$before = ''}${2:, \\$after = ''}${3:, \\$next_or_number = 'number'}${4:, \\$nextpagelink = 'next page'}${5:, \\$previouspagelink = 'previous page'}${6:, \\$pagelink = '%'}${7:, \\$more_file = ''} )"
"Display link create form fields.":
"prefix":"link_submit_meta_box"
"body":"link_submit_meta_box( ${1:\\$link} )"
"Display form fields for changing link target.":
"prefix":"link_target_meta_box"
"body":"link_target_meta_box( ${1:\\$link} )"
"Display xfn form fields.":
"prefix":"link_xfn_meta_box"
"body":"link_xfn_meta_box( ${1:\\$link} )"
"Add a Base url to relative links in passed content.":
"prefix":"links_add_base_url"
"body":"links_add_base_url( ${1:\\$content}${2:, \\$base}${3:, \\$attrs = array('src', 'href')} )"
"Adds a Target attribute to all links in passed content.":
"prefix":"links_add_target"
"body":"links_add_target( ${1:\\$content}${2:, \\$target = '_blank'}${3:, \\$tags = array('a')} )"
"Show the link to the links popup and the number of links.":
"prefix":"links_popup_script"
"body":"links_popup_script( ${1:\\$text = 'Links'}${2:, \\$width = 400}${3:, \\$height = 400}${4:, \\$file = 'links.all.php'}${5:, \\$count = true} )"
"Lists authors.":
"prefix":"list_authors"
"body":"list_authors( ${1:\\$optioncount = false}${2:, \\$exclude_admin = true}${3:, \\$show_fullname = false}${4:, \\$hide_empty = true}${5:, \\$feed = ''}${6:, \\$feed_image = ''} )"
"Lists categories. list_cats":
"prefix":"list_cats"
"body":"list_cats( ${1:\\$optionall = 1}${2:, \\$all = 'All'}${3:, \\$sort_column = 'ID'}${4:, \\$sort_order = 'asc'}${5:, \\$file = ''}${6:, \\$list = true}${7:, \\$optiondates}${8:, \\$optioncount}${9:, \\$hide_empty = 1}${10:, \\$use_desc_for_title = 1}${11:, \\$children = false}${12:, \\$child_of}${13:, \\$categories}${14:, \\$recurse}${15:, \\$feed = ''}${16:, \\$feed_image = ''}${17:, \\$exclude = ''}${18:, \\$hierarchical = false} )"
"list_core_update":
"prefix":"list_core_update"
"body":"list_core_update( ${1:\\$update} )"
"Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.":
"prefix":"list_files"
"body":"list_files( ${1:\\$folder = ''}${2:, \\$levels = 100} )"
"Outputs a post's public meta data in the Custom Fields meta box.":
"prefix":"list_meta"
"body":"list_meta( ${1:\\$meta} )"
"list_plugin_updates":
"prefix":"list_plugin_updates"
"body":"list_plugin_updates()"
"list_theme_updates":
"prefix":"list_theme_updates"
"body":"list_theme_updates()"
"list_translation_updates":
"prefix":"list_translation_updates"
"body":"list_translation_updates()"
"Load the child themes translated strings.":
"prefix":"load_child_theme_textdomain"
"body":"load_child_theme_textdomain( ${1:\\$domain}${2:, \\$path = false} )"
"Load default translated strings based on locale.":
"prefix":"load_default_textdomain"
"body":"load_default_textdomain( ${1:\\$locale = null} )"
"Load an image resource for editing.":
"prefix":"load_image_to_edit"
"body":"load_image_to_edit( ${1:\\$attachment_id}${2:, \\$mime_type}${3:, \\$size = 'full'} )"
"Load the translated strings for a plugin residing in the mu-plugins directory.":
"prefix":"load_muplugin_textdomain"
"body":"load_muplugin_textdomain( ${1:\\$domain}${2:, \\$mu_plugin_rel_path = ''} )"
"Loads a plugin's translated strings.":
"prefix":"load_plugin_textdomain"
"body":"load_plugin_textdomain( ${1:\\$domain}${2:, \\$deprecated = false}${3:, \\$plugin_rel_path = false} )"
"Require the template file with WordPress environment.":
"prefix":"load_template"
"body":"load_template( ${1:\\$_template_file}${2:, \\$require_once = true} )"
"Load a .mo file into the text domain $domain.":
"prefix":"load_textdomain"
"body":"load_textdomain( ${1:\\$domain}${2:, \\$mofile} )"
"Load the theme's translated strings.":
"prefix":"load_theme_textdomain"
"body":"load_theme_textdomain( ${1:\\$domain}${2:, \\$path = false} )"
"Display localized stylesheet link element.":
"prefix":"locale_stylesheet"
"body":"locale_stylesheet()"
"Retrieve the name of the highest priority template file that exists.":
"prefix":"locate_template"
"body":"locate_template( ${1:\\$template_names}${2:, \\$load = false}${3:, \\$require_once = true} )"
"Outputs the footer for the login page.":
"prefix":"login_footer"
"body":"login_footer( ${1:\\$input_id = ''} )"
"Output the login page header.":
"prefix":"login_header"
"body":"login_header( ${1:\\$title = 'Log In'}${2:, \\$message = ''}${3:, \\$wp_error = ''} )"
"logIO() - Writes logging info to a file.":
"prefix":"logio"
"body":"logio( ${1:\\$io}${2:, \\$msg} )"
"maintenance_nag":
"prefix":"maintenance_nag"
"body":"maintenance_nag()"
"Convert plaintext URI to HTML links.":
"prefix":"make_clickable"
"body":"make_clickable( ${1:\\$text} )"
"Updates the database tables to a new schema.":
"prefix":"make_db_current"
"body":"make_db_current( ${1:\\$tables = 'all'} )"
"Updates the database tables to a new schema, but without displaying results.":
"prefix":"make_db_current_silent"
"body":"make_db_current_silent( ${1:\\$tables = 'all'} )"
"Creates a site theme.":
"prefix":"make_site_theme"
"body":"make_site_theme()"
"Creates a site theme from the default theme.":
"prefix":"make_site_theme_from_default"
"body":"make_site_theme_from_default( ${1:\\$theme_name}${2:, \\$template} )"
"Creates a site theme from an existing theme.":
"prefix":"make_site_theme_from_oldschool"
"body":"make_site_theme_from_oldschool( ${1:\\$theme_name}${2:, \\$template} )"
"Strip HTML and put links at the bottom of stripped content.":
"prefix":"make_url_footnote"
"body":"make_url_footnote( ${1:\\$content} )"
"Maps a function to all non-iterable elements of an array or an object.":
"prefix":"map_deep"
"body":"map_deep( ${1:\\$value}${2:, \\$callback} )"
"Map meta capabilities to primitive capabilities.":
"prefix":"map_meta_cap"
"body":"map_meta_cap( ${1:\\$cap}${2:, \\$user_id}${3:, \\$object_id} )"
"Add column to database table, if column doesn't already exist in table.":
"prefix":"maybe_add_column"
"body":"maybe_add_column( ${1:\\$table_name}${2:, \\$column_name}${3:, \\$create_ddl} )"
"Add a new user to a blog by visiting /newbloguser/username/.":
"prefix":"maybe_add_existing_user_to_blog"
"body":"maybe_add_existing_user_to_blog()"
"If a table only contains utf8 or utf8mb4 columns, convert it to utf8mb4.":
"prefix":"maybe_convert_table_to_utf8mb4"
"body":"maybe_convert_table_to_utf8mb4( ${1:\\$table} )"
"Create database table, if it doesn't already exist.":
"prefix":"maybe_create_table"
"body":"maybe_create_table( ${1:\\$table_name}${2:, \\$create_ddl} )"
"Disables the Automattic widgets plugin, which was merged into core.":
"prefix":"maybe_disable_automattic_widgets"
"body":"maybe_disable_automattic_widgets()"
"Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.":
"prefix":"maybe_disable_link_manager"
"body":"maybe_disable_link_manager()"
"Drop column from database table, if it exists.":
"prefix":"maybe_drop_column"
"body":"maybe_drop_column( ${1:\\$table_name}${2:, \\$column_name}${3:, \\$drop_ddl} )"
"Ensures that any hex color is properly hashed.":
"prefix":"maybe_hash_hex_color"
"body":"maybe_hash_hex_color( ${1:\\$color} )"
"Correct 404 redirects when NOBLOGREDIRECT is defined.":
"prefix":"maybe_redirect_404"
"body":"maybe_redirect_404()"
"Serialize data, if needed.":
"prefix":"maybe_serialize"
"body":"maybe_serialize( ${1:\\$data} )"
"Unserialize value only if it was serialized.":
"prefix":"maybe_unserialize"
"body":"maybe_unserialize( ${1:\\$original} )"
"Compat function to mimic mb_strlen().":
"prefix":"mb_strlen"
"body":"mb_strlen( ${1:\\$str}${2:, \\$encoding = null} )"
"Set the mbstring internal encoding to a binary safe encoding when func_overload
is enabled.":
"prefix":"mbstring_binary_safe_encoding"
"body":"mbstring_binary_safe_encoding( ${1:\\$reset = false} )"
"Adds the media button to the editor":
"prefix":"media_buttons"
"body":"media_buttons( ${1:\\$editor_id = 'content'} )"
"Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload().":
"prefix":"media_handle_sideload"
"body":"media_handle_sideload( ${1:\\$file_array}${2:, \\$post_id}${3:, \\$desc = null}${4:, \\$post_data = array()} )"
"Save a file submitted from a POST request and create an attachment post for it.":
"prefix":"media_handle_upload"
"body":"media_handle_upload( ${1:\\$file_id}${2:, \\$post_id}${3:, \\$post_data = array()}${4:, \\$overrides = array( 'test_form' => false )} )"
"Retrieves the post non-image attachment fields to edito form fields.":
"prefix":"media_post_single_attachment_fields_to_edit"
"body":"media_post_single_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Adds image html to editor":
"prefix":"media_send_to_editor"
"body":"media_send_to_editor( ${1:\\$html} )"
"Downloads an image from the specified URL and attaches it to a post.":
"prefix":"media_sideload_image"
"body":"media_sideload_image( ${1:\\$file}${2:, \\$post_id}${3:, \\$desc = null}${4:, \\$return = 'html'} )"
"Retrieves the single non-image attachment fields to edit form fields.":
"prefix":"media_single_attachment_fields_to_edit"
"body":"media_single_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Handles uploading an audio file.":
"prefix":"media_upload_audio"
"body":"media_upload_audio()"
"Handles uploading a generic file.":
"prefix":"media_upload_file"
"body":"media_upload_file()"
"Displays the multi-file uploader message.":
"prefix":"media_upload_flash_bypass"
"body":"media_upload_flash_bypass()"
"Outputs the legacy media upload form.":
"prefix":"media_upload_form"
"body":"media_upload_form( ${1:\\$errors = null} )"
"Handles form submissions for the legacy media uploader.":
"prefix":"media_upload_form_handler"
"body":"media_upload_form_handler()"
"Retrieves the legacy media uploader form in an iframe.":
"prefix":"media_upload_gallery"
"body":"media_upload_gallery()"
"Adds gallery form to upload iframe":
"prefix":"media_upload_gallery_form"
"body":"media_upload_gallery_form( ${1:\\$errors} )"
"Outputs the legacy media upload header.":
"prefix":"media_upload_header"
"body":"media_upload_header()"
"Displays the browser's built-in uploader message.":
"prefix":"media_upload_html_bypass"
"body":"media_upload_html_bypass()"
"Handles uploading an image.":
"prefix":"media_upload_image"
"body":"media_upload_image()"
"Retrieves the legacy media library form in an iframe.":
"prefix":"media_upload_library"
"body":"media_upload_library()"
"Outputs the legacy media upload form for the media library.":
"prefix":"media_upload_library_form"
"body":"media_upload_library_form( ${1:\\$errors} )"
"Displays the checkbox to scale images.":
"prefix":"media_upload_max_image_resize"
"body":"media_upload_max_image_resize()"
"Defines the default media upload tabs":
"prefix":"media_upload_tabs"
"body":"media_upload_tabs()"
"Used to display a "After a file has been uploaded..." help message.":
"prefix":"media_upload_text_after"
"body":"media_upload_text_after()"
"Outputs the legacy media upload form for a given media type.":
"prefix":"media_upload_type_form"
"body":"media_upload_type_form( ${1:\\$type = 'file'}${2:, \\$errors = null}${3:, \\$id = null} )"
"Outputs the legacy media upload form for external media.":
"prefix":"media_upload_type_url_form"
"body":"media_upload_type_url_form( ${1:\\$type = null}${2:, \\$errors = null}${3:, \\$id = null} )"
"Handles uploading a video file.":
"prefix":"media_upload_video"
"body":"media_upload_video()"
"Get the url to access a particular menu page based on the slug it was registered with.":
"prefix":"menu_page_url"
"body":"menu_page_url( ${1:\\$menu_slug}${2:, \\$echo = true} )"
"Prints the meta box preferences for screen meta.":
"prefix":"meta_box_prefs"
"body":"meta_box_prefs( ${1:\\$screen} )"
"Prints the form in the Custom Fields meta box.":
"prefix":"meta_form"
"body":"meta_form( ${1:\\$post = null} )"
"Determine if a meta key is set for a given object":
"prefix":"metadata_exists"
"body":"metadata_exists( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key} )"
"Whitelists any domain in a multisite installation for safe HTTP requests.":
"prefix":"ms_allowed_http_request_hosts"
"body":"ms_allowed_http_request_hosts( ${1:\\$is_external}${2:, \\$host} )"
"Defines Multisite cookie constants.":
"prefix":"ms_cookie_constants"
"body":"ms_cookie_constants()"
"Deprecated functionality for determining whether a file is deprecated.":
"prefix":"ms_deprecated_blogs_file"
"body":"ms_deprecated_blogs_file()"
"Defines Multisite file constants.":
"prefix":"ms_file_constants"
"body":"ms_file_constants()"
"Determines if switch_to_blog() is in effect":
"prefix":"ms_is_switched"
"body":"ms_is_switched()"
"Identifies the network and site of a requested domain and path and populates the
corresponding network and site global objects as part of the multisite bootstrap process.":
"prefix":"ms_load_current_site_and_network"
"body":"ms_load_current_site_and_network( ${1:\\$domain}${2:, \\$path}${3:, \\$subdomain = false} )"
"Displays a failure message.":
"prefix":"ms_not_installed"
"body":"ms_not_installed( ${1:\\$domain}${2:, \\$path} )"
"Checks status of current blog.":
"prefix":"ms_site_check"
"body":"ms_site_check()"
"Defines Multisite subdomain constants and handles warnings and notices.":
"prefix":"ms_subdomain_constants"
"body":"ms_subdomain_constants()"
"Defines Multisite upload constants.":
"prefix":"ms_upload_constants"
"body":"ms_upload_constants()"
"Generates and displays a drop-down of available languages.":
"prefix":"mu_dropdown_languages"
"body":"mu_dropdown_languages( ${1:\\$lang_files = array()}${2:, \\$current = ''} )"
"WPMU options.":
"prefix":"mu_options"
"body":"mu_options()"
"Displays the out of storage quota message in Multisite.":
"prefix":"multisite_over_quota_message"
"body":"multisite_over_quota_message()"
"Convert given date string into a different format.":
"prefix":"mysql2date"
"body":"mysql2date( ${1:\\$format}${2:, \\$date}${3:, \\$translate = true} )"
"Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601/RFC3339.":
"prefix":"mysql_to_rfc3339"
"body":"mysql_to_rfc3339( ${1:\\$date_string} )"
"Retrieves the URL to the admin area for the network.":
"prefix":"network_admin_url"
"body":"network_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Check for an existing network.":
"prefix":"network_domain_check"
"body":"network_domain_check()"
"Outputs the HTML for a network's "Edit Site" tabular interface.":
"prefix":"network_edit_site_nav"
"body":"network_edit_site_nav( ${1:\\$args = array()} )"
"Retrieves the home URL for the current network.":
"prefix":"network_home_url"
"body":"network_home_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Print JavaScript in the header on the Network Settings screen.":
"prefix":"network_settings_add_js"
"body":"network_settings_add_js()"
"Retrieves the site URL for the current network.":
"prefix":"network_site_url"
"body":"network_site_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Prints step 1 for Network installation process.":
"prefix":"network_step1"
"body":"network_step1( ${1:\\$errors = false} )"
"Prints step 2 for Network installation process.":
"prefix":"network_step2"
"body":"network_step2( ${1:\\$errors = false} )"
"Adds an admin notice alerting the user to check for confirmation email
after email address change.":
"prefix":"new_user_email_admin_notice"
"body":"new_user_email_admin_notice()"
"Notifies the network admin that a new site has been activated.":
"prefix":"newblog_notify_siteadmin"
"body":"newblog_notify_siteadmin( ${1:\\$blog_id}${2:, \\$deprecated = ''} )"
"Notifies the network admin that a new user has been activated.":
"prefix":"newuser_notify_siteadmin"
"body":"newuser_notify_siteadmin( ${1:\\$user_id} )"
"Displays the link to the next comments page.":
"prefix":"next_comments_link"
"body":"next_comments_link( ${1:\\$label = ''}${2:, \\$max_page} )"
"Displays next image link that has the same post parent.":
"prefix":"next_image_link"
"body":"next_image_link( ${1:\\$size = 'thumbnail'}${2:, \\$text = false} )"
"Prints link to the next post.":
"prefix":"next_post"
"body":"next_post( ${1:\\$format = '%'}${2:, \\$next = 'next post: '}${3:, \\$title = 'yes'}${4:, \\$in_same_cat = 'no'}${5:, \\$limitnext = 1}${6:, \\$excluded_categories = ''} )"
"Displays the next post link that is adjacent to the current post.":
"prefix":"next_post_link"
"body":"next_post_link( ${1:\\$format = '%link »'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Displays the relational link for the next post adjacent to the current post.":
"prefix":"next_post_rel_link"
"body":"next_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Displays or retrieves the next posts page link.":
"prefix":"next_posts"
"body":"next_posts( ${1:\\$max_page}${2:, \\$echo = true} )"
"Displays the next posts page link.":
"prefix":"next_posts_link"
"body":"next_posts_link( ${1:\\$label = null}${2:, \\$max_page} )"
"next_widget_id_number":
"prefix":"next_widget_id_number"
"body":"next_widget_id_number( ${1:\\$id_base} )"
"Set the headers to prevent caching for the different browsers.":
"prefix":"nocache_headers"
"body":"nocache_headers()"
"Displays a noindex meta tag if required by the blog configuration.":
"prefix":"noindex"
"body":"noindex()"
"Normalize EOL characters and strip duplicate whitespace.":
"prefix":"normalize_whitespace"
"body":"normalize_whitespace( ${1:\\$str} )"
"Convert float number to format based on the locale.":
"prefix":"number_format_i18n"
"body":"number_format_i18n( ${1:\\$number}${2:, \\$decimals} )"
"Refreshes the value of the options whitelist available via the 'whitelist_options' hook.":
"prefix":"option_update_filter"
"body":"option_update_filter( ${1:\\$options} )"
"Output JavaScript to toggle display of additional settings if avatars are disabled.":
"prefix":"options_discussion_add_js"
"body":"options_discussion_add_js()"
"Display JavaScript on the page options_general_add_js.":
"prefix":"options_general_add_js"
"body":"options_general_add_js()"
"Display JavaScript on the page options_permalink_add_js.":
"prefix":"options_permalink_add_js"
"body":"options_permalink_add_js()"
"Display JavaScript on the page options_reading_add_js.":
"prefix":"options_reading_add_js"
"body":"options_reading_add_js()"
"Render the site charset setting.":
"prefix":"options_reading_blog_charset"
"body":"options_reading_blog_charset()"
"Display page attributes form fields.":
"prefix":"page_attributes_meta_box"
"body":"page_attributes_meta_box( ${1:\\$post} )"
"Print out option HTML elements for the page templates drop-down.":
"prefix":"page_template_dropdown"
"body":"page_template_dropdown( ${1:\\$default = ''}${2:, \\$post_type = 'page'} )"
"Displays or retrieves pagination links for the comments on the current post.":
"prefix":"paginate_comments_links"
"body":"paginate_comments_links( ${1:\\$args = array()} )"
"Retrieve paginated link for archive post pages.":
"prefix":"paginate_links"
"body":"paginate_links( ${1:\\$args = ''} )"
"Print out option HTML elements for the page parents drop-down.":
"prefix":"parent_dropdown"
"body":"parent_dropdown( ${1:\\$default}${2:, \\$parent}${3:, \\$level}${4:, \\$post = null} )"
"Display relational link for parent item":
"prefix":"parent_post_rel_link"
"body":"parent_post_rel_link( ${1:\\$title = '%title'} )"
"parse_w3cdtf":
"prefix":"parse_w3cdtf"
"body":"parse_w3cdtf()"
"Test if a give filesystem path is absolute.":
"prefix":"path_is_absolute"
"body":"path_is_absolute( ${1:\\$path} )"
"Join two filesystem paths together.":
"prefix":"path_join"
"body":"path_join( ${1:\\$base}${2:, \\$path} )"
"pclziputilcopyblock":
"prefix":"pclziputilcopyblock"
"body":"pclziputilcopyblock()"
"pclziputiloptiontext":
"prefix":"pclziputiloptiontext"
"body":"pclziputiloptiontext()"
"pclziputilpathinclusion":
"prefix":"pclziputilpathinclusion"
"body":"pclziputilpathinclusion()"
"pclziputilpathreduction":
"prefix":"pclziputilpathreduction"
"body":"pclziputilpathreduction()"
"pclziputilrename":
"prefix":"pclziputilrename"
"body":"pclziputilrename()"
"pclziputiltranslatewinpath":
"prefix":"pclziputiltranslatewinpath"
"body":"pclziputiltranslatewinpath()"
"Displays the permalink anchor for the current post.":
"prefix":"permalink_anchor"
"body":"permalink_anchor( ${1:\\$mode = 'id'} )"
"Print the permalink of the current post in the loop.":
"prefix":"permalink_link"
"body":"permalink_link()"
"Print the permalink to the RSS feed.":
"prefix":"permalink_single_rss"
"body":"permalink_single_rss( ${1:\\$deprecated = ''} )"
"Pings back the links found in a post.":
"prefix":"pingback"
"body":"pingback( ${1:\\$content}${2:, \\$post_id} )"
"Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI":
"prefix":"pingback_ping_source_uri"
"body":"pingback_ping_source_uri( ${1:\\$source_uri} )"
"Whether the current post is open for pings.":
"prefix":"pings_open"
"body":"pings_open( ${1:\\$post_id = null} )"
"Gets the basename of a plugin.":
"prefix":"plugin_basename"
"body":"plugin_basename( ${1:\\$file} )"
"Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in.":
"prefix":"plugin_dir_path"
"body":"plugin_dir_path( ${1:\\$file} )"
"Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in.":
"prefix":"plugin_dir_url"
"body":"plugin_dir_url( ${1:\\$file} )"
"plugin_sandbox_scrape":
"prefix":"plugin_sandbox_scrape"
"body":"plugin_sandbox_scrape( ${1:\\$plugin} )"
"Retrieves plugin installer pages from the WordPress.org Plugins API.":
"prefix":"plugins_api"
"body":"plugins_api( ${1:\\$action}${2:, \\$args = array()} )"
"Retrieves a URL within the plugins or mu-plugins directory.":
"prefix":"plugins_url"
"body":"plugins_url( ${1:\\$path = ''}${2:, \\$plugin = ''} )"
"Populate network settings.":
"prefix":"populate_network"
"body":"populate_network( ${1:\\$network_id = 1}${2:, \\$domain = ''}${3:, \\$email = ''}${4:, \\$site_name = ''}${5:, \\$path = '/'}${6:, \\$subdomain_install = false} )"
"Create WordPress options and set the default values.":
"prefix":"populate_options"
"body":"populate_options()"
"Execute WordPress role creation for the various WordPress versions.":
"prefix":"populate_roles"
"body":"populate_roles()"
"Create the roles for WordPress 2.0":
"prefix":"populate_roles_160"
"body":"populate_roles_160()"
"Create and modify WordPress roles for WordPress 2.1.":
"prefix":"populate_roles_210"
"body":"populate_roles_210()"
"Create and modify WordPress roles for WordPress 2.3.":
"prefix":"populate_roles_230"
"body":"populate_roles_230()"
"Create and modify WordPress roles for WordPress 2.5.":
"prefix":"populate_roles_250"
"body":"populate_roles_250()"
"Create and modify WordPress roles for WordPress 2.6.":
"prefix":"populate_roles_260"
"body":"populate_roles_260()"
"Create and modify WordPress roles for WordPress 2.7.":
"prefix":"populate_roles_270"
"body":"populate_roles_270()"
"Create and modify WordPress roles for WordPress 2.8.":
"prefix":"populate_roles_280"
"body":"populate_roles_280()"
"Create and modify WordPress roles for WordPress 3.0.":
"prefix":"populate_roles_300"
"body":"populate_roles_300()"
"Adds element attributes to open links in new windows.":
"prefix":"popuplinks"
"body":"popuplinks( ${1:\\$text} )"
"Display form field with list of authors.":
"prefix":"post_author_meta_box"
"body":"post_author_meta_box( ${1:\\$post} )"
"Display post categories form fields.":
"prefix":"post_categories_meta_box"
"body":"post_categories_meta_box( ${1:\\$post}${2:, \\$box} )"
"Display the classes for the post div.":
"prefix":"post_class"
"body":"post_class( ${1:\\$class = ''}${2:, \\$post_id = null} )"
"Display comments for post.":
"prefix":"post_comment_meta_box"
"body":"post_comment_meta_box( ${1:\\$post} )"
"Display comments for post table header":
"prefix":"post_comment_meta_box_thead"
"body":"post_comment_meta_box_thead( ${1:\\$result} )"
"Display comments status form fields.":
"prefix":"post_comment_status_meta_box"
"body":"post_comment_status_meta_box( ${1:\\$post} )"
"Displays the comment feed link for a post.":
"prefix":"post_comments_feed_link"
"body":"post_comments_feed_link( ${1:\\$link_text = ''}${2:, \\$post_id = ''}${3:, \\$feed = ''} )"
"Retrieve post custom meta data field.":
"prefix":"post_custom"
"body":"post_custom( ${1:\\$key = ''} )"
"Display custom fields form fields.":
"prefix":"post_custom_meta_box"
"body":"post_custom_meta_box( ${1:\\$post} )"
"Display post excerpt form fields.":
"prefix":"post_excerpt_meta_box"
"body":"post_excerpt_meta_box( ${1:\\$post} )"
"Determine if a post exists based on title, content, and date":
"prefix":"post_exists"
"body":"post_exists( ${1:\\$title}${2:, \\$content = ''}${3:, \\$date = ''} )"
"Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
as they disregard the autocomplete setting on the editor textarea. That can break the editor
when the user navigates to it with the browser's Back button. See #28037":
"prefix":"post_form_autocomplete_off"
"body":"post_form_autocomplete_off()"
"Display post format form elements.":
"prefix":"post_format_meta_box"
"body":"post_format_meta_box( ${1:\\$post}${2:, \\$box} )"
"Whether post requires password and correct password has been provided.":
"prefix":"post_password_required"
"body":"post_password_required( ${1:\\$post = null} )"
"Retrieve permalink from post ID.":
"prefix":"post_permalink"
"body":"post_permalink( ${1:\\$post_id} )"
"Save draft or manually autosave for showing preview.":
"prefix":"post_preview"
"body":"post_preview()"
"Displays the HTML content for reply to post link.":
"prefix":"post_reply_link"
"body":"post_reply_link( ${1:\\$args = array()}${2:, \\$post = null} )"
"Display list of revisions.":
"prefix":"post_revisions_meta_box"
"body":"post_revisions_meta_box( ${1:\\$post} )"
"Display slug form fields.":
"prefix":"post_slug_meta_box"
"body":"post_slug_meta_box( ${1:\\$post} )"
"Displays post submit form fields.":
"prefix":"post_submit_meta_box"
"body":"post_submit_meta_box( ${1:\\$post}${2:, \\$args = array()} )"
"Display post tags form fields.":
"prefix":"post_tags_meta_box"
"body":"post_tags_meta_box( ${1:\\$post}${2:, \\$box} )"
"Display post thumbnail meta box.":
"prefix":"post_thumbnail_meta_box"
"body":"post_thumbnail_meta_box( ${1:\\$post} )"
"Display trackback links form fields.":
"prefix":"post_trackback_meta_box"
"body":"post_trackback_meta_box( ${1:\\$post} )"
"Display or retrieve title for a post type archive.":
"prefix":"post_type_archive_title"
"body":"post_type_archive_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Check if a post type is registered.":
"prefix":"post_type_exists"
"body":"post_type_exists( ${1:\\$post_type} )"
"Check a post type's support for a given feature.":
"prefix":"post_type_supports"
"body":"post_type_supports( ${1:\\$post_type}${2:, \\$feature} )"
"Returns the list of classes to be used by a meta box.":
"prefix":"postbox_classes"
"body":"postbox_classes( ${1:\\$id}${2:, \\$page} )"
"Displays the post pages link navigation for previous and next pages.":
"prefix":"posts_nav_link"
"body":"posts_nav_link( ${1:\\$sep = ''}${2:, \\$prelabel = ''}${3:, \\$nxtlabel = ''} )"
"Runs before the schema is upgraded.":
"prefix":"pre_schema_upgrade"
"body":"pre_schema_upgrade()"
"Determine the type of a string of data with the data formatted.":
"prefix":"prep_atom_text_construct"
"body":"prep_atom_text_construct( ${1:\\$data} )"
"Wrap attachment in paragraph tag before content.":
"prefix":"prepend_attachment"
"body":"prepend_attachment( ${1:\\$content} )"
"Displays the relational link for the previous post adjacent to the current post.":
"prefix":"prev_post_rel_link"
"body":"prev_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Start preview theme output buffer.":
"prefix":"preview_theme"
"body":"preview_theme()"
"Callback function for ob_start() to capture all links in the theme.":
"prefix":"preview_theme_ob_filter"
"body":"preview_theme_ob_filter( ${1:\\$content} )"
"Manipulates preview theme links in order to control and maintain location.":
"prefix":"preview_theme_ob_filter_callback"
"body":"preview_theme_ob_filter_callback( ${1:\\$matches} )"
"Displays the link to the previous comments page.":
"prefix":"previous_comments_link"
"body":"previous_comments_link( ${1:\\$label = ''} )"
"Displays previous image link that has the same post parent.":
"prefix":"previous_image_link"
"body":"previous_image_link( ${1:\\$size = 'thumbnail'}${2:, \\$text = false} )"
"Prints a link to the previous post.":
"prefix":"previous_post"
"body":"previous_post( ${1:\\$format = '%'}${2:, \\$previous = 'previous post: '}${3:, \\$title = 'yes'}${4:, \\$in_same_cat = 'no'}${5:, \\$limitprev = 1}${6:, \\$excluded_categories = ''} )"
"Displays the previous post link that is adjacent to the current post.":
"prefix":"previous_post_link"
"body":"previous_post_link( ${1:\\$format = '« %link'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Displays or retrieves the previous posts page link.":
"prefix":"previous_posts"
"body":"previous_posts( ${1:\\$echo = true} )"
"Displays the previous posts page link.":
"prefix":"previous_posts_link"
"body":"previous_posts_link( ${1:\\$label = null} )"
"Prints the styles queue in the HTML head on admin pages.":
"prefix":"print_admin_styles"
"body":"print_admin_styles()"
"Prints column headers for a particular screen.":
"prefix":"print_column_headers"
"body":"print_column_headers( ${1:\\$screen}${2:, \\$with_id = true} )"
"Prints the necessary markup for the embed comments button.":
"prefix":"print_embed_comments_button"
"body":"print_embed_comments_button()"
"Prints the JavaScript in the embed iframe header.":
"prefix":"print_embed_scripts"
"body":"print_embed_scripts()"
"Prints the necessary markup for the embed sharing button.":
"prefix":"print_embed_sharing_button"
"body":"print_embed_sharing_button()"
"Prints the necessary markup for the embed sharing dialog.":
"prefix":"print_embed_sharing_dialog"
"body":"print_embed_sharing_dialog()"
"Prints the CSS in the embed iframe header.":
"prefix":"print_embed_styles"
"body":"print_embed_styles()"
"Print the inline Emoji detection script if it is not already printed.":
"prefix":"print_emoji_detection_script"
"body":"print_emoji_detection_script()"
"Print the important emoji-related styles.":
"prefix":"print_emoji_styles"
"body":"print_emoji_styles()"
"Prints the scripts that were queued for the footer or too late for the HTML head.":
"prefix":"print_footer_scripts"
"body":"print_footer_scripts()"
"Prints the script queue in the HTML head on admin pages.":
"prefix":"print_head_scripts"
"body":"print_head_scripts()"
"Prints the styles that were queued too late for the HTML head.":
"prefix":"print_late_styles"
"body":"print_late_styles()"
"Check whether blog is public before returning sites.":
"prefix":"privacy_ping_filter"
"body":"privacy_ping_filter( ${1:\\$sites} )"
"Sets up The Loop with query parameters.":
"prefix":"query_posts"
"body":"query_posts( ${1:\\$query} )"
"Unless open_basedir is enabled, use /dev/urandom for
random numbers in accordance with best practices":
"prefix":"random_bytes"
"body":"random_bytes( ${1:\\$bytes} )"
"Fetch a random integer between $min and $max inclusive":
"prefix":"random_int"
"body":"random_int( ${1:\\$min}${2:, \\$max} )"
"Cast to an integer if we can, safely.":
"prefix":"randomcompat_intval"
"body":"randomcompat_intval( ${1:\\$number}${2:, \\$fail_open = false} )"
"strlen() implementation that isn't brittle to mbstring.func_overload":
"prefix":"randomcompat_strlen"
"body":"randomcompat_strlen( ${1:\\$binary_string} )"
"substr() implementation that isn't brittle to mbstring.func_overload":
"prefix":"randomcompat_substr"
"body":"randomcompat_substr( ${1:\\$binary_string}${2:, \\$start}${3:, \\$length = null} )"
"Navigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.":
"prefix":"rawurlencode_deep"
"body":"rawurlencode_deep( ${1:\\$value} )"
"Get the size of a directory recursively.":
"prefix":"recurse_dirsize"
"body":"recurse_dirsize( ${1:\\$directory}${2:, \\$exclude = null} )"
"Redirects incoming links to the proper URL based on the site url.":
"prefix":"redirect_canonical"
"body":"redirect_canonical( ${1:\\$requested_url = null}${2:, \\$do_redirect = true} )"
"Attempts to guess the correct URL based on query vars":
"prefix":"redirect_guess_404_permalink"
"body":"redirect_guess_404_permalink()"
"Redirect to previous page.":
"prefix":"redirect_post"
"body":"redirect_post( ${1:\\$post_id = ''} )"
"Ensure that the current site's domain is listed in the allowed redirect host list.":
"prefix":"redirect_this_site"
"body":"redirect_this_site( ${1:\\$deprecated = ''} )"
"Clear the blog details cache.":
"prefix":"refresh_blog_details"
"body":"refresh_blog_details( ${1:\\$blog_id} )"
"Cleans the user cache for a specific user.":
"prefix":"refresh_user_details"
"body":"refresh_user_details( ${1:\\$id} )"
"Set the activation hook for a plugin.":
"prefix":"register_activation_hook"
"body":"register_activation_hook( ${1:\\$file}${2:, \\$function} )"
"Registers the default Admin color schemes":
"prefix":"register_admin_color_schemes"
"body":"register_admin_color_schemes()"
"Register column headers for a particular screen.":
"prefix":"register_column_headers"
"body":"register_column_headers( ${1:\\$screen}${2:, \\$columns} )"
"Set the deactivation hook for a plugin.":
"prefix":"register_deactivation_hook"
"body":"register_deactivation_hook( ${1:\\$file}${2:, \\$function} )"
"Register a selection of default headers to be displayed by the custom header admin UI.":
"prefix":"register_default_headers"
"body":"register_default_headers( ${1:\\$headers} )"
"Register importer for WordPress.":
"prefix":"register_importer"
"body":"register_importer( ${1:\\$id}${2:, \\$name}${3:, \\$description}${4:, \\$callback} )"
"Register default settings available in WordPress.":
"prefix":"register_initial_settings"
"body":"register_initial_settings()"
"Registers a meta key.":
"prefix":"register_meta"
"body":"register_meta( ${1:\\$object_type}${2:, \\$meta_key}${3:, \\$args}${4:, \\$deprecated = null} )"
"Registers a navigation menu location for a theme.":
"prefix":"register_nav_menu"
"body":"register_nav_menu( ${1:\\$location}${2:, \\$description} )"
"Registers navigation menu locations for a theme.":
"prefix":"register_nav_menus"
"body":"register_nav_menus( ${1:\\$locations = array()} )"
"Handles registering a new user.":
"prefix":"register_new_user"
"body":"register_new_user( ${1:\\$user_login}${2:, \\$user_email} )"
"Register a post status. Do not use before init.":
"prefix":"register_post_status"
"body":"register_post_status( ${1:\\$post_status}${2:, \\$args = array()} )"
"Registers a post type.":
"prefix":"register_post_type"
"body":"register_post_type( ${1:\\$post_type}${2:, \\$args = array()} )"
"Registers a new field on an existing WordPress object type.":
"prefix":"register_rest_field"
"body":"register_rest_field( ${1:\\$object_type}${2:, \\$attribute}${3:, \\$args = array()} )"
"Registers a REST API route.":
"prefix":"register_rest_route"
"body":"register_rest_route( ${1:\\$namespace}${2:, \\$route}${3:, \\$args = array()}${4:, \\$override = false} )"
"Register a setting and its data.":
"prefix":"register_setting"
"body":"register_setting( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$args = array()} )"
"Builds the definition for a single sidebar and returns the ID.":
"prefix":"register_sidebar"
"body":"register_sidebar( ${1:\\$args = array()} )"
"Register widget for sidebar with backward compatibility.":
"prefix":"register_sidebar_widget"
"body":"register_sidebar_widget( ${1:\\$name}${2:, \\$output_callback}${3:, \\$classname = ''}${4:, \\$params} )"
"Creates multiple sidebars.":
"prefix":"register_sidebars"
"body":"register_sidebars( ${1:\\$number = 1}${2:, \\$args = array()} )"
"Creates or modifies a taxonomy object.":
"prefix":"register_taxonomy"
"body":"register_taxonomy( ${1:\\$taxonomy}${2:, \\$object_type}${3:, \\$args = array()} )"
"Add an already registered taxonomy to an object type.":
"prefix":"register_taxonomy_for_object_type"
"body":"register_taxonomy_for_object_type( ${1:\\$taxonomy}${2:, \\$object_type} )"
"Register a directory that contains themes.":
"prefix":"register_theme_directory"
"body":"register_theme_directory( ${1:\\$directory} )"
"Set the uninstallation hook for a plugin.":
"prefix":"register_uninstall_hook"
"body":"register_uninstall_hook( ${1:\\$file}${2:, \\$callback} )"
"Register a widget":
"prefix":"register_widget"
"body":"register_widget( ${1:\\$widget_class} )"
"Registers widget control callback for customizing options. register_widget_control":
"prefix":"register_widget_control"
"body":"register_widget_control( ${1:\\$name}${2:, \\$control_callback}${3:, \\$width = ''}${4:, \\$height = ''} )"
"Checks if a meta key is registered.":
"prefix":"registered_meta_key_exists"
"body":"registered_meta_key_exists( ${1:\\$object_type}${2:, \\$meta_key} )"
"Outputs rel=canonical for singular queries.":
"prefix":"rel_canonical"
"body":"rel_canonical()"
"Converts all accent characters to ASCII characters.":
"prefix":"remove_accents"
"body":"remove_accents( ${1:\\$string} )"
"Removes a function from a specified action hook.":
"prefix":"remove_action"
"body":"remove_action( ${1:\\$tag}${2:, \\$function_to_remove}${3:, \\$priority = 10} )"
"Remove all of the hooks from an action.":
"prefix":"remove_all_actions"
"body":"remove_all_actions( ${1:\\$tag}${2:, \\$priority = false} )"
"Remove all of the hooks from a filter.":
"prefix":"remove_all_filters"
"body":"remove_all_filters( ${1:\\$tag}${2:, \\$priority = false} )"
"Clear all shortcodes.":
"prefix":"remove_all_shortcodes"
"body":"remove_all_shortcodes()"
"Remove custom background support.":
"prefix":"remove_custom_background"
"body":"remove_custom_background()"
"Remove image header support.":
"prefix":"remove_custom_image_header"
"body":"remove_custom_image_header()"
"Removes all visual editor stylesheets.":
"prefix":"remove_editor_styles"
"body":"remove_editor_styles()"
"Removes a function from a specified filter hook.":
"prefix":"remove_filter"
"body":"remove_filter( ${1:\\$tag}${2:, \\$function_to_remove}${3:, \\$priority = 10} )"
"Remove a new image size.":
"prefix":"remove_image_size"
"body":"remove_image_size( ${1:\\$name} )"
"Remove a top-level admin menu.":
"prefix":"remove_menu_page"
"body":"remove_menu_page( ${1:\\$menu_slug} )"
"Removes a meta box from one or more screens.":
"prefix":"remove_meta_box"
"body":"remove_meta_box( ${1:\\$id}${2:, \\$screen}${3:, \\$context} )"
"Unregister a setting":
"prefix":"remove_option_update_handler"
"body":"remove_option_update_handler( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$sanitize_callback = ''} )"
"Removes a list of options from the options whitelist.":
"prefix":"remove_option_whitelist"
"body":"remove_option_whitelist( ${1:\\$del_options}${2:, \\$options = ''} )"
"Removes a permalink structure.":
"prefix":"remove_permastruct"
"body":"remove_permastruct( ${1:\\$name} )"
"Remove support for a feature from a post type.":
"prefix":"remove_post_type_support"
"body":"remove_post_type_support( ${1:\\$post_type}${2:, \\$feature} )"
"Removes an item or items from a query string.":
"prefix":"remove_query_arg"
"body":"remove_query_arg( ${1:\\$key}${2:, \\$query = false} )"
"Removes an existing rewrite tag (like %postname%).":
"prefix":"remove_rewrite_tag"
"body":"remove_rewrite_tag( ${1:\\$tag} )"
"Remove role, if it exists.":
"prefix":"remove_role"
"body":"remove_role( ${1:\\$role} )"
"Removes hook for shortcode.":
"prefix":"remove_shortcode"
"body":"remove_shortcode( ${1:\\$tag} )"
"Remove an admin submenu.":
"prefix":"remove_submenu_page"
"body":"remove_submenu_page( ${1:\\$menu_slug}${2:, \\$submenu_slug} )"
"Remove theme modification name from current theme list.":
"prefix":"remove_theme_mod"
"body":"remove_theme_mod( ${1:\\$name} )"
"Remove theme modifications option for current theme.":
"prefix":"remove_theme_mods"
"body":"remove_theme_mods()"
"Allows a theme to de-register its support of a certain feature":
"prefix":"remove_theme_support"
"body":"remove_theme_support( ${1:\\$feature} )"
"Remove a user from a blog.":
"prefix":"remove_user_from_blog"
"body":"remove_user_from_blog( ${1:\\$user_id}${2:, \\$blog_id = ''}${3:, \\$reassign = ''} )"
"Displays a form to the user to request for their FTP/SSH details in order
to connect to the filesystem.":
"prefix":"request_filesystem_credentials"
"body":"request_filesystem_credentials( ${1:\\$form_post}${2:, \\$type = ''}${3:, \\$error = false}${4:, \\$context = ''}${5:, \\$extra_fields = null}${6:, \\$allow_relaxed_file_ownership = false} )"
"Checks a theme's support for a given feature before loading the functions which implement it.":
"prefix":"require_if_theme_supports"
"body":"require_if_theme_supports( ${1:\\$feature}${2:, \\$include} )"
"Load the database class file and instantiate the `$wpdb` global.":
"prefix":"require_wp_db"
"body":"require_wp_db()"
"Reset the mbstring internal encoding to a users previously set encoding.":
"prefix":"reset_mbstring_encoding"
"body":"reset_mbstring_encoding()"
"Handles resetting the user's password.":
"prefix":"reset_password"
"body":"reset_password( ${1:\\$user}${2:, \\$new_pass} )"
"Registers the default REST API filters.":
"prefix":"rest_api_default_filters"
"body":"rest_api_default_filters()"
"Registers rewrite rules for the API.":
"prefix":"rest_api_init"
"body":"rest_api_init()"
"Loads the REST API.":
"prefix":"rest_api_loaded"
"body":"rest_api_loaded()"
"Adds REST rewrite rules.":
"prefix":"rest_api_register_rewrites"
"body":"rest_api_register_rewrites()"
"Returns a contextual HTTP error code for authorization failure.":
"prefix":"rest_authorization_required_code"
"body":"rest_authorization_required_code()"
"Checks for errors when using cookie-based authentication.":
"prefix":"rest_cookie_check_errors"
"body":"rest_cookie_check_errors( ${1:\\$result} )"
"Collects cookie authentication status.":
"prefix":"rest_cookie_collect_status"
"body":"rest_cookie_collect_status()"
"Do a REST request.":
"prefix":"rest_do_request"
"body":"rest_do_request( ${1:\\$request} )"
"Ensures request arguments are a request object (for consistency).":
"prefix":"rest_ensure_request"
"body":"rest_ensure_request( ${1:\\$request} )"
"Ensures a REST response is a response object (for consistency).":
"prefix":"rest_ensure_response"
"body":"rest_ensure_response( ${1:\\$response} )"
"Retrieves the pixel sizes for avatars.":
"prefix":"rest_get_avatar_sizes"
"body":"rest_get_avatar_sizes()"
"Retrieves the avatar urls in various sizes based on a given email address.":
"prefix":"rest_get_avatar_urls"
"body":"rest_get_avatar_urls( ${1:\\$email} )"
"Parses a date into both its local and UTC equivalent, in MySQL datetime format.":
"prefix":"rest_get_date_with_gmt"
"body":"rest_get_date_with_gmt( ${1:\\$date}${2:, \\$is_utc = false} )"
"Retrieves the current REST server instance.":
"prefix":"rest_get_server"
"body":"rest_get_server()"
"Retrieves the URL prefix for any API resource.":
"prefix":"rest_get_url_prefix"
"body":"rest_get_url_prefix()"
"Handles _deprecated_argument() errors.":
"prefix":"rest_handle_deprecated_argument"
"body":"rest_handle_deprecated_argument( ${1:\\$function}${2:, \\$message}${3:, \\$version} )"
"Handles _deprecated_function() errors.":
"prefix":"rest_handle_deprecated_function"
"body":"rest_handle_deprecated_function( ${1:\\$function}${2:, \\$replacement}${3:, \\$version} )"
"Handles OPTIONS requests for the server.":
"prefix":"rest_handle_options_request"
"body":"rest_handle_options_request( ${1:\\$response}${2:, \\$handler}${3:, \\$request} )"
"Determines if a given value is boolean-like.":
"prefix":"rest_is_boolean"
"body":"rest_is_boolean( ${1:\\$maybe_bool} )"
"Determines if an IP address is valid.":
"prefix":"rest_is_ip_address"
"body":"rest_is_ip_address( ${1:\\$ip} )"
"Sends a Link header for the REST API.":
"prefix":"rest_output_link_header"
"body":"rest_output_link_header()"
"Outputs the REST API link tag into page header.":
"prefix":"rest_output_link_wp_head"
"body":"rest_output_link_wp_head()"
"Adds the REST API URL to the WP RSD endpoint.":
"prefix":"rest_output_rsd"
"body":"rest_output_rsd()"
"Parses an RFC3339 time into a Unix timestamp.":
"prefix":"rest_parse_date"
"body":"rest_parse_date( ${1:\\$date}${2:, \\$force_utc = false} )"
"Parse a request argument based on details registered to the route.":
"prefix":"rest_parse_request_arg"
"body":"rest_parse_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Changes a boolean-like value into the proper boolean value.":
"prefix":"rest_sanitize_boolean"
"body":"rest_sanitize_boolean( ${1:\\$value} )"
"Sanitize a request argument based on details registered to the route.":
"prefix":"rest_sanitize_request_arg"
"body":"rest_sanitize_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Sanitize a value based on a schema.":
"prefix":"rest_sanitize_value_from_schema"
"body":"rest_sanitize_value_from_schema( ${1:\\$value}${2:, \\$args} )"
"Sends the "Allow" header to state all methods that can be sent to the current route.":
"prefix":"rest_send_allow_header"
"body":"rest_send_allow_header( ${1:\\$response}${2:, \\$server}${3:, \\$request} )"
"Sends Cross-Origin Resource Sharing headers with API requests.":
"prefix":"rest_send_cors_headers"
"body":"rest_send_cors_headers( ${1:\\$value} )"
"Retrieves the URL to a REST endpoint.":
"prefix":"rest_url"
"body":"rest_url( ${1:\\$path = ''}${2:, \\$scheme = 'json'} )"
"Validate a request argument based on details registered to the route.":
"prefix":"rest_validate_request_arg"
"body":"rest_validate_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Validate a value based on a schema.":
"prefix":"rest_validate_value_from_schema"
"body":"rest_validate_value_from_schema( ${1:\\$value}${2:, \\$args}${3:, \\$param = ''} )"
"Restore the current blog, after calling switch_to_blog()":
"prefix":"restore_current_blog"
"body":"restore_current_blog()"
"Restores the translations according to the original locale.":
"prefix":"restore_current_locale"
"body":"restore_current_locale()"
"Restores the translations according to the previous locale.":
"prefix":"restore_previous_locale"
"body":"restore_previous_locale()"
"Handles sending password retrieval email to user.":
"prefix":"retrieve_password"
"body":"retrieve_password()"
"Look for "lost" widgets, this has to run at least on each theme change.":
"prefix":"retrieve_widgets"
"body":"retrieve_widgets( ${1:\\$theme_changed = false} )"
"Revokes Super Admin privileges.":
"prefix":"revoke_super_admin"
"body":"revoke_super_admin( ${1:\\$user_id} )"
"Rewind the loop posts.":
"prefix":"rewind_posts"
"body":"rewind_posts()"
"Determine if TinyMCE is available.":
"prefix":"rich_edit_exists"
"body":"rich_edit_exists()"
"Display the link to the Really Simple Discovery service endpoint.":
"prefix":"rsd_link"
"body":"rsd_link()"
"Displays Site Icon in RSS2.":
"prefix":"rss2_site_icon"
"body":"rss2_site_icon()"
"Display the rss enclosure for the current post.":
"prefix":"rss_enclosure"
"body":"rss_enclosure()"
"Inline CSS filter":
"prefix":"safecss_filter_attr"
"body":"safecss_filter_attr( ${1:\\$css}${2:, \\$deprecated = ''} )"
"Sanitizes all bookmark fields":
"prefix":"sanitize_bookmark"
"body":"sanitize_bookmark( ${1:\\$bookmark}${2:, \\$context = 'display'} )"
"Sanitizes a bookmark field.":
"prefix":"sanitize_bookmark_field"
"body":"sanitize_bookmark_field( ${1:\\$field}${2:, \\$value}${3:, \\$bookmark_id}${4:, \\$context} )"
"Sanitizes category data based on context.":
"prefix":"sanitize_category"
"body":"sanitize_category( ${1:\\$category}${2:, \\$context = 'display'} )"
"Sanitizes data in single category key field.":
"prefix":"sanitize_category_field"
"body":"sanitize_category_field( ${1:\\$field}${2:, \\$value}${3:, \\$cat_id}${4:, \\$context} )"
"Sanitizes the cookies sent to the user already.":
"prefix":"sanitize_comment_cookies"
"body":"sanitize_comment_cookies()"
"Strips out all characters that are not allowable in an email.":
"prefix":"sanitize_email"
"body":"sanitize_email( ${1:\\$email} )"
"Sanitizes a filename, replacing whitespace with dashes.":
"prefix":"sanitize_file_name"
"body":"sanitize_file_name( ${1:\\$filename} )"
"Sanitizes a hex color.":
"prefix":"sanitize_hex_color"
"body":"sanitize_hex_color( ${1:\\$color} )"
"Sanitizes a hex color without a hash. Use sanitize_hex_color() when possible.":
"prefix":"sanitize_hex_color_no_hash"
"body":"sanitize_hex_color_no_hash( ${1:\\$color} )"
"Sanitizes an HTML classname to ensure it only contains valid characters.":
"prefix":"sanitize_html_class"
"body":"sanitize_html_class( ${1:\\$class}${2:, \\$fallback = ''} )"
"Sanitizes a string key.":
"prefix":"sanitize_key"
"body":"sanitize_key( ${1:\\$key} )"
"Sanitize meta value.":
"prefix":"sanitize_meta"
"body":"sanitize_meta( ${1:\\$meta_key}${2:, \\$meta_value}${3:, \\$object_type} )"
"Sanitize a mime type":
"prefix":"sanitize_mime_type"
"body":"sanitize_mime_type( ${1:\\$mime_type} )"
"Sanitises various option values based on the nature of the option.":
"prefix":"sanitize_option"
"body":"sanitize_option( ${1:\\$option}${2:, \\$value} )"
"Sanitize every post field.":
"prefix":"sanitize_post"
"body":"sanitize_post( ${1:\\$post}${2:, \\$context = 'display'} )"
"Sanitize post field based on context.":
"prefix":"sanitize_post_field"
"body":"sanitize_post_field( ${1:\\$field}${2:, \\$value}${3:, \\$post_id}${4:, \\$context = 'display'} )"
"Ensures a string is a valid SQL 'order by' clause.":
"prefix":"sanitize_sql_orderby"
"body":"sanitize_sql_orderby( ${1:\\$orderby} )"
"Sanitize Term all fields.":
"prefix":"sanitize_term"
"body":"sanitize_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$context = 'display'} )"
"Cleanse the field value in the term based on the context.":
"prefix":"sanitize_term_field"
"body":"sanitize_term_field( ${1:\\$field}${2:, \\$value}${3:, \\$term_id}${4:, \\$taxonomy}${5:, \\$context} )"
"Sanitizes a string from user input or from the database.":
"prefix":"sanitize_text_field"
"body":"sanitize_text_field( ${1:\\$str} )"
"Sanitizes a multiline string from user input or from the database.":
"prefix":"sanitize_textarea_field"
"body":"sanitize_textarea_field( ${1:\\$str} )"
"Sanitizes a title, or returns a fallback title.":
"prefix":"sanitize_title"
"body":"sanitize_title( ${1:\\$title}${2:, \\$fallback_title = ''}${3:, \\$context = 'save'} )"
"Sanitizes a title with the 'query' context.":
"prefix":"sanitize_title_for_query"
"body":"sanitize_title_for_query( ${1:\\$title} )"
"Sanitizes a title, replacing whitespace and a few other characters with dashes.":
"prefix":"sanitize_title_with_dashes"
"body":"sanitize_title_with_dashes( ${1:\\$title}${2:, \\$raw_title = ''}${3:, \\$context = 'display'} )"
"Sanitize space or carriage return separated URLs that are used to send trackbacks.":
"prefix":"sanitize_trackback_urls"
"body":"sanitize_trackback_urls( ${1:\\$to_ping} )"
"Performs esc_url() for database or redirect usage.":
"prefix":"sanitize_url"
"body":"sanitize_url( ${1:\\$url}${2:, \\$protocols = null} )"
"Sanitizes a username, stripping out unsafe characters.":
"prefix":"sanitize_user"
"body":"sanitize_user( ${1:\\$username}${2:, \\$strict = false} )"
"Sanitize user field based on context.":
"prefix":"sanitize_user_field"
"body":"sanitize_user_field( ${1:\\$field}${2:, \\$value}${3:, \\$user_id}${4:, \\$context} )"
"Sanitize every user field.":
"prefix":"sanitize_user_object"
"body":"sanitize_user_object( ${1:\\$user}${2:, \\$context = 'display'} )"
"Updates the htaccess file with the current rules if it is writable.":
"prefix":"save_mod_rewrite_rules"
"body":"save_mod_rewrite_rules()"
"Saves the XML document into a file":
"prefix":"savedomdocument"
"body":"savedomdocument( ${1:\\$doc}${2:, \\$filename} )"
"Displays a screen icon.":
"prefix":"screen_icon"
"body":"screen_icon()"
"Returns the screen layout options.":
"prefix":"screen_layout"
"body":"screen_layout()"
"Renders the screen's help.":
"prefix":"screen_meta"
"body":"screen_meta()"
"Returns the screen's per-page options.":
"prefix":"screen_options"
"body":"screen_options()"
"Determine the concatenation and compression settings for scripts and styles.":
"prefix":"script_concat_settings"
"body":"script_concat_settings()"
"Search all registered theme directories for complete and valid themes.":
"prefix":"search_theme_directories"
"body":"search_theme_directories( ${1:\\$force = false} )"
"Checks to see if a string is utf8 encoded.":
"prefix":"seems_utf8"
"body":"seems_utf8( ${1:\\$str} )"
"Outputs the html selected attribute.":
"prefix":"selected"
"body":"selected( ${1:\\$selected}${2:, \\$current = true}${3:, \\$echo = true} )"
"Retrieves the URL to the admin area for either the current site or the network depending on context.":
"prefix":"self_admin_url"
"body":"self_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Display the link for the currently displayed feed in a XSS safe way.":
"prefix":"self_link"
"body":"self_link()"
"Sends an email when an email address change is requested.":
"prefix":"send_confirmation_on_profile_email"
"body":"send_confirmation_on_profile_email()"
"Send a HTTP header to limit rendering of pages to same origin iframes.":
"prefix":"send_frame_options_header"
"body":"send_frame_options_header()"
"Send a HTTP header to disable content type sniffing in browsers which support it.":
"prefix":"send_nosniff_header"
"body":"send_nosniff_header()"
"Send Access-Control-Allow-Origin and related headers if the current request
is from an allowed origin.":
"prefix":"send_origin_headers"
"body":"send_origin_headers()"
"Separates an array of comments into an array keyed by comment_type.":
"prefix":"separate_comments"
"body":"separate_comments( ${1:\\$comments} )"
"Set the current screen object":
"prefix":"set_current_screen"
"body":"set_current_screen( ${1:\\$hook_name = ''} )"
"Changes the current user by ID or name. set_current_user":
"prefix":"set_current_user"
"body":"set_current_user( ${1:\\$id}${2:, \\$name = ''} )"
"Assign a format to a post":
"prefix":"set_post_format"
"body":"set_post_format( ${1:\\$post}${2:, \\$format} )"
"Set a post thumbnail.":
"prefix":"set_post_thumbnail"
"body":"set_post_thumbnail( ${1:\\$post}${2:, \\$thumbnail_id} )"
"Registers an image size for the post thumbnail.":
"prefix":"set_post_thumbnail_size"
"body":"set_post_thumbnail_size( ${1:\\$width}${2:, \\$height}${3:, \\$crop = false} )"
"Update the post type for the post ID.":
"prefix":"set_post_type"
"body":"set_post_type( ${1:\\$post_id}${2:, \\$post_type = 'post'} )"
"Set query variable.":
"prefix":"set_query_var"
"body":"set_query_var( ${1:\\$var}${2:, \\$value} )"
"Saves option for number of rows when listing posts, pages, comments, etc.":
"prefix":"set_screen_options"
"body":"set_screen_options()"
"Set/update the value of a site transient.":
"prefix":"set_site_transient"
"body":"set_site_transient( ${1:\\$transient}${2:, \\$value}${3:, \\$expiration} )"
"Update theme modification value for the current theme.":
"prefix":"set_theme_mod"
"body":"set_theme_mod( ${1:\\$name}${2:, \\$value} )"
"Set/update the value of a transient.":
"prefix":"set_transient"
"body":"set_transient( ${1:\\$transient}${2:, \\$value}${3:, \\$expiration} )"
"Sets the scheme for a URL.":
"prefix":"set_url_scheme"
"body":"set_url_scheme( ${1:\\$url}${2:, \\$scheme = null} )"
"Add or update user interface setting.":
"prefix":"set_user_setting"
"body":"set_user_setting( ${1:\\$name}${2:, \\$value} )"
"Display settings errors registered by add_settings_error().":
"prefix":"settings_errors"
"body":"settings_errors( ${1:\\$setting = ''}${2:, \\$sanitize = false}${3:, \\$hide_on_update = false} )"
"Output nonce, action, and option_page fields for a settings page.":
"prefix":"settings_fields"
"body":"settings_fields( ${1:\\$option_group} )"
"setup_config_display_header":
"prefix":"setup_config_display_header"
"body":"setup_config_display_header()"
"Set up global post data.":
"prefix":"setup_postdata"
"body":"setup_postdata( ${1:\\$post} )"
"Set up global user vars.":
"prefix":"setup_userdata"
"body":"setup_userdata( ${1:\\$for_user_id = ''} )"
"Combine user attributes with known attributes and fill in defaults when needed.":
"prefix":"shortcode_atts"
"body":"shortcode_atts( ${1:\\$pairs}${2:, \\$atts}${3:, \\$shortcode = ''} )"
"Whether a registered shortcode exists named $tag":
"prefix":"shortcode_exists"
"body":"shortcode_exists( ${1:\\$tag} )"
"Retrieve all attributes from the shortcodes tag.":
"prefix":"shortcode_parse_atts"
"body":"shortcode_parse_atts( ${1:\\$text} )"
"Don't auto-p wrap shortcodes that stand alone":
"prefix":"shortcode_unautop"
"body":"shortcode_unautop( ${1:\\$pee} )"
"Sets the display status of the admin bar.":
"prefix":"show_admin_bar"
"body":"show_admin_bar( ${1:\\$show} )"
"Generates and displays the Signup and Create Site forms":
"prefix":"show_blog_form"
"body":"show_blog_form( ${1:\\$blogname = ''}${2:, \\$blog_title = ''}${3:, \\$errors = ''} )"
"Displays the given administration message.":
"prefix":"show_message"
"body":"show_message( ${1:\\$message} )"
"Display user registration form":
"prefix":"show_user_form"
"body":"show_user_form( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$errors = ''} )"
"Runs just before PHP shuts down execution.":
"prefix":"shutdown_action_hook"
"body":"shutdown_action_hook()"
"Allow returning users to sign up for another site":
"prefix":"signup_another_blog"
"body":"signup_another_blog( ${1:\\$blogname = ''}${2:, \\$blog_title = ''}${3:, \\$errors = ''} )"
"Setup the new site signup":
"prefix":"signup_blog"
"body":"signup_blog( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$blogname = ''}${4:, \\$blog_title = ''}${5:, \\$errors = ''} )"
"Retrieves languages available during the site/user signup process.":
"prefix":"signup_get_available_languages"
"body":"signup_get_available_languages()"
"Process the signup nonce created in signup_nonce_fields().":
"prefix":"signup_nonce_check"
"body":"signup_nonce_check( ${1:\\$result} )"
"Add a nonce field to the signup page.":
"prefix":"signup_nonce_fields"
"body":"signup_nonce_fields()"
"Setup the new user signup process":
"prefix":"signup_user"
"body":"signup_user( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$errors = ''} )"
"Display or retrieve page title for category archive.":
"prefix":"single_cat_title"
"body":"single_cat_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for post archive based on date.":
"prefix":"single_month_title"
"body":"single_month_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for post.":
"prefix":"single_post_title"
"body":"single_post_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for tag post archive.":
"prefix":"single_tag_title"
"body":"single_tag_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for taxonomy term archive.":
"prefix":"single_term_title"
"body":"single_term_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Displays an admin notice to upgrade all sites after a core upgrade.":
"prefix":"site_admin_notice"
"body":"site_admin_notice()"
"Displays the Site Icon URL.":
"prefix":"site_icon_url"
"body":"site_icon_url( ${1:\\$size = 512}${2:, \\$url = ''}${3:, \\$blog_id} )"
"Retrieves the URL for the current site where WordPress application files
(e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.":
"prefix":"site_url"
"body":"site_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Convert number of bytes largest unit bytes will fit into.":
"prefix":"size_format"
"body":"size_format( ${1:\\$bytes}${2:, \\$decimals} )"
"Convert smiley code to the icon graphic file equivalent.":
"prefix":"smilies_init"
"body":"smilies_init()"
"sort_menu":
"prefix":"sort_menu"
"body":"sort_menu( ${1:\\$a}${2:, \\$b} )"
"Sends a request to run cron through HTTP request that doesn't halt page loading.":
"prefix":"spawn_cron"
"body":"spawn_cron( ${1:\\$gmt_time} )"
"Retrieves the registered autoloader functions.":
"prefix":"spl_autoload_functions"
"body":"spl_autoload_functions()"
"Registers a function to be autoloaded.":
"prefix":"spl_autoload_register"
"body":"spl_autoload_register( ${1:\\$autoload_function}${2:, \\$throw = true}${3:, \\$prepend = false} )"
"Unregisters an autoloader function.":
"prefix":"spl_autoload_unregister"
"body":"spl_autoload_unregister( ${1:\\$function} )"
"Display relational link for the first post.":
"prefix":"start_post_rel_link"
"body":"start_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_cat = false}${3:, \\$excluded_categories = ''} )"
"Sets up the WordPress Loop.":
"prefix":"start_wp"
"body":"start_wp()"
"XML callback function for the start of a new XML tag.":
"prefix":"startelement"
"body":"startelement( ${1:\\$parser}${2:, \\$tagName}${3:, \\$attrs} )"
"Set HTTP status header.":
"prefix":"status_header"
"body":"status_header( ${1:\\$code}${2:, \\$description = ''} )"
"Make a post sticky.":
"prefix":"stick_post"
"body":"stick_post( ${1:\\$post_id} )"
"Display "sticky" CSS class, if a post is sticky.":
"prefix":"sticky_class"
"body":"sticky_class( ${1:\\$post_id = null} )"
"Streams image in post to browser, along with enqueued changes
in $_REQUEST['history']":
"prefix":"stream_preview_image"
"body":"stream_preview_image( ${1:\\$post_id} )"
"Strips the #fragment from a URL, if one is present.":
"prefix":"strip_fragment_from_url"
"body":"strip_fragment_from_url( ${1:\\$url} )"
"Strips a shortcode tag based on RegEx matches against post content.":
"prefix":"strip_shortcode_tag"
"body":"strip_shortcode_tag( ${1:\\$m} )"
"Remove all shortcode tags from the given content.":
"prefix":"strip_shortcodes"
"body":"strip_shortcodes( ${1:\\$content} )"
"Navigates through an array, object, or scalar, and removes slashes from the values.":
"prefix":"stripslashes_deep"
"body":"stripslashes_deep( ${1:\\$value} )"
"Callback function for `stripslashes_deep()` which strips slashes from strings.":
"prefix":"stripslashes_from_strings_only"
"body":"stripslashes_from_strings_only( ${1:\\$value} )"
"Echoes a submit button, with provided text and appropriate class(es).":
"prefix":"submit_button"
"body":"submit_button( ${1:\\$text = null}${2:, \\$type = 'primary'}${3:, \\$name = 'submit'}${4:, \\$wrap = true}${5:, \\$other_attributes = null} )"
"Switches the theme.":
"prefix":"switch_theme"
"body":"switch_theme( ${1:\\$stylesheet} )"
"Switch the current blog.":
"prefix":"switch_to_blog"
"body":"switch_to_blog( ${1:\\$new_blog}${2:, \\$deprecated = null} )"
"Switches the translations according to the given locale.":
"prefix":"switch_to_locale"
"body":"switch_to_locale( ${1:\\$locale} )"
"Synchronize category and post tag slugs when global terms are enabled.":
"prefix":"sync_category_tag_slugs"
"body":"sync_category_tag_slugs( ${1:\\$term}${2:, \\$taxonomy} )"
"Retrieve tag description.":
"prefix":"tag_description"
"body":"tag_description( ${1:\\$tag} )"
"Escape an HTML tag name.":
"prefix":"tag_escape"
"body":"tag_escape( ${1:\\$tag_name} )"
"Check whether a post tag with a given name exists.":
"prefix":"tag_exists"
"body":"tag_exists( ${1:\\$tag_name} )"
"Checks that the taxonomy name exists. taxonomy_exists":
"prefix":"taxonomy_exists"
"body":"taxonomy_exists( ${1:\\$taxonomy} )"
"Retrieve term description.":
"prefix":"term_description"
"body":"term_description( ${1:\\$term}${2:, \\$taxonomy = 'post_tag'} )"
"Check if Term exists term_exists.":
"prefix":"term_exists"
"body":"term_exists( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$parent = null} )"
"Check if a term is an ancestor of another term.":
"prefix":"term_is_ancestor_of"
"body":"term_is_ancestor_of( ${1:\\$term1}${2:, \\$term2}${3:, \\rel$taxonomy} )"
"Display category, tag, term, or author description.":
"prefix":"the_archive_description"
"body":"the_archive_description( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Display the archive title based on the queried object.":
"prefix":"the_archive_title"
"body":"the_archive_title( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Display an attachment page link using an image or icon.":
"prefix":"the_attachment_link"
"body":"the_attachment_link( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$deprecated = false}${4:, \\$permalink = false} )"
"This was once used to display attachment links. Now it is deprecated and stubbed.":
"prefix":"the_attachment_links"
"body":"the_attachment_links( ${1:\\$id = false} )"
"Display the name of the author of the current post.":
"prefix":"the_author"
"body":"the_author( ${1:\\$deprecated = ''}${2:, \\$deprecated_echo = true} )"
"Display the AIM address of the author of the current post.":
"prefix":"the_author_aim"
"body":"the_author_aim()"
"Display the description of the author of the current post.":
"prefix":"the_author_description"
"body":"the_author_description()"
"Display the email of the author of the current post.":
"prefix":"the_author_email"
"body":"the_author_email()"
"Display the first name of the author of the current post.":
"prefix":"the_author_firstname"
"body":"the_author_firstname()"
"Display the ICQ number of the author of the current post.":
"prefix":"the_author_icq"
"body":"the_author_icq()"
"Display the ID of the author of the current post.":
"prefix":"the_author_id"
"body":"the_author_id()"
"Display the last name of the author of the current post.":
"prefix":"the_author_lastname"
"body":"the_author_lastname()"
"Display either author's link or author's name.":
"prefix":"the_author_link"
"body":"the_author_link()"
"Display the login name of the author of the current post.":
"prefix":"the_author_login"
"body":"the_author_login()"
"Outputs the field from the user's DB object. Defaults to current post's author.":
"prefix":"the_author_meta"
"body":"the_author_meta( ${1:\\$field = ''}${2:, \\$user_id = false} )"
"Display the MSN address of the author of the current post.":
"prefix":"the_author_msn"
"body":"the_author_msn()"
"Display the nickname of the author of the current post.":
"prefix":"the_author_nickname"
"body":"the_author_nickname()"
"Display the number of posts by the author of the current post.":
"prefix":"the_author_posts"
"body":"the_author_posts()"
"Displays an HTML link to the author page of the current post's author.":
"prefix":"the_author_posts_link"
"body":"the_author_posts_link( ${1:\\$deprecated = ''} )"
"Display the URL to the home page of the author of the current post.":
"prefix":"the_author_url"
"body":"the_author_url()"
"Display the Yahoo! IM name of the author of the current post.":
"prefix":"the_author_yim"
"body":"the_author_yim()"
"Display category list for a post in either HTML list or custom format.":
"prefix":"the_category"
"body":"the_category( ${1:\\$separator = ''}${2:, \\$parents = ''}${3:, \\$post_id = false} )"
"Prints a category with optional text before and after.":
"prefix":"the_category_head"
"body":"the_category_head( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Returns or prints a category ID.":
"prefix":"the_category_id"
"body":"the_category_id( ${1:\\$echo = true} )"
"Display the post categories in the feed.":
"prefix":"the_category_rss"
"body":"the_category_rss( ${1:\\$type = null} )"
"Iterate comment index in the comment loop.":
"prefix":"the_comment"
"body":"the_comment()"
"Displays navigation to next/previous set of comments, when applicable.":
"prefix":"the_comments_navigation"
"body":"the_comments_navigation( ${1:\\$args = array()} )"
"Displays a paginated navigation to next/previous set of comments, when applicable.":
"prefix":"the_comments_pagination"
"body":"the_comments_pagination( ${1:\\$args = array()} )"
"Display the post content.":
"prefix":"the_content"
"body":"the_content( ${1:\\$more_link_text = null}${2:, \\$strip_teaser = false} )"
"Display the post content for feeds.":
"prefix":"the_content_feed"
"body":"the_content_feed( ${1:\\$feed_type = null} )"
"Display the post content for the feed.":
"prefix":"the_content_rss"
"body":"the_content_rss( ${1:\\$more_link_text = '(more...)'}${2:, \\$stripteaser}${3:, \\$more_file = ''}${4:, \\$cut}${5:, \\$encode_html} )"
"Print the markup for a custom header.":
"prefix":"the_custom_header_markup"
"body":"the_custom_header_markup()"
"Displays a custom logo, linked to home.":
"prefix":"the_custom_logo"
"body":"the_custom_logo( ${1:\\$blog_id} )"
"Display or Retrieve the date the current post was written (once per date)":
"prefix":"the_date"
"body":"the_date( ${1:\\$d = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$echo = true} )"
"Outputs the date in iso8601 format for xml files.":
"prefix":"the_date_xml"
"body":"the_date_xml()"
"Displays an editor: TinyMCE, HTML, or both.":
"prefix":"the_editor"
"body":"the_editor( ${1:\\$content}${2:, \\$id = 'content'}${3:, \\$prev_id = 'title'}${4:, \\$media_buttons = true}${5:, \\$tab_index = 2}${6:, \\$extended = true} )"
"Prints the necessary markup for the site title in an embed template.":
"prefix":"the_embed_site_title"
"body":"the_embed_site_title()"
"Display the post excerpt.":
"prefix":"the_excerpt"
"body":"the_excerpt()"
"Displays the post excerpt for the embed template.":
"prefix":"the_excerpt_embed"
"body":"the_excerpt_embed()"
"Display the post excerpt for the feed.":
"prefix":"the_excerpt_rss"
"body":"the_excerpt_rss()"
"Displays the permalink for the feed type.":
"prefix":"the_feed_link"
"body":"the_feed_link( ${1:\\$anchor}${2:, \\$feed = ''} )"
"Display the generator XML or Comment for RSS, ATOM, etc.":
"prefix":"the_generator"
"body":"the_generator( ${1:\\$type} )"
"Display the Post Global Unique Identifier (guid).":
"prefix":"the_guid"
"body":"the_guid( ${1:\\$post} )"
"Display the image markup for a custom header image.":
"prefix":"the_header_image_tag"
"body":"the_header_image_tag( ${1:\\$attr = array()} )"
"Display header video URL.":
"prefix":"the_header_video_url"
"body":"the_header_video_url()"
"Display the ID of the current item in the WordPress Loop.":
"prefix":"the_id"
"body":"the_id()"
"Outputs the legacy media upload tabs UI.":
"prefix":"the_media_upload_tabs"
"body":"the_media_upload_tabs()"
"Display list of post custom fields.":
"prefix":"the_meta"
"body":"the_meta()"
"Display the name of the author who last edited the current post,
if the author's ID is available.":
"prefix":"the_modified_author"
"body":"the_modified_author()"
"Display the date on which the post was last modified.":
"prefix":"the_modified_date"
"body":"the_modified_date( ${1:\\$d = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$echo = true} )"
"Display the time at which the post was last modified.":
"prefix":"the_modified_time"
"body":"the_modified_time( ${1:\\$d = ''} )"
"Displays the permalink for the current post.":
"prefix":"the_permalink"
"body":"the_permalink( ${1:\\$post} )"
"Display the permalink to the post for use in feeds.":
"prefix":"the_permalink_rss"
"body":"the_permalink_rss()"
"Iterate the post index in the loop.":
"prefix":"the_post"
"body":"the_post()"
"Displays the navigation to next/previous post, when applicable.":
"prefix":"the_post_navigation"
"body":"the_post_navigation( ${1:\\$args = array()} )"
"Displays the post password.":
"prefix":"the_post_password"
"body":"the_post_password()"
"Display the post thumbnail.":
"prefix":"the_post_thumbnail"
"body":"the_post_thumbnail( ${1:\\$size = 'post-thumbnail'}${2:, \\$attr = ''} )"
"Displays the post thumbnail caption.":
"prefix":"the_post_thumbnail_caption"
"body":"the_post_thumbnail_caption( ${1:\\$post = null} )"
"Display the post thumbnail URL.":
"prefix":"the_post_thumbnail_url"
"body":"the_post_thumbnail_url( ${1:\\$size = 'post-thumbnail'} )"
"Displays the navigation to next/previous set of posts, when applicable.":
"prefix":"the_posts_navigation"
"body":"the_posts_navigation( ${1:\\$args = array()} )"
"Displays a paginated navigation to next/previous set of posts, when applicable.":
"prefix":"the_posts_pagination"
"body":"the_posts_pagination( ${1:\\$args = array()} )"
"Displays the contents of the search query variable.":
"prefix":"the_search_query"
"body":"the_search_query()"
"Displays the shortlink for a post.":
"prefix":"the_shortlink"
"body":"the_shortlink( ${1:\\$text = ''}${2:, \\$title = ''}${3:, \\$before = ''}${4:, \\$after = ''} )"
"Retrieve the tags for a post. the_tags":
"prefix":"the_tags"
"body":"the_tags( ${1:\\$before = null}${2:, \\$sep = ', '}${3:, \\$after = ''} )"
"Display the taxonomies of a post with available options.":
"prefix":"the_taxonomies"
"body":"the_taxonomies( ${1:\\$args = array()} )"
"Display the terms in a list.":
"prefix":"the_terms"
"body":"the_terms( ${1:\\$id}${2:, \\$taxonomy}${3:, \\$before = ''}${4:, \\$sep = ', '}${5:, \\$after = ''} )"
"Display the time at which the post was written.":
"prefix":"the_time"
"body":"the_time( ${1:\\$d = ''} )"
"Display or retrieve the current post title with optional markup.":
"prefix":"the_title"
"body":"the_title( ${1:\\$before = ''}${2:, \\$after = ''}${3:, \\$echo = true} )"
"Sanitize the current title when retrieving or displaying.":
"prefix":"the_title_attribute"
"body":"the_title_attribute( ${1:\\$args = ''} )"
"Display the post title in the feed.":
"prefix":"the_title_rss"
"body":"the_title_rss()"
"Display the weekday on which the post was written. the_weekdayre":
"prefix":"the_weekday"
"body":"the_weekday()"
"Display the weekday on which the post was written.":
"prefix":"the_weekday_date"
"body":"the_weekday_date( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Output an arbitrary widget as a template tag.":
"prefix":"the_widget"
"body":"the_widget( ${1:\\$widget}${2:, \\$instance = array()}${3:, \\$args = array()} )"
"Check if there is an update for a theme available.":
"prefix":"theme_update_available"
"body":"theme_update_available( ${1:\\$theme} )"
"Retrieves theme installer pages from the WordPress.org Themes API.":
"prefix":"themes_api"
"body":"themes_api( ${1:\\$action}${2:, \\$args = array()} )"
"Start the WordPress micro-timer.":
"prefix":"timer_start"
"body":"timer_start()"
"Retrieve or display the time from the page start to when function is called.":
"prefix":"timer_stop"
"body":"timer_stop( ${1:\\$display}${2:, \\$precision = 3} )"
"tinymce_include":
"prefix":"tinymce_include"
"body":"tinymce_include()"
"Print out HTML form date elements for editing post or comment publish date.":
"prefix":"touch_time"
"body":"touch_time( ${1:\\$edit = 1}${2:, \\$for_post = 1}${3:, \\$tab_index}${4:, \\$multi} )"
"Send a Trackback.":
"prefix":"trackback"
"body":"trackback( ${1:\\$trackback_url}${2:, \\$title}${3:, \\$excerpt}${4:, \\$ID} )"
"Generate and display the RDF for the trackback information of current post.":
"prefix":"trackback_rdf"
"body":"trackback_rdf( ${1:\\$deprecated = ''} )"
"Response to a trackback.":
"prefix":"trackback_response"
"body":"trackback_response( ${1:\\$error}${2:, \\$error_message = ''} )"
"Display the current post's trackback URL.":
"prefix":"trackback_url"
"body":"trackback_url( ${1:\\$deprecated_echo = true} )"
"Do trackbacks for a list of URLs.":
"prefix":"trackback_url_list"
"body":"trackback_url_list( ${1:\\$tb_list}${2:, \\$post_id} )"
"Appends a trailing slash.":
"prefix":"trailingslashit"
"body":"trailingslashit( ${1:\\$string} )"
"Retrieve the translation of $text. translate":
"prefix":"translate"
"body":"translate( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate user level to user role name.":
"prefix":"translate_level_to_role"
"body":"translate_level_to_role( ${1:\\$level} )"
"Translates and retrieves the singular or plural form of a string that's been registered
with _n_noop() or _nx_noop().":
"prefix":"translate_nooped_plural"
"body":"translate_nooped_plural( ${1:\\$nooped_plural}${2:, \\$count}${3:, \\$domain = 'default'} )"
"Convert one smiley code to the icon graphic file equivalent.":
"prefix":"translate_smiley"
"body":"translate_smiley( ${1:\\$matches} )"
"Translates role name.":
"prefix":"translate_user_role"
"body":"translate_user_role( ${1:\\$name} )"
"Translates $text like translate(), but assumes that the text
contains a context after its last vertical bar.":
"prefix":"translate_with_context"
"body":"translate_with_context( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Retrieve the translation of $text in the context defined in $context.":
"prefix":"translate_with_gettext_context"
"body":"translate_with_gettext_context( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Retrieve translations from WordPress Translation API.":
"prefix":"translations_api"
"body":"translations_api( ${1:\\$type}${2:, \\$args = null} )"
"Handles retrieving the insert-from-URL form for an audio file.":
"prefix":"type_url_form_audio"
"body":"type_url_form_audio()"
"Handles retrieving the insert-from-URL form for a generic file.":
"prefix":"type_url_form_file"
"body":"type_url_form_file()"
"Handles retrieving the insert-from-URL form for an image.":
"prefix":"type_url_form_image"
"body":"type_url_form_image()"
"Handles retrieving the insert-from-URL form for a video file.":
"prefix":"type_url_form_video"
"body":"type_url_form_video()"
"undismiss_core_update":
"prefix":"undismiss_core_update"
"body":"undismiss_core_update( ${1:\\$version}${2:, \\$locale} )"
"Remove placeholders added by do_shortcodes_in_html_tags().":
"prefix":"unescape_invalid_shortcodes"
"body":"unescape_invalid_shortcodes( ${1:\\$content} )"
"Uninstall a single plugin.":
"prefix":"uninstall_plugin"
"body":"uninstall_plugin( ${1:\\$plugin} )"
"Unload translations for a text domain.":
"prefix":"unload_textdomain"
"body":"unload_textdomain( ${1:\\$domain} )"
"Unregister default headers.":
"prefix":"unregister_default_headers"
"body":"unregister_default_headers( ${1:\\$header} )"
"Unregisters a meta key from the list of registered keys.":
"prefix":"unregister_meta_key"
"body":"unregister_meta_key( ${1:\\$object_type}${2:, \\$meta_key} )"
"Unregisters a navigation menu location for a theme.":
"prefix":"unregister_nav_menu"
"body":"unregister_nav_menu( ${1:\\$location} )"
"Unregisters a post type.":
"prefix":"unregister_post_type"
"body":"unregister_post_type( ${1:\\$post_type} )"
"Unregister a setting.":
"prefix":"unregister_setting"
"body":"unregister_setting( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$deprecated = ''} )"
"Removes a sidebar from the list.":
"prefix":"unregister_sidebar"
"body":"unregister_sidebar( ${1:\\$sidebar_id} )"
"Serves as an alias of wp_unregister_sidebar_widget().":
"prefix":"unregister_sidebar_widget"
"body":"unregister_sidebar_widget( ${1:\\$id} )"
"Unregisters a taxonomy.":
"prefix":"unregister_taxonomy"
"body":"unregister_taxonomy( ${1:\\$taxonomy} )"
"Remove an already registered taxonomy from an object type.":
"prefix":"unregister_taxonomy_for_object_type"
"body":"unregister_taxonomy_for_object_type( ${1:\\$taxonomy}${2:, \\$object_type} )"
"Unregisters a widget.":
"prefix":"unregister_widget"
"body":"unregister_widget( ${1:\\$widget_class} )"
"Alias of wp_unregister_widget_control().":
"prefix":"unregister_widget_control"
"body":"unregister_widget_control( ${1:\\$id} )"
"Un-stick a post.":
"prefix":"unstick_post"
"body":"unstick_post( ${1:\\$post_id} )"
"Removes trailing forward slashes and backslashes if they exist.":
"prefix":"untrailingslashit"
"body":"untrailingslashit( ${1:\\$string} )"
"Unzips a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction.":
"prefix":"unzip_file"
"body":"unzip_file( ${1:\\$file}${2:, \\$to} )"
"Update the 'archived' status of a particular blog.":
"prefix":"update_archived"
"body":"update_archived( ${1:\\$id}${2:, \\$archived} )"
"Update attachment file path based on attachment ID.":
"prefix":"update_attached_file"
"body":"update_attached_file( ${1:\\$attachment_id}${2:, \\$file} )"
"Update the details for a blog. Updates the blogs table for a given blog id.":
"prefix":"update_blog_details"
"body":"update_blog_details( ${1:\\$blog_id}${2:, \\$details = array()} )"
"Update an option for a particular blog.":
"prefix":"update_blog_option"
"body":"update_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update this blog's 'public' setting in the global blogs table.":
"prefix":"update_blog_public"
"body":"update_blog_public( ${1:\\$old_value}${2:, \\$value} )"
"Update a blog details field.":
"prefix":"update_blog_status"
"body":"update_blog_status( ${1:\\$blog_id}${2:, \\$pref}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update the categories cache.":
"prefix":"update_category_cache"
"body":"update_category_cache()"
"Updates the comment cache of given comments.":
"prefix":"update_comment_cache"
"body":"update_comment_cache( ${1:\\$comments}${2:, \\$update_meta_cache = true} )"
"Update comment meta field based on comment ID.":
"prefix":"update_comment_meta"
"body":"update_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Upgrades the core of WordPress.":
"prefix":"update_core"
"body":"update_core( ${1:\\$from}${2:, \\$to} )"
"Adds the gallery tab back to the tabs array if post has image attachments":
"prefix":"update_gallery_tab"
"body":"update_gallery_tab( ${1:\\$tabs} )"
"Flushes rewrite rules if siteurl, home or page_on_front changed.":
"prefix":"update_home_siteurl"
"body":"update_home_siteurl( ${1:\\$old_value}${2:, \\$value} )"
"Update post meta data by meta ID.":
"prefix":"update_meta"
"body":"update_meta( ${1:\\$meta_id}${2:, \\$meta_key}${3:, \\$meta_value} )"
"Update the metadata cache for the specified objects.":
"prefix":"update_meta_cache"
"body":"update_meta_cache( ${1:\\$meta_type}${2:, \\$object_ids} )"
"Update metadata for the specified object. If no value already exists for the specified object
ID and metadata key, the metadata will be added.":
"prefix":"update_metadata"
"body":"update_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value}${5:, \\$prev_value = ''} )"
"Update meta data by meta ID":
"prefix":"update_metadata_by_mid"
"body":"update_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id}${3:, \\$meta_value}${4:, \\$meta_key = false} )"
"update_nag":
"prefix":"update_nag"
"body":"update_nag()"
"Updates the network cache of given networks.":
"prefix":"update_network_cache"
"body":"update_network_cache( ${1:\\$networks} )"
"Update the value of a network option that was already added.":
"prefix":"update_network_option"
"body":"update_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$value} )"
"Updates the cache for the given term object ID(s).":
"prefix":"update_object_term_cache"
"body":"update_object_term_cache( ${1:\\$object_ids}${2:, \\$object_type} )"
"Update the value of an option that was already added.":
"prefix":"update_option"
"body":"update_option( ${1:\\$option}${2:, \\$value}${3:, \\$autoload = null} )"
"Sends an email when a site administrator email address is changed.":
"prefix":"update_option_new_admin_email"
"body":"update_option_new_admin_email( ${1:\\$old_value}${2:, \\$value} )"
"Alias of update_post_cache().":
"prefix":"update_page_cache"
"body":"update_page_cache( ${1:\\$pages} )"
"Updates posts in cache.":
"prefix":"update_post_cache"
"body":"update_post_cache( ${1:\\$posts} )"
"Call major cache updating functions for list of Post objects.":
"prefix":"update_post_caches"
"body":"update_post_caches( ${1:\\$posts}${2:, \\$post_type = 'post'}${3:, \\$update_term_cache = true}${4:, \\$update_meta_cache = true} )"
"Update post meta field based on post ID.":
"prefix":"update_post_meta"
"body":"update_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Update cache for thumbnails in the current loop.":
"prefix":"update_post_thumbnail_cache"
"body":"update_post_thumbnail_cache( ${1:\\$wp_query = null} )"
"Updates metadata cache for list of post IDs.":
"prefix":"update_postmeta_cache"
"body":"update_postmeta_cache( ${1:\\$post_ids} )"
"Update a blog's post count.":
"prefix":"update_posts_count"
"body":"update_posts_count( ${1:\\$deprecated = ''} )"
"Update the "recently-edited" file for the plugin or theme editor.":
"prefix":"update_recently_edited"
"body":"update_recently_edited( ${1:\\$file} )"
"update_right_now_message":
"prefix":"update_right_now_message"
"body":"update_right_now_message()"
"Updates sites in cache.":
"prefix":"update_site_cache"
"body":"update_site_cache( ${1:\\$sites} )"
"Update the value of an option that was already added for the current network.":
"prefix":"update_site_option"
"body":"update_site_option( ${1:\\$option}${2:, \\$value} )"
"Updates Terms to Taxonomy in cache.":
"prefix":"update_term_cache"
"body":"update_term_cache( ${1:\\$terms}${2:, \\$taxonomy = ''} )"
"Updates term metadata.":
"prefix":"update_term_meta"
"body":"update_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Updates metadata cache for list of term IDs.":
"prefix":"update_termmeta_cache"
"body":"update_termmeta_cache( ${1:\\$term_ids} )"
"Update all user caches":
"prefix":"update_user_caches"
"body":"update_user_caches( ${1:\\$user} )"
"Update user meta field based on user ID.":
"prefix":"update_user_meta"
"body":"update_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Update user option with global blog capability.":
"prefix":"update_user_option"
"body":"update_user_option( ${1:\\$user_id}${2:, \\$option_name}${3:, \\$newvalue}${4:, \\$global = false} )"
"Update the status of a user in the database.":
"prefix":"update_user_status"
"body":"update_user_status( ${1:\\$id}${2:, \\$pref}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update metadata of user.":
"prefix":"update_usermeta"
"body":"update_usermeta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value} )"
"Execute changes made in WordPress 1.0.":
"prefix":"upgrade_100"
"body":"upgrade_100()"
"Execute changes made in WordPress 1.0.1.":
"prefix":"upgrade_101"
"body":"upgrade_101()"
"Execute changes made in WordPress 1.2.":
"prefix":"upgrade_110"
"body":"upgrade_110()"
"Execute changes made in WordPress 1.5.":
"prefix":"upgrade_130"
"body":"upgrade_130()"
"Execute changes made in WordPress 2.0.":
"prefix":"upgrade_160"
"body":"upgrade_160()"
"Execute changes made in WordPress 2.1.":
"prefix":"upgrade_210"
"body":"upgrade_210()"
"Execute changes made in WordPress 2.3.":
"prefix":"upgrade_230"
"body":"upgrade_230()"
"Remove old categories, link2cat, and post2cat database tables.":
"prefix":"upgrade_230_old_tables"
"body":"upgrade_230_old_tables()"
"Remove old options from the database.":
"prefix":"upgrade_230_options_table"
"body":"upgrade_230_options_table()"
"Execute changes made in WordPress 2.5.0.":
"prefix":"upgrade_250"
"body":"upgrade_250()"
"Execute changes made in WordPress 2.5.2.":
"prefix":"upgrade_252"
"body":"upgrade_252()"
"Execute changes made in WordPress 2.6.":
"prefix":"upgrade_260"
"body":"upgrade_260()"
"Execute changes made in WordPress 2.7.":
"prefix":"upgrade_270"
"body":"upgrade_270()"
"Execute changes made in WordPress 2.8.":
"prefix":"upgrade_280"
"body":"upgrade_280()"
"Execute changes made in WordPress 2.9.":
"prefix":"upgrade_290"
"body":"upgrade_290()"
"Execute changes made in WordPress 3.0.":
"prefix":"upgrade_300"
"body":"upgrade_300()"
"Execute changes made in WordPress 3.3.":
"prefix":"upgrade_330"
"body":"upgrade_330()"
"Execute changes made in WordPress 3.4.":
"prefix":"upgrade_340"
"body":"upgrade_340()"
"Execute changes made in WordPress 3.5.":
"prefix":"upgrade_350"
"body":"upgrade_350()"
"Execute changes made in WordPress 3.7.":
"prefix":"upgrade_370"
"body":"upgrade_370()"
"Execute changes made in WordPress 3.7.2.":
"prefix":"upgrade_372"
"body":"upgrade_372()"
"Execute changes made in WordPress 3.8.0.":
"prefix":"upgrade_380"
"body":"upgrade_380()"
"Execute changes made in WordPress 4.0.0.":
"prefix":"upgrade_400"
"body":"upgrade_400()"
"Execute changes made in WordPress 4.2.0.":
"prefix":"upgrade_420"
"body":"upgrade_420()"
"Executes changes made in WordPress 4.3.0.":
"prefix":"upgrade_430"
"body":"upgrade_430()"
"Executes comments changes made in WordPress 4.3.0.":
"prefix":"upgrade_430_fix_comments"
"body":"upgrade_430_fix_comments()"
"Executes changes made in WordPress 4.3.1.":
"prefix":"upgrade_431"
"body":"upgrade_431()"
"Executes changes made in WordPress 4.4.0.":
"prefix":"upgrade_440"
"body":"upgrade_440()"
"Executes changes made in WordPress 4.5.0.":
"prefix":"upgrade_450"
"body":"upgrade_450()"
"Executes changes made in WordPress 4.6.0.":
"prefix":"upgrade_460"
"body":"upgrade_460()"
"Functions to be called in install and upgrade scripts.":
"prefix":"upgrade_all"
"body":"upgrade_all()"
"Executes network-level upgrade routines.":
"prefix":"upgrade_network"
"body":"upgrade_network()"
"Upgrade old slugs made in version 2.2.":
"prefix":"upgrade_old_slugs"
"body":"upgrade_old_slugs()"
"Check whether an upload is too big.":
"prefix":"upload_is_file_too_big"
"body":"upload_is_file_too_big( ${1:\\$upload} )"
"Check whether a site has used its allotted upload space.":
"prefix":"upload_is_user_over_quota"
"body":"upload_is_user_over_quota( ${1:\\$echo = true} )"
"Filters the maximum upload file size allowed, in bytes.":
"prefix":"upload_size_limit_filter"
"body":"upload_size_limit_filter( ${1:\\$size} )"
"Displays the site upload space quota setting form on the Edit Site Settings screen.":
"prefix":"upload_space_setting"
"body":"upload_space_setting( ${1:\\$id} )"
"Determines if the URL can be accessed over SSL.":
"prefix":"url_is_accessable_via_ssl"
"body":"url_is_accessable_via_ssl( ${1:\\$url} )"
"Shorten a URL, to be used as link text.":
"prefix":"url_shorten"
"body":"url_shorten( ${1:\\$url}${2:, \\$length = 35} )"
"Examine a URL and try to determine the post ID it represents.":
"prefix":"url_to_postid"
"body":"url_to_postid( ${1:\\$url} )"
"Navigates through an array, object, or scalar, and decodes URL-encoded values":
"prefix":"urldecode_deep"
"body":"urldecode_deep( ${1:\\$value} )"
"Navigates through an array, object, or scalar, and encodes the values to be used in a URL.":
"prefix":"urlencode_deep"
"body":"urlencode_deep( ${1:\\$value} )"
"Determine whether to use CodePress.":
"prefix":"use_codepress"
"body":"use_codepress()"
"Optional SSL preference that can be turned on by hooking to the 'personal_options' action.":
"prefix":"use_ssl_preference"
"body":"use_ssl_preference( ${1:\\$user} )"
"Retrieves the URL to the admin area for the current user.":
"prefix":"user_admin_url"
"body":"user_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Whether a particular user has capability or role.":
"prefix":"user_can"
"body":"user_can( ${1:\\$user}${2:, \\$capability} )"
"user_can_access_admin_page":
"prefix":"user_can_access_admin_page"
"body":"user_can_access_admin_page()"
"Whether user can create a post. user_can_create_draft":
"prefix":"user_can_create_draft"
"body":"user_can_create_draft( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Whether user can create a post. user_can_create_post":
"prefix":"user_can_create_post"
"body":"user_can_create_post( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Whether user can delete a post. user_can_delete_post":
"prefix":"user_can_delete_post"
"body":"user_can_delete_post( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_delete_post_comments":
"prefix":"user_can_delete_post_comments"
"body":"user_can_delete_post_comments( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can edit a post.":
"prefix":"user_can_edit_post"
"body":"user_can_edit_post( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_edit_post_comments":
"prefix":"user_can_edit_post_comments"
"body":"user_can_edit_post_comments( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_edit_post_date":
"prefix":"user_can_edit_post_date"
"body":"user_can_edit_post_date( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Can user can edit other user.":
"prefix":"user_can_edit_user"
"body":"user_can_edit_user( ${1:\\$user_id}${2:, \\$other_user} )"
"Whether the user can access the visual editor.":
"prefix":"user_can_richedit"
"body":"user_can_richedit()"
"Whether user can set new posts' dates.":
"prefix":"user_can_set_post_date"
"body":"user_can_set_post_date( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Check that the user login name and password is correct.":
"prefix":"user_pass_ok"
"body":"user_pass_ok( ${1:\\$user_login}${2:, \\$user_pass} )"
"Retrieves a trailing-slashed string if the site is set for adding trailing slashes.":
"prefix":"user_trailingslashit"
"body":"user_trailingslashit( ${1:\\$string}${2:, \\$type_of_url = ''} )"
"Checks whether the given username exists.":
"prefix":"username_exists"
"body":"username_exists( ${1:\\$username} )"
"Check whether users can self-register, based on Network settings.":
"prefix":"users_can_register_signup_filter"
"body":"users_can_register_signup_filter()"
"Encode the Unicode values to be used in the URI.":
"prefix":"utf8_uri_encode"
"body":"utf8_uri_encode( ${1:\\$utf8_string}${2:, \\$length} )"
"Helper function to determine if a Unicode value is valid.":
"prefix":"valid_unicode"
"body":"valid_unicode( ${1:\\$i} )"
"Validate active plugins":
"prefix":"validate_active_plugins"
"body":"validate_active_plugins()"
"Validate a new site signup.":
"prefix":"validate_another_blog_signup"
"body":"validate_another_blog_signup()"
"Validate the new site signup":
"prefix":"validate_blog_form"
"body":"validate_blog_form()"
"Validate new site signup":
"prefix":"validate_blog_signup"
"body":"validate_blog_signup()"
"Checks that current theme files 'index.php' and 'style.css' exists.":
"prefix":"validate_current_theme"
"body":"validate_current_theme()"
"Deprecated functionality to validate an email address.":
"prefix":"validate_email"
"body":"validate_email( ${1:\\$email}${2:, \\$check_domain = true} )"
"File validates against allowed set of defined rules.":
"prefix":"validate_file"
"body":"validate_file( ${1:\\$file}${2:, \\$allowed_files = ''} )"
"Make sure that the file that was requested to edit, is allowed to be edited":
"prefix":"validate_file_to_edit"
"body":"validate_file_to_edit( ${1:\\$file}${2:, \\$allowed_files = ''} )"
"Validate the plugin path.":
"prefix":"validate_plugin"
"body":"validate_plugin( ${1:\\$plugin} )"
"Validate user signup name and email":
"prefix":"validate_user_form"
"body":"validate_user_form()"
"Validate the new user signup":
"prefix":"validate_user_signup"
"body":"validate_user_signup()"
"Checks whether a username is valid.":
"prefix":"validate_username"
"body":"validate_username( ${1:\\$username} )"
"Calculates and compares the MD5 of a file to its expected value.":
"prefix":"verify_file_md5"
"body":"verify_file_md5( ${1:\\$filename}${2:, \\$expected_md5} )"
"Retrieve HTML dropdown (select) content for category list.":
"prefix":"walk_category_dropdown_tree"
"body":"walk_category_dropdown_tree()"
"Retrieve HTML list content for category list.":
"prefix":"walk_category_tree"
"body":"walk_category_tree()"
"Retrieve the HTML list content for nav menu items.":
"prefix":"walk_nav_menu_tree"
"body":"walk_nav_menu_tree( ${1:\\$items}${2:, \\$depth}${3:, \\$r} )"
"Retrieve HTML dropdown (select) content for page list.":
"prefix":"walk_page_dropdown_tree"
"body":"walk_page_dropdown_tree()"
"Retrieve HTML list content for page list.":
"prefix":"walk_page_tree"
"body":"walk_page_tree( ${1:\\$pages}${2:, \\$depth}${3:, \\$current_page}${4:, \\$r} )"
"Send a pingback.":
"prefix":"weblog_ping"
"body":"weblog_ping( ${1:\\$server = ''}${2:, \\$path = ''} )"
"Ensure that the welcome message is not empty. Currently unused.":
"prefix":"welcome_user_msg_filter"
"body":"welcome_user_msg_filter( ${1:\\$text} )"
"Workaround for Windows bug in is_writable() function":
"prefix":"win_is_writable"
"body":"win_is_writable( ${1:\\$path} )"
"Display the link to the Windows Live Writer manifest file.":
"prefix":"wlwmanifest_link"
"body":"wlwmanifest_link()"
"Set up the WordPress query.":
"prefix":"wp"
"body":"wp( ${1:\\$query_vars = ''} )"
"Adds a new dashboard widget.":
"prefix":"wp_add_dashboard_widget"
"body":"wp_add_dashboard_widget( ${1:\\$widget_id}${2:, \\$widget_name}${3:, \\$callback}${4:, \\$control_callback = null}${5:, \\$callback_args = null} )"
"Parse ID3v2, ID3v1, and getID3 comments to extract usable data":
"prefix":"wp_add_id3_tag_data"
"body":"wp_add_id3_tag_data( ${1:\\$metadata}${2:, \\$data} )"
"Adds extra code to a registered script.":
"prefix":"wp_add_inline_script"
"body":"wp_add_inline_script( ${1:\\$handle}${2:, \\$data}${3:, \\$position = 'after'} )"
"Add extra CSS styles to a registered stylesheet.":
"prefix":"wp_add_inline_style"
"body":"wp_add_inline_style( ${1:\\$handle}${2:, \\$data} )"
"Add term(s) associated with a given object.":
"prefix":"wp_add_object_terms"
"body":"wp_add_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy} )"
"Add tags to a post.":
"prefix":"wp_add_post_tags"
"body":"wp_add_post_tags( ${1:\\$post_id}${2:, \\$tags = ''} )"
"Adds a trashed suffix for a given post.":
"prefix":"wp_add_trashed_suffix_to_post_name_for_post"
"body":"wp_add_trashed_suffix_to_post_name_for_post( ${1:\\$post} )"
"Adds a suffix if any trashed posts have a given slug.":
"prefix":"wp_add_trashed_suffix_to_post_name_for_trashed_posts"
"body":"wp_add_trashed_suffix_to_post_name_for_trashed_posts( ${1:\\$post_name}${2:, \\$post_ID} )"
"Add secondary menus.":
"prefix":"wp_admin_bar_add_secondary_groups"
"body":"wp_admin_bar_add_secondary_groups( ${1:\\$wp_admin_bar} )"
"Add appearance submenu items to the "Site Name" menu.":
"prefix":"wp_admin_bar_appearance_menu"
"body":"wp_admin_bar_appearance_menu( ${1:\\$wp_admin_bar} )"
"Add edit comments link with awaiting moderation count bubble.":
"prefix":"wp_admin_bar_comments_menu"
"body":"wp_admin_bar_comments_menu( ${1:\\$wp_admin_bar} )"
"Adds the "Customize" link to the Toolbar.":
"prefix":"wp_admin_bar_customize_menu"
"body":"wp_admin_bar_customize_menu( ${1:\\$wp_admin_bar} )"
"Add the "Dashboard"/"Visit Site" menu.":
"prefix":"wp_admin_bar_dashboard_view_site_menu"
"body":"wp_admin_bar_dashboard_view_site_menu( ${1:\\$wp_admin_bar} )"
"Provide an edit link for posts and terms.":
"prefix":"wp_admin_bar_edit_menu"
"body":"wp_admin_bar_edit_menu( ${1:\\$wp_admin_bar} )"
"Style and scripts for the admin bar.":
"prefix":"wp_admin_bar_header"
"body":"wp_admin_bar_header()"
"Add the "My Account" item.":
"prefix":"wp_admin_bar_my_account_item"
"body":"wp_admin_bar_my_account_item( ${1:\\$wp_admin_bar} )"
"Add the "My Account" submenu items.":
"prefix":"wp_admin_bar_my_account_menu"
"body":"wp_admin_bar_my_account_menu( ${1:\\$wp_admin_bar} )"
"Add the "My Sites/[Site Name]" menu and all submenus.":
"prefix":"wp_admin_bar_my_sites_menu"
"body":"wp_admin_bar_my_sites_menu( ${1:\\$wp_admin_bar} )"
"Add "Add New" menu.":
"prefix":"wp_admin_bar_new_content_menu"
"body":"wp_admin_bar_new_content_menu( ${1:\\$wp_admin_bar} )"
"Renders the admin bar to the page based on the $wp_admin_bar->menu member var.":
"prefix":"wp_admin_bar_render"
"body":"wp_admin_bar_render()"
"Add search form.":
"prefix":"wp_admin_bar_search_menu"
"body":"wp_admin_bar_search_menu( ${1:\\$wp_admin_bar} )"
"Provide a shortlink.":
"prefix":"wp_admin_bar_shortlink_menu"
"body":"wp_admin_bar_shortlink_menu( ${1:\\$wp_admin_bar} )"
"Add the sidebar toggle button.":
"prefix":"wp_admin_bar_sidebar_toggle"
"body":"wp_admin_bar_sidebar_toggle( ${1:\\$wp_admin_bar} )"
"Add the "Site Name" menu.":
"prefix":"wp_admin_bar_site_menu"
"body":"wp_admin_bar_site_menu( ${1:\\$wp_admin_bar} )"
"Provide an update link if theme/plugin/core updates are available.":
"prefix":"wp_admin_bar_updates_menu"
"body":"wp_admin_bar_updates_menu( ${1:\\$wp_admin_bar} )"
"Add the WordPress logo menu.":
"prefix":"wp_admin_bar_wp_menu"
"body":"wp_admin_bar_wp_menu( ${1:\\$wp_admin_bar} )"
"Remove single-use URL parameters and create canonical link based on new URL.":
"prefix":"wp_admin_canonical_url"
"body":"wp_admin_canonical_url()"
"Enqueues or directly prints a stylesheet link to the specified CSS file.":
"prefix":"wp_admin_css"
"body":"wp_admin_css( ${1:\\$file = 'wp-admin'}${2:, \\$force_echo = false} )"
"Registers an admin colour scheme css file.":
"prefix":"wp_admin_css_color"
"body":"wp_admin_css_color( ${1:\\$key}${2:, \\$name}${3:, \\$url}${4:, \\$colors = array()}${5:, \\$icons = array()} )"
"Displays the URL of a WordPress admin CSS file.":
"prefix":"wp_admin_css_uri"
"body":"wp_admin_css_uri( ${1:\\$file = 'wp-admin'} )"
"Ajax handler for adding a link category.":
"prefix":"wp_ajax_add_link_category"
"body":"wp_ajax_add_link_category( ${1:\\$action} )"
"Ajax handler for adding a menu item.":
"prefix":"wp_ajax_add_menu_item"
"body":"wp_ajax_add_menu_item()"
"Ajax handler for adding meta.":
"prefix":"wp_ajax_add_meta"
"body":"wp_ajax_add_meta()"
"Ajax handler to add a tag.":
"prefix":"wp_ajax_add_tag"
"body":"wp_ajax_add_tag()"
"Ajax handler for adding a user.":
"prefix":"wp_ajax_add_user"
"body":"wp_ajax_add_user( ${1:\\$action} )"
"Ajax handler for tag search.":
"prefix":"wp_ajax_ajax_tag_search"
"body":"wp_ajax_ajax_tag_search()"
"Ajax handler for user autocomplete.":
"prefix":"wp_ajax_autocomplete_user"
"body":"wp_ajax_autocomplete_user()"
"Ajax handler for closed post boxes.":
"prefix":"wp_ajax_closed_postboxes"
"body":"wp_ajax_closed_postboxes()"
"Ajax handler for cropping an image.":
"prefix":"wp_ajax_crop_image"
"body":"wp_ajax_crop_image()"
"Ajax handler for dashboard widgets.":
"prefix":"wp_ajax_dashboard_widgets"
"body":"wp_ajax_dashboard_widgets()"
"Ajax handler for date formatting.":
"prefix":"wp_ajax_date_format"
"body":"wp_ajax_date_format()"
"Ajax handler for deleting a comment.":
"prefix":"wp_ajax_delete_comment"
"body":"wp_ajax_delete_comment()"
"Ajax handler for removing inactive widgets.":
"prefix":"wp_ajax_delete_inactive_widgets"
"body":"wp_ajax_delete_inactive_widgets()"
"Ajax handler for deleting a link.":
"prefix":"wp_ajax_delete_link"
"body":"wp_ajax_delete_link()"
"Ajax handler for deleting meta.":
"prefix":"wp_ajax_delete_meta"
"body":"wp_ajax_delete_meta()"
"wp_ajax_delete_page":
"prefix":"wp_ajax_delete_page"
"body":"wp_ajax_delete_page( ${1:\\$action} )"
"Ajax handler for deleting a plugin.":
"prefix":"wp_ajax_delete_plugin"
"body":"wp_ajax_delete_plugin()"
"Ajax handler for deleting a post.":
"prefix":"wp_ajax_delete_post"
"body":"wp_ajax_delete_post( ${1:\\$action} )"
"Ajax handler for deleting a tag.":
"prefix":"wp_ajax_delete_tag"
"body":"wp_ajax_delete_tag()"
"Ajax handler for deleting a theme.":
"prefix":"wp_ajax_delete_theme"
"body":"wp_ajax_delete_theme()"
"Ajax handler for destroying multiple open sessions for a user.":
"prefix":"wp_ajax_destroy_sessions"
"body":"wp_ajax_destroy_sessions()"
"Ajax handler to dim a comment.":
"prefix":"wp_ajax_dim_comment"
"body":"wp_ajax_dim_comment()"
"Ajax handler for dismissing a WordPress pointer.":
"prefix":"wp_ajax_dismiss_wp_pointer"
"body":"wp_ajax_dismiss_wp_pointer()"
"Ajax handler for editing a comment.":
"prefix":"wp_ajax_edit_comment"
"body":"wp_ajax_edit_comment()"
"Ajax handler for fetching a list table.":
"prefix":"wp_ajax_fetch_list"
"body":"wp_ajax_fetch_list()"
"Ajax handler for querying posts for the Find Posts modal.":
"prefix":"wp_ajax_find_posts"
"body":"wp_ajax_find_posts()"
"Ajax handler for generating a password.":
"prefix":"wp_ajax_generate_password"
"body":"wp_ajax_generate_password()"
"Ajax handler for getting an attachment.":
"prefix":"wp_ajax_get_attachment"
"body":"wp_ajax_get_attachment()"
"Ajax handler for getting comments.":
"prefix":"wp_ajax_get_comments"
"body":"wp_ajax_get_comments( ${1:\\$action} )"
"Handles AJAX requests for community events":
"prefix":"wp_ajax_get_community_events"
"body":"wp_ajax_get_community_events()"
"Ajax handler to retrieve a permalink.":
"prefix":"wp_ajax_get_permalink"
"body":"wp_ajax_get_permalink()"
"Ajax handler for retrieving HTML for the featured image.":
"prefix":"wp_ajax_get_post_thumbnail_html"
"body":"wp_ajax_get_post_thumbnail_html()"
"Ajax handler for getting revision diffs.":
"prefix":"wp_ajax_get_revision_diffs"
"body":"wp_ajax_get_revision_diffs()"
"Ajax handler for getting a tagcloud.":
"prefix":"wp_ajax_get_tagcloud"
"body":"wp_ajax_get_tagcloud()"
"Ajax handler for the Heartbeat API.":
"prefix":"wp_ajax_heartbeat"
"body":"wp_ajax_heartbeat()"
"Ajax handler for hidden columns.":
"prefix":"wp_ajax_hidden_columns"
"body":"wp_ajax_hidden_columns()"
"Ajax handler for image editing.":
"prefix":"wp_ajax_image_editor"
"body":"wp_ajax_image_editor()"
"Ajax handler for image editor previews.":
"prefix":"wp_ajax_imgedit_preview"
"body":"wp_ajax_imgedit_preview()"
"Ajax handler for Quick Edit saving a post from a list table.":
"prefix":"wp_ajax_inline_save"
"body":"wp_ajax_inline_save()"
"Ajax handler for quick edit saving for a term.":
"prefix":"wp_ajax_inline_save_tax"
"body":"wp_ajax_inline_save_tax()"
"Ajax handler for installing a plugin.":
"prefix":"wp_ajax_install_plugin"
"body":"wp_ajax_install_plugin()"
"Ajax handler for installing a theme.":
"prefix":"wp_ajax_install_theme"
"body":"wp_ajax_install_theme()"
"Ajax handler for Customizer preview logged-in status.":
"prefix":"wp_ajax_logged_in"
"body":"wp_ajax_logged_in()"
"Ajax handler for retrieving menu meta boxes.":
"prefix":"wp_ajax_menu_get_metabox"
"body":"wp_ajax_menu_get_metabox()"
"Ajax handler for menu locations save.":
"prefix":"wp_ajax_menu_locations_save"
"body":"wp_ajax_menu_locations_save()"
"Ajax handler for menu quick searching.":
"prefix":"wp_ajax_menu_quick_search"
"body":"wp_ajax_menu_quick_search()"
"Ajax handler for saving the meta box order.":
"prefix":"wp_ajax_meta_box_order"
"body":"wp_ajax_meta_box_order()"
"Ajax handler for the Heartbeat API in
the no-privilege context.":
"prefix":"wp_ajax_nopriv_heartbeat"
"body":"wp_ajax_nopriv_heartbeat()"
"Ajax handler for oEmbed caching.":
"prefix":"wp_ajax_oembed_cache"
"body":"wp_ajax_oembed_cache()"
"Apply [embed] Ajax handlers to a string.":
"prefix":"wp_ajax_parse_embed"
"body":"wp_ajax_parse_embed()"
"wp_ajax_parse_media_shortcode":
"prefix":"wp_ajax_parse_media_shortcode"
"body":"wp_ajax_parse_media_shortcode()"
"Ajax handler for creating new category from Press This.":
"prefix":"wp_ajax_press_this_add_category"
"body":"wp_ajax_press_this_add_category()"
"Ajax handler for saving a post from Press This.":
"prefix":"wp_ajax_press_this_save_post"
"body":"wp_ajax_press_this_save_post()"
"Ajax handler for querying attachments.":
"prefix":"wp_ajax_query_attachments"
"body":"wp_ajax_query_attachments()"
"Ajax handler for getting themes from themes_api().":
"prefix":"wp_ajax_query_themes"
"body":"wp_ajax_query_themes()"
"Ajax handler for replying to a comment.":
"prefix":"wp_ajax_replyto_comment"
"body":"wp_ajax_replyto_comment( ${1:\\$action} )"
"Ajax handler to retrieve a sample permalink.":
"prefix":"wp_ajax_sample_permalink"
"body":"wp_ajax_sample_permalink()"
"Ajax handler for updating attachment attributes.":
"prefix":"wp_ajax_save_attachment"
"body":"wp_ajax_save_attachment()"
"Ajax handler for saving backward compatible attachment attributes.":
"prefix":"wp_ajax_save_attachment_compat"
"body":"wp_ajax_save_attachment_compat()"
"Ajax handler for saving the attachment order.":
"prefix":"wp_ajax_save_attachment_order"
"body":"wp_ajax_save_attachment_order()"
"Ajax handler for auto-saving the selected color scheme for
a user's own profile.":
"prefix":"wp_ajax_save_user_color_scheme"
"body":"wp_ajax_save_user_color_scheme()"
"Ajax handler for saving a widget.":
"prefix":"wp_ajax_save_widget"
"body":"wp_ajax_save_widget()"
"Ajax handler for saving the user's WordPress.org username.":
"prefix":"wp_ajax_save_wporg_username"
"body":"wp_ajax_save_wporg_username()"
"Ajax handler for searching plugins to install.":
"prefix":"wp_ajax_search_install_plugins"
"body":"wp_ajax_search_install_plugins()"
"Ajax handler for searching plugins.":
"prefix":"wp_ajax_search_plugins"
"body":"wp_ajax_search_plugins()"
"Ajax handler for sending an attachment to the editor.":
"prefix":"wp_ajax_send_attachment_to_editor"
"body":"wp_ajax_send_attachment_to_editor()"
"Ajax handler for sending a link to the editor.":
"prefix":"wp_ajax_send_link_to_editor"
"body":"wp_ajax_send_link_to_editor()"
"Ajax handler for setting the featured image for an attachment.":
"prefix":"wp_ajax_set_attachment_thumbnail"
"body":"wp_ajax_set_attachment_thumbnail()"
"Ajax handler for setting the featured image.":
"prefix":"wp_ajax_set_post_thumbnail"
"body":"wp_ajax_set_post_thumbnail()"
"Ajax handler for time formatting.":
"prefix":"wp_ajax_time_format"
"body":"wp_ajax_time_format()"
"Ajax handler for sending a post to the trash.":
"prefix":"wp_ajax_trash_post"
"body":"wp_ajax_trash_post( ${1:\\$action} )"
"Ajax handler to restore a post from the trash.":
"prefix":"wp_ajax_untrash_post"
"body":"wp_ajax_untrash_post( ${1:\\$action} )"
"Ajax handler for updating a plugin.":
"prefix":"wp_ajax_update_plugin"
"body":"wp_ajax_update_plugin()"
"Ajax handler for updating a theme.":
"prefix":"wp_ajax_update_theme"
"body":"wp_ajax_update_theme()"
"Ajax handler for updating whether to display the welcome panel.":
"prefix":"wp_ajax_update_welcome_panel"
"body":"wp_ajax_update_welcome_panel()"
"Ajax handler for updating a widget.":
"prefix":"wp_ajax_update_widget"
"body":"wp_ajax_update_widget()"
"Ajax handler for uploading attachments":
"prefix":"wp_ajax_upload_attachment"
"body":"wp_ajax_upload_attachment()"
"Ajax handler for saving the widgets order.":
"prefix":"wp_ajax_widgets_order"
"body":"wp_ajax_widgets_order()"
"Ajax handler for compression testing.":
"prefix":"wp_ajax_wp_compression_test"
"body":"wp_ajax_wp_compression_test()"
"Ajax handler for saving posts from the fullscreen editor.":
"prefix":"wp_ajax_wp_fullscreen_save_post"
"body":"wp_ajax_wp_fullscreen_save_post()"
"Ajax handler for internal linking.":
"prefix":"wp_ajax_wp_link_ajax"
"body":"wp_ajax_wp_link_ajax()"
"Ajax handler for removing a post lock.":
"prefix":"wp_ajax_wp_remove_post_lock"
"body":"wp_ajax_wp_remove_post_lock()"
"Validates whether this comment is allowed to be made.":
"prefix":"wp_allow_comment"
"body":"wp_allow_comment( ${1:\\$commentdata}${2:, \\$avoid_die = false} )"
"Retrieve a list of protocols to allow in HTML attributes.":
"prefix":"wp_allowed_protocols"
"body":"wp_allowed_protocols()"
"Extract a slice of an array, given a list of keys.":
"prefix":"wp_array_slice_assoc"
"body":"wp_array_slice_assoc( ${1:\\$array}${2:, \\$keys} )"
"Verifies an attachment is of a given type.":
"prefix":"wp_attachment_is"
"body":"wp_attachment_is( ${1:\\$type}${2:, \\$post = null} )"
"Checks if the attachment is an image.":
"prefix":"wp_attachment_is_image"
"body":"wp_attachment_is_image( ${1:\\$post = null} )"
"Builds the Audio shortcode output.":
"prefix":"wp_audio_shortcode"
"body":"wp_audio_shortcode( ${1:\\$attr}${2:, \\$content = ''} )"
"Check whether a user is still logged in, for the heartbeat.":
"prefix":"wp_auth_check"
"body":"wp_auth_check( ${1:\\$response} )"
"Output the HTML that shows the wp-login dialog when the user is no longer logged in.":
"prefix":"wp_auth_check_html"
"body":"wp_auth_check_html()"
"Load the auth check for monitoring whether the user is still logged in.":
"prefix":"wp_auth_check_load"
"body":"wp_auth_check_load()"
"Authenticate a user, confirming the login credentials are valid.":
"prefix":"wp_authenticate"
"body":"wp_authenticate( ${1:\\$username}${2:, \\$password} )"
"Authenticate the user using the WordPress auth cookie.":
"prefix":"wp_authenticate_cookie"
"body":"wp_authenticate_cookie( ${1:\\$user}${2:, \\$username}${3:, \\$password} )"
"Authenticates a user using the email and password.":
"prefix":"wp_authenticate_email_password"
"body":"wp_authenticate_email_password( ${1:\\$user}${2:, \\$email}${3:, \\$password} )"
"For Multisite blogs, check if the authenticated user has been marked as a
spammer, or if the user's primary blog has been marked as spam.":
"prefix":"wp_authenticate_spam_check"
"body":"wp_authenticate_spam_check( ${1:\\$user} )"
"Authenticate a user, confirming the username and password are valid.":
"prefix":"wp_authenticate_username_password"
"body":"wp_authenticate_username_password( ${1:\\$user}${2:, \\$username}${3:, \\$password} )"
"Save a post submitted with XHR":
"prefix":"wp_autosave"
"body":"wp_autosave( ${1:\\$post_data} )"
"i18n friendly version of basename()":
"prefix":"wp_basename"
"body":"wp_basename( ${1:\\$path}${2:, \\$suffix = ''} )"
"Does comment contain blacklisted characters or words.":
"prefix":"wp_blacklist_check"
"body":"wp_blacklist_check( ${1:\\$author}${2:, \\$email}${3:, \\$url}${4:, \\$comment}${5:, \\$user_ip}${6:, \\$user_agent} )"
"Adds data to the cache, if the cache key doesn't already exist.":
"prefix":"wp_cache_add"
"body":"wp_cache_add( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Adds a group or set of groups to the list of global groups.":
"prefix":"wp_cache_add_global_groups"
"body":"wp_cache_add_global_groups( ${1:\\$groups} )"
"Adds a group or set of groups to the list of non-persistent groups.":
"prefix":"wp_cache_add_non_persistent_groups"
"body":"wp_cache_add_non_persistent_groups( ${1:\\$groups} )"
"Closes the cache.":
"prefix":"wp_cache_close"
"body":"wp_cache_close()"
"Decrements numeric cache item's value.":
"prefix":"wp_cache_decr"
"body":"wp_cache_decr( ${1:\\$key}${2:, \\$offset = 1}${3:, \\$group = ''} )"
"Removes the cache contents matching key and group.":
"prefix":"wp_cache_delete"
"body":"wp_cache_delete( ${1:\\$key}${2:, \\$group = ''} )"
"Removes all cache items.":
"prefix":"wp_cache_flush"
"body":"wp_cache_flush()"
"Retrieves the cache contents from the cache by key and group.":
"prefix":"wp_cache_get"
"body":"wp_cache_get( ${1:\\$key}${2:, \\$group = ''}${3:, \\$force = false}${4:, \\$found = null} )"
"Get last changed date for the specified cache group.":
"prefix":"wp_cache_get_last_changed"
"body":"wp_cache_get_last_changed( ${1:\\$group} )"
"Increment numeric cache item's value":
"prefix":"wp_cache_incr"
"body":"wp_cache_incr( ${1:\\$key}${2:, \\$offset = 1}${3:, \\$group = ''} )"
"Sets up Object Cache Global and assigns it.":
"prefix":"wp_cache_init"
"body":"wp_cache_init()"
"Replaces the contents of the cache with new data.":
"prefix":"wp_cache_replace"
"body":"wp_cache_replace( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Reset internal cache keys and structures.":
"prefix":"wp_cache_reset"
"body":"wp_cache_reset()"
"Saves the data to the cache.":
"prefix":"wp_cache_set"
"body":"wp_cache_set( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Switches the internal blog ID.":
"prefix":"wp_cache_switch_to_blog"
"body":"wp_cache_switch_to_blog( ${1:\\$blog_id} )"
"Creates a 'sizes' attribute value for an image.":
"prefix":"wp_calculate_image_sizes"
"body":"wp_calculate_image_sizes( ${1:\\$size}${2:, \\$image_src = null}${3:, \\$image_meta = null}${4:, \\$attachment_id} )"
"A helper function to calculate the image sources to include in a 'srcset' attribute.":
"prefix":"wp_calculate_image_srcset"
"body":"wp_calculate_image_srcset( ${1:\\$size_array}${2:, \\$image_src}${3:, \\$image_meta}${4:, \\$attachment_id} )"
"Check if WordPress has access to the filesystem without asking for
credentials.":
"prefix":"wp_can_install_language_pack"
"body":"wp_can_install_language_pack()"
"Output a textarea element for inputting an attachment caption.":
"prefix":"wp_caption_input_textarea"
"body":"wp_caption_input_textarea( ${1:\\$edit_post} )"
"Output an unordered list of checkbox input elements labeled with category names.":
"prefix":"wp_category_checklist"
"body":"wp_category_checklist( ${1:\\$post_id}${2:, \\$descendants_and_self}${3:, \\$selected_cats = false}${4:, \\$popular_cats = false}${5:, \\$walker = null}${6:, \\$checked_ontop = true} )"
"Check if the user needs a browser update":
"prefix":"wp_check_browser_version"
"body":"wp_check_browser_version()"
"Compares the lengths of comment data against the maximum character limits.":
"prefix":"wp_check_comment_data_max_lengths"
"body":"wp_check_comment_data_max_lengths( ${1:\\$comment_data} )"
"Checks whether comment flooding is occurring.":
"prefix":"wp_check_comment_flood"
"body":"wp_check_comment_flood( ${1:\\$is_flood}${2:, \\$ip}${3:, \\$email}${4:, \\$date}${5:, \\$avoid_die = false} )"
"Retrieve the file type from the file name.":
"prefix":"wp_check_filetype"
"body":"wp_check_filetype( ${1:\\$filename}${2:, \\$mimes = null} )"
"Attempt to determine the real file type of a file.":
"prefix":"wp_check_filetype_and_ext"
"body":"wp_check_filetype_and_ext( ${1:\\$file}${2:, \\$filename}${3:, \\$mimes = null} )"
"Check for changed slugs for published post objects and save the old slug.":
"prefix":"wp_check_for_changed_slugs"
"body":"wp_check_for_changed_slugs( ${1:\\$post_id}${2:, \\$post}${3:, \\$post_before} )"
"Checks for invalid UTF8 in a string.":
"prefix":"wp_check_invalid_utf8"
"body":"wp_check_invalid_utf8( ${1:\\$string}${2:, \\$strip = false} )"
"Checks that a JSONP callback is a valid JavaScript callback.":
"prefix":"wp_check_jsonp_callback"
"body":"wp_check_jsonp_callback( ${1:\\$callback} )"
"Check lock status for posts displayed on the Posts screen":
"prefix":"wp_check_locked_posts"
"body":"wp_check_locked_posts( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Checks the version of the installed MySQL binary.":
"prefix":"wp_check_mysql_version"
"body":"wp_check_mysql_version()"
"Checks the plaintext password against the encrypted Password.":
"prefix":"wp_check_password"
"body":"wp_check_password( ${1:\\$password}${2:, \\$hash}${3:, \\$user_id = ''} )"
"Check for the required PHP version, and the MySQL extension or
a database drop-in.":
"prefix":"wp_check_php_mysql_versions"
"body":"wp_check_php_mysql_versions()"
"Check the given subset of the post hierarchy for hierarchy loops.":
"prefix":"wp_check_post_hierarchy_for_loops"
"body":"wp_check_post_hierarchy_for_loops( ${1:\\$post_parent}${2:, \\$post_ID} )"
"Check to see if the post is currently being edited by another user.":
"prefix":"wp_check_post_lock"
"body":"wp_check_post_lock( ${1:\\$post_id} )"
"Checks the given subset of the term hierarchy for hierarchy loops.":
"prefix":"wp_check_term_hierarchy_for_loops"
"body":"wp_check_term_hierarchy_for_loops( ${1:\\$parent}${2:, \\$term_id}${3:, \\$taxonomy} )"
"Test if the supplied date is valid for the Gregorian calendar.":
"prefix":"wp_checkdate"
"body":"wp_checkdate( ${1:\\$month}${2:, \\$day}${3:, \\$year}${4:, \\$source_date} )"
"Clears the Plugins cache used by get_plugins() and by default, the Plugin Update cache.":
"prefix":"wp_clean_plugins_cache"
"body":"wp_clean_plugins_cache( ${1:\\$clear_update_cache = true} )"
"Clears the cache held by get_theme_roots() and WP_Theme.":
"prefix":"wp_clean_themes_cache"
"body":"wp_clean_themes_cache( ${1:\\$clear_update_cache = true} )"
"Clear existing update caches for plugins, themes, and core.":
"prefix":"wp_clean_update_cache"
"body":"wp_clean_update_cache()"
"Removes all of the cookies associated with authentication.":
"prefix":"wp_clear_auth_cookie"
"body":"wp_clear_auth_cookie()"
"Unschedules all events attached to the hook with the specified arguments.":
"prefix":"wp_clear_scheduled_hook"
"body":"wp_clear_scheduled_hook( ${1:\\$hook}${2:, \\$args = array()} )"
"Clears the authentication cookie, logging the user out. This function is deprecated.":
"prefix":"wp_clearcookie"
"body":"wp_clearcookie()"
"Copy an object.":
"prefix":"wp_clone"
"body":"wp_clone( ${1:\\$object} )"
"wp_color_scheme_settings":
"prefix":"wp_color_scheme_settings"
"body":"wp_color_scheme_settings()"
"Display form token for unfiltered comments.":
"prefix":"wp_comment_form_unfiltered_html_nonce"
"body":"wp_comment_form_unfiltered_html_nonce()"
"Outputs the in-line comment reply-to form in the Comments list table.":
"prefix":"wp_comment_reply"
"body":"wp_comment_reply( ${1:\\$position = 1}${2:, \\$checkbox = false}${3:, \\$mode = 'single'}${4:, \\$table_row = true} )"
"Output 'undo move to trash' text for comments":
"prefix":"wp_comment_trashnotice"
"body":"wp_comment_trashnotice()"
"Calculates the new dimensions for a down-sampled image.":
"prefix":"wp_constrain_dimensions"
"body":"wp_constrain_dimensions( ${1:\\$current_width}${2:, \\$current_height}${3:, \\$max_width}${4:, \\$max_height} )"
"Converts an integer byte value to a shorthand byte value.":
"prefix":"wp_convert_bytes_to_hr"
"body":"wp_convert_bytes_to_hr( ${1:\\$bytes} )"
"Converts a shorthand byte value to an integer byte value.":
"prefix":"wp_convert_hr_to_bytes"
"body":"wp_convert_hr_to_bytes( ${1:\\$value} )"
"Convert the widget settings from single to multi-widget format.":
"prefix":"wp_convert_widget_settings"
"body":"wp_convert_widget_settings( ${1:\\$base_name}${2:, \\$option_name}${3:, \\$settings} )"
"Defines cookie related WordPress constants wp_cookie_constants":
"prefix":"wp_cookie_constants"
"body":"wp_cookie_constants()"
"Count number of attachments for the mime type(s).":
"prefix":"wp_count_attachments"
"body":"wp_count_attachments( ${1:\\$mime_type = ''} )"
"Retrieve total comments for blog or single post.":
"prefix":"wp_count_comments"
"body":"wp_count_comments( ${1:\\$post_id} )"
"Count number of posts of a post type and if user has permissions to view.":
"prefix":"wp_count_posts"
"body":"wp_count_posts( ${1:\\$type = 'post'}${2:, \\$perm = ''} )"
"Count how many terms are in Taxonomy.":
"prefix":"wp_count_terms"
"body":"wp_count_terms( ${1:\\$taxonomy}${2:, \\$args = array()} )"
"Create categories for the given post.":
"prefix":"wp_create_categories"
"body":"wp_create_categories( ${1:\\$categories}${2:, \\$post_id = ''} )"
"Add a new category to the database if it does not already exist.":
"prefix":"wp_create_category"
"body":"wp_create_category( ${1:\\$cat_name}${2:, \\$parent} )"
"Creates a navigation menu.":
"prefix":"wp_create_nav_menu"
"body":"wp_create_nav_menu( ${1:\\$menu_name} )"
"Creates a cryptographic token tied to a specific action, user, user session,
and window of time.":
"prefix":"wp_create_nonce"
"body":"wp_create_nonce( ${1:\\$action = -1} )"
"Creates autosave data for the specified post from $_POST data.":
"prefix":"wp_create_post_autosave"
"body":"wp_create_post_autosave( ${1:\\$post_data} )"
"Add a new tag to the database if it does not already exist.":
"prefix":"wp_create_tag"
"body":"wp_create_tag( ${1:\\$tag_name} )"
"Add a new term to the database if it does not already exist.":
"prefix":"wp_create_term"
"body":"wp_create_term( ${1:\\$tag_name}${2:, \\$taxonomy = 'post_tag'} )"
"This was once used to create a thumbnail from an Image given a maximum side size.":
"prefix":"wp_create_thumbnail"
"body":"wp_create_thumbnail( ${1:\\$file}${2:, \\$max_side}${3:, \\$deprecated = ''} )"
"A simpler way of inserting a user into the database.":
"prefix":"wp_create_user"
"body":"wp_create_user( ${1:\\$username}${2:, \\$password}${3:, \\$email = ''} )"
"Retrieve the contributor credits.":
"prefix":"wp_credits"
"body":"wp_credits()"
"Run scheduled callbacks or spawn cron for all scheduled events.":
"prefix":"wp_cron"
"body":"wp_cron()"
"Crop an Image to a given size.":
"prefix":"wp_crop_image"
"body":"wp_crop_image( ${1:\\$src}${2:, \\$src_x}${3:, \\$src_y}${4:, \\$src_w}${5:, \\$src_h}${6:, \\$dst_w}${7:, \\$dst_h}${8:, \\$src_abs = false}${9:, \\$dst_file = false} )"
"Render the Custom CSS style element.":
"prefix":"wp_custom_css_cb"
"body":"wp_custom_css_cb()"
"Prints a script to check whether or not the Customizer is supported,
and apply either the no-customize-support or customize-support class
to the body.":
"prefix":"wp_customize_support_script"
"body":"wp_customize_support_script()"
"Returns a URL to load the Customizer.":
"prefix":"wp_customize_url"
"body":"wp_customize_url( ${1:\\$stylesheet = null} )"
"Displays the dashboard.":
"prefix":"wp_dashboard"
"body":"wp_dashboard()"
"wp_dashboard_browser_nag":
"prefix":"wp_dashboard_browser_nag"
"body":"wp_dashboard_browser_nag()"
"Checks to see if all of the feed url in $check_urls are cached.":
"prefix":"wp_dashboard_cached_rss_widget"
"body":"wp_dashboard_cached_rss_widget( ${1:\\$widget_id}${2:, \\$callback}${3:, \\$check_urls = array()} )"
"Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).":
"prefix":"wp_dashboard_empty"
"body":"wp_dashboard_empty()"
"Renders the Events and News dashboard widget.":
"prefix":"wp_dashboard_events_news"
"body":"wp_dashboard_events_news()"
"Deprecated dashboard widget controls. wp_dashboard_incoming_links":
"prefix":"wp_dashboard_incoming_links"
"body":"wp_dashboard_incoming_links()"
"Deprecated dashboard incoming links control.":
"prefix":"wp_dashboard_incoming_links_control"
"body":"wp_dashboard_incoming_links_control()"
"Deprecated dashboard widget controls. wp_dashboard_incoming_links_output":
"prefix":"wp_dashboard_incoming_links_output"
"body":"wp_dashboard_incoming_links_output()"
"Deprecated dashboard plugins control.":
"prefix":"wp_dashboard_plugins"
"body":"wp_dashboard_plugins()"
"Display plugins text for the WordPress news widget.":
"prefix":"wp_dashboard_plugins_output"
"body":"wp_dashboard_plugins_output( ${1:\\$rss}${2:, \\$args = array()} )"
"WordPress News dashboard widget.":
"prefix":"wp_dashboard_primary"
"body":"wp_dashboard_primary()"
"Deprecated dashboard primary control.":
"prefix":"wp_dashboard_primary_control"
"body":"wp_dashboard_primary_control()"
"Display the WordPress news feeds.":
"prefix":"wp_dashboard_primary_output"
"body":"wp_dashboard_primary_output( ${1:\\$widget_id}${2:, \\$feeds} )"
"The Quick Draft widget display and creation of drafts.":
"prefix":"wp_dashboard_quick_press"
"body":"wp_dashboard_quick_press( ${1:\\$error_msg = false} )"
"Output the QuickPress dashboard widget.":
"prefix":"wp_dashboard_quick_press_output"
"body":"wp_dashboard_quick_press_output()"
"Display file upload quota on dashboard.":
"prefix":"wp_dashboard_quota"
"body":"wp_dashboard_quota()"
"Show Comments section.":
"prefix":"wp_dashboard_recent_comments"
"body":"wp_dashboard_recent_comments( ${1:\\$total_items = 5} )"
"Deprecated dashboard recent comments control.":
"prefix":"wp_dashboard_recent_comments_control"
"body":"wp_dashboard_recent_comments_control()"
"Show recent drafts of the user on the dashboard.":
"prefix":"wp_dashboard_recent_drafts"
"body":"wp_dashboard_recent_drafts( ${1:\\$drafts = false} )"
"Generates Publishing Soon and Recently Published sections.":
"prefix":"wp_dashboard_recent_posts"
"body":"wp_dashboard_recent_posts( ${1:\\$args} )"
"Dashboard widget that displays some basic stats about the site.":
"prefix":"wp_dashboard_right_now"
"body":"wp_dashboard_right_now()"
"The RSS dashboard widget control.":
"prefix":"wp_dashboard_rss_control"
"body":"wp_dashboard_rss_control( ${1:\\$widget_id}${2:, \\$form_inputs = array()} )"
"Display generic dashboard RSS widget feed.":
"prefix":"wp_dashboard_rss_output"
"body":"wp_dashboard_rss_output( ${1:\\$widget_id} )"
"Deprecated dashboard secondary section.":
"prefix":"wp_dashboard_secondary"
"body":"wp_dashboard_secondary()"
"Deprecated dashboard secondary control.":
"prefix":"wp_dashboard_secondary_control"
"body":"wp_dashboard_secondary_control()"
"Deprecated dashboard secondary output.":
"prefix":"wp_dashboard_secondary_output"
"body":"wp_dashboard_secondary_output()"
"Registers dashboard widgets.":
"prefix":"wp_dashboard_setup"
"body":"wp_dashboard_setup()"
"Callback function for Activity widget.":
"prefix":"wp_dashboard_site_activity"
"body":"wp_dashboard_site_activity()"
"Calls widget control callback.":
"prefix":"wp_dashboard_trigger_widget_control"
"body":"wp_dashboard_trigger_widget_control( ${1:\\$widget_control_id = false} )"
"Return a comma-separated string of functions that have been called to get
to the current point in code.":
"prefix":"wp_debug_backtrace_summary"
"body":"wp_debug_backtrace_summary( ${1:\\$ignore_class = null}${2:, \\$skip_frames}${3:, \\$pretty = true} )"
"Set PHP error reporting based on WordPress debug settings.":
"prefix":"wp_debug_mode"
"body":"wp_debug_mode()"
"Find out which editor should be displayed by default.":
"prefix":"wp_default_editor"
"body":"wp_default_editor()"
"Register all WordPress scripts.":
"prefix":"wp_default_scripts"
"body":"wp_default_scripts( ${1:\\$scripts} )"
"Assign default styles to $styles object.":
"prefix":"wp_default_styles"
"body":"wp_default_styles( ${1:\\$styles} )"
"Whether to defer comment counting.":
"prefix":"wp_defer_comment_counting"
"body":"wp_defer_comment_counting( ${1:\\$defer = null} )"
"Enable or disable term counting.":
"prefix":"wp_defer_term_counting"
"body":"wp_defer_term_counting( ${1:\\$defer = null} )"
"Trash or delete an attachment.":
"prefix":"wp_delete_attachment"
"body":"wp_delete_attachment( ${1:\\$post_id}${2:, \\$force_delete = false} )"
"Delete auto-drafts for new posts that are > 7 days old.":
"prefix":"wp_delete_auto_drafts"
"body":"wp_delete_auto_drafts()"
"Deletes one existing category.":
"prefix":"wp_delete_category"
"body":"wp_delete_category( ${1:\\$cat_ID} )"
"Trashes or deletes a comment.":
"prefix":"wp_delete_comment"
"body":"wp_delete_comment( ${1:\\$comment_id}${2:, \\$force_delete = false} )"
"Delete a file":
"prefix":"wp_delete_file"
"body":"wp_delete_file( ${1:\\$file} )"
"Deletes a specified link from the database.":
"prefix":"wp_delete_link"
"body":"wp_delete_link( ${1:\\$link_id} )"
"Delete a Navigation Menu.":
"prefix":"wp_delete_nav_menu"
"body":"wp_delete_nav_menu( ${1:\\$menu} )"
"Will unlink the object from the taxonomy or taxonomies.":
"prefix":"wp_delete_object_term_relationships"
"body":"wp_delete_object_term_relationships( ${1:\\$object_id}${2:, \\$taxonomies} )"
"Trash or delete a post or page.":
"prefix":"wp_delete_post"
"body":"wp_delete_post( ${1:\\$postid}${2:, \\$force_delete = false} )"
"Deletes a revision.":
"prefix":"wp_delete_post_revision"
"body":"wp_delete_post_revision( ${1:\\$revision_id} )"
"Removes a term from the database.":
"prefix":"wp_delete_term"
"body":"wp_delete_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Remove user and optionally reassign posts and links to another user.":
"prefix":"wp_delete_user"
"body":"wp_delete_user( ${1:\\$id}${2:, \\$reassign = null} )"
"Retrieves a list of unique hosts of all enqueued scripts and styles.":
"prefix":"wp_dependencies_unique_hosts"
"body":"wp_dependencies_unique_hosts()"
"Remove a previously enqueued script.":
"prefix":"wp_dequeue_script"
"body":"wp_dequeue_script( ${1:\\$handle} )"
"Remove a previously enqueued CSS stylesheet.":
"prefix":"wp_dequeue_style"
"body":"wp_dequeue_style( ${1:\\$handle} )"
"Remove a registered script.":
"prefix":"wp_deregister_script"
"body":"wp_deregister_script( ${1:\\$handle} )"
"Remove a registered stylesheet.":
"prefix":"wp_deregister_style"
"body":"wp_deregister_style( ${1:\\$handle} )"
"Remove all session tokens for the current user from the database.":
"prefix":"wp_destroy_all_sessions"
"body":"wp_destroy_all_sessions()"
"Remove the current session token from the database.":
"prefix":"wp_destroy_current_session"
"body":"wp_destroy_current_session()"
"Remove all but the current session token for the current user for the database.":
"prefix":"wp_destroy_other_sessions"
"body":"wp_destroy_other_sessions()"
"Kill WordPress execution and display HTML message with error message.":
"prefix":"wp_die"
"body":"wp_die( ${1:\\$message = ''}${2:, \\$title = ''}${3:, \\$args = array()} )"
"wp_doc_link_parse":
"prefix":"wp_doc_link_parse"
"body":"wp_doc_link_parse( ${1:\\$content} )"
"Determines whether the current request is a WordPress Ajax request.":
"prefix":"wp_doing_ajax"
"body":"wp_doing_ajax()"
"Determines whether the current request is a WordPress cron request.":
"prefix":"wp_doing_cron"
"body":"wp_doing_cron()"
"Download a language pack.":
"prefix":"wp_download_language_pack"
"body":"wp_download_language_pack( ${1:\\$download} )"
"Display or retrieve the HTML dropdown list of categories.":
"prefix":"wp_dropdown_categories"
"body":"wp_dropdown_categories( ${1:\\$args = ''} )"
"Legacy function used for generating a categories drop-down control.":
"prefix":"wp_dropdown_cats"
"body":"wp_dropdown_cats( ${1:\\$currentcat}${2:, \\$currentparent}${3:, \\$parent}${4:, \\$level}${5:, \\$categories} )"
"Language selector.":
"prefix":"wp_dropdown_languages"
"body":"wp_dropdown_languages( ${1:\\$args = array()} )"
"Retrieve or display list of pages as a dropdown (select list).":
"prefix":"wp_dropdown_pages"
"body":"wp_dropdown_pages( ${1:\\$args = ''} )"
"Print out option html elements for role selectors.":
"prefix":"wp_dropdown_roles"
"body":"wp_dropdown_roles( ${1:\\$selected = ''} )"
"Create dropdown HTML content of users.":
"prefix":"wp_dropdown_users"
"body":"wp_dropdown_users( ${1:\\$args = ''} )"
"Executes a query for attachments. An array of WP_Query arguments
can be passed in, which will override the arguments set by this function.":
"prefix":"wp_edit_attachments_query"
"body":"wp_edit_attachments_query( ${1:\\$q = false} )"
"Get the query variables for the current attachments request.":
"prefix":"wp_edit_attachments_query_vars"
"body":"wp_edit_attachments_query_vars( ${1:\\$q = false} )"
"Run the wp query to fetch the posts for listing on the edit posts page":
"prefix":"wp_edit_posts_query"
"body":"wp_edit_posts_query( ${1:\\$q = false} )"
"Renders an editor.":
"prefix":"wp_editor"
"body":"wp_editor( ${1:\\$content}${2:, \\$editor_id}${3:, \\$settings = array()} )"
"Creates default array of embed parameters.":
"prefix":"wp_embed_defaults"
"body":"wp_embed_defaults( ${1:\\$url = ''} )"
"Filters the post excerpt for the embed template.":
"prefix":"wp_embed_excerpt_attachment"
"body":"wp_embed_excerpt_attachment( ${1:\\$content} )"
"Filters the string in the 'more' link displayed after a trimmed excerpt.":
"prefix":"wp_embed_excerpt_more"
"body":"wp_embed_excerpt_more( ${1:\\$more_string} )"
"Audio embed handler callback.":
"prefix":"wp_embed_handler_audio"
"body":"wp_embed_handler_audio( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"The Google Video embed handler callback.":
"prefix":"wp_embed_handler_googlevideo"
"body":"wp_embed_handler_googlevideo()"
"Video embed handler callback.":
"prefix":"wp_embed_handler_video"
"body":"wp_embed_handler_video( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"YouTube iframe embed handler callback.":
"prefix":"wp_embed_handler_youtube"
"body":"wp_embed_handler_youtube( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"Registers an embed handler.":
"prefix":"wp_embed_register_handler"
"body":"wp_embed_register_handler( ${1:\\$id}${2:, \\$regex}${3:, \\$callback}${4:, \\$priority = 10} )"
"Unregisters a previously-registered embed handler.":
"prefix":"wp_embed_unregister_handler"
"body":"wp_embed_unregister_handler( ${1:\\$id}${2:, \\$priority = 10} )"
"Convert any 4 byte emoji in a string to their equivalent HTML entity.":
"prefix":"wp_encode_emoji"
"body":"wp_encode_emoji( ${1:\\$content} )"
"Outputs the editor scripts, stylesheets, and default settings.":
"prefix":"wp_enqueue_editor"
"body":"wp_enqueue_editor()"
"Enqueues all scripts, styles, settings, and templates necessary to use
all media JS APIs.":
"prefix":"wp_enqueue_media"
"body":"wp_enqueue_media( ${1:\\$args = array()} )"
"Enqueue a script.":
"prefix":"wp_enqueue_script"
"body":"wp_enqueue_script( ${1:\\$handle}${2:, \\$src = ''}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$in_footer = false} )"
"Wrapper for do_action('wp_enqueue_scripts')":
"prefix":"wp_enqueue_scripts"
"body":"wp_enqueue_scripts()"
"Enqueue a CSS stylesheet.":
"prefix":"wp_enqueue_style"
"body":"wp_enqueue_style( ${1:\\$handle}${2:, \\$src = ''}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$media = 'all'} )"
"Convert the exif date format to a unix timestamp.":
"prefix":"wp_exif_date2ts"
"body":"wp_exif_date2ts( ${1:\\$str} )"
"Convert a fraction string to a decimal.":
"prefix":"wp_exif_frac2dec"
"body":"wp_exif_frac2dec( ${1:\\$str} )"
"Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.":
"prefix":"wp_expand_dimensions"
"body":"wp_expand_dimensions( ${1:\\$example_width}${2:, \\$example_height}${3:, \\$max_width}${4:, \\$max_height} )"
"Retrieve nonce action "Are you sure" message.":
"prefix":"wp_explain_nonce"
"body":"wp_explain_nonce( ${1:\\$action} )"
"Retrieve the file type based on the extension name.":
"prefix":"wp_ext2type"
"body":"wp_ext2type( ${1:\\$ext} )"
"Use RegEx to extract URLs from arbitrary content.":
"prefix":"wp_extract_urls"
"body":"wp_extract_urls( ${1:\\$content} )"
"Don't load all of WordPress when handling a favicon.ico request.":
"prefix":"wp_favicon_request"
"body":"wp_favicon_request()"
"Initialises and connects the WordPress Filesystem Abstraction classes.":
"prefix":"wp_filesystem"
"body":"wp_filesystem( ${1:\\$args = false}${2:, \\$context = false}${3:, \\$allow_relaxed_file_ownership = false} )"
"Filters and sanitizes comment data.":
"prefix":"wp_filter_comment"
"body":"wp_filter_comment( ${1:\\$commentdata} )"
"Sanitize content with allowed HTML Kses rules.":
"prefix":"wp_filter_kses"
"body":"wp_filter_kses( ${1:\\$data} )"
"Strips all of the HTML in the content.":
"prefix":"wp_filter_nohtml_kses"
"body":"wp_filter_nohtml_kses( ${1:\\$data} )"
"Filters a list of objects, based on a set of key => value arguments. wp_filter_object_list":
"prefix":"wp_filter_object_list"
"body":"wp_filter_object_list( ${1:\\$list}${2:, \\$args = array()}${3:, \\$operator = 'and'}${4:, \\$field = false} )"
"Filters the given oEmbed HTML.":
"prefix":"wp_filter_oembed_result"
"body":"wp_filter_oembed_result( ${1:\\$result}${2:, \\$data}${3:, \\$url} )"
"Sanitize content for allowed HTML tags for post content. wp_filter_post_kses":
"prefix":"wp_filter_post_kses"
"body":"wp_filter_post_kses( ${1:\\$data} )"
"Filters the oEmbed result before any HTTP requests are made.":
"prefix":"wp_filter_pre_oembed_result"
"body":"wp_filter_pre_oembed_result( ${1:\\$result}${2:, \\$url}${3:, \\$args} )"
"Find hierarchy loops using a callback function that maps object IDs to parent IDs.":
"prefix":"wp_find_hierarchy_loop"
"body":"wp_find_hierarchy_loop( ${1:\\$callback}${2:, \\$start}${3:, \\$start_parent}${4:, \\$callback_args = array()} )"
"Use the "The Tortoise and the Hare" algorithm to detect loops.":
"prefix":"wp_find_hierarchy_loop_tortoise_hare"
"body":"wp_find_hierarchy_loop_tortoise_hare( ${1:\\$callback}${2:, \\$start}${3:, \\$override = array()}${4:, \\$callback_args = array()}${5:, \\$_return_loop = false} )"
"Fix `$_SERVER` variables for various setups.":
"prefix":"wp_fix_server_vars"
"body":"wp_fix_server_vars()"
"Fire the wp_footer action.":
"prefix":"wp_footer"
"body":"wp_footer()"
"Defines functionality related WordPress constants":
"prefix":"wp_functionality_constants"
"body":"wp_functionality_constants()"
"Generate post thumbnail attachment meta data.":
"prefix":"wp_generate_attachment_metadata"
"body":"wp_generate_attachment_metadata( ${1:\\$attachment_id}${2:, \\$file} )"
"Generate authentication cookie contents.":
"prefix":"wp_generate_auth_cookie"
"body":"wp_generate_auth_cookie( ${1:\\$user_id}${2:, \\$expiration}${3:, \\$scheme = 'auth'}${4:, \\$token = ''} )"
"Generates a random password drawn from the defined set of characters.":
"prefix":"wp_generate_password"
"body":"wp_generate_password( ${1:\\$length = 12}${2:, \\$special_chars = true}${3:, \\$extra_special_chars = false} )"
"Generates a tag cloud (heatmap) from provided data.":
"prefix":"wp_generate_tag_cloud"
"body":"wp_generate_tag_cloud( ${1:\\$tags}${2:, \\$args = ''} )"
"Generate a random UUID (version 4).":
"prefix":"wp_generate_uuid4"
"body":"wp_generate_uuid4()"
"Displays the XHTML generator that is generated on the wp_head hook.":
"prefix":"wp_generator"
"body":"wp_generator()"
"Retrieve an array of active and valid plugin files.":
"prefix":"wp_get_active_and_valid_plugins"
"body":"wp_get_active_and_valid_plugins()"
"Returns array of network plugin files to be included in global scope.":
"prefix":"wp_get_active_network_plugins"
"body":"wp_get_active_network_plugins()"
"Retrieve additional image sizes.":
"prefix":"wp_get_additional_image_sizes"
"body":"wp_get_additional_image_sizes()"
"Retrieve a list of sessions for the current user.":
"prefix":"wp_get_all_sessions"
"body":"wp_get_all_sessions()"
"Display archive links based on type and format.":
"prefix":"wp_get_archives"
"body":"wp_get_archives( ${1:\\$args = ''} )"
"Get the menu items associated with a particular object.":
"prefix":"wp_get_associated_nav_menu_items"
"body":"wp_get_associated_nav_menu_items( ${1:\\$object_id}${2:, \\$object_type = 'post_type'}${3:, \\$taxonomy = ''} )"
"Retrieves the caption for an attachment.":
"prefix":"wp_get_attachment_caption"
"body":"wp_get_attachment_caption( ${1:\\$post_id} )"
"Returns useful keys to use to lookup data from an attachment's stored metadata.":
"prefix":"wp_get_attachment_id3_keys"
"body":"wp_get_attachment_id3_keys( ${1:\\$attachment}${2:, \\$context = 'display'} )"
"Get an HTML img element representing an image attachment":
"prefix":"wp_get_attachment_image"
"body":"wp_get_attachment_image( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false}${4:, \\$attr = ''} )"
"Retrieves the value for an image attachment's 'sizes' attribute.":
"prefix":"wp_get_attachment_image_sizes"
"body":"wp_get_attachment_image_sizes( ${1:\\$attachment_id}${2:, \\$size = 'medium'}${3:, \\$image_meta = null} )"
"Retrieve an image to represent an attachment.":
"prefix":"wp_get_attachment_image_src"
"body":"wp_get_attachment_image_src( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false} )"
"Retrieves the value for an image attachment's 'srcset' attribute.":
"prefix":"wp_get_attachment_image_srcset"
"body":"wp_get_attachment_image_srcset( ${1:\\$attachment_id}${2:, \\$size = 'medium'}${3:, \\$image_meta = null} )"
"Get the URL of an image attachment.":
"prefix":"wp_get_attachment_image_url"
"body":"wp_get_attachment_image_url( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false} )"
"Retrieve an attachment page link using an image or icon, if possible.":
"prefix":"wp_get_attachment_link"
"body":"wp_get_attachment_link( ${1:\\$id}${2:, \\$size = 'thumbnail'}${3:, \\$permalink = false}${4:, \\$icon = false}${5:, \\$text = false}${6:, \\$attr = ''} )"
"Retrieve attachment meta field for attachment ID.":
"prefix":"wp_get_attachment_metadata"
"body":"wp_get_attachment_metadata( ${1:\\$post_id}${2:, \\$unfiltered = false} )"
"Retrieve thumbnail for an attachment.":
"prefix":"wp_get_attachment_thumb_file"
"body":"wp_get_attachment_thumb_file( ${1:\\$post_id} )"
"Retrieve URL for an attachment thumbnail.":
"prefix":"wp_get_attachment_thumb_url"
"body":"wp_get_attachment_thumb_url( ${1:\\$post_id} )"
"Retrieve the URL for an attachment.":
"prefix":"wp_get_attachment_url"
"body":"wp_get_attachment_url( ${1:\\$post_id} )"
"Returns a filtered list of WP-supported audio formats.":
"prefix":"wp_get_audio_extensions"
"body":"wp_get_audio_extensions()"
"Get available translations from the WordPress.org API.":
"prefix":"wp_get_available_translations"
"body":"wp_get_available_translations()"
"Returns the canonical URL for a post.":
"prefix":"wp_get_canonical_url"
"body":"wp_get_canonical_url( ${1:\\$post = null} )"
"Retrieves the maximum character lengths for the comment form fields.":
"prefix":"wp_get_comment_fields_max_lengths"
"body":"wp_get_comment_fields_max_lengths()"
"The status of a comment by ID.":
"prefix":"wp_get_comment_status"
"body":"wp_get_comment_status( ${1:\\$comment_id} )"
"Gets the user cookie login. This function is deprecated.":
"prefix":"wp_get_cookie_login"
"body":"wp_get_cookie_login()"
"Get current commenter's name, email, and URL.":
"prefix":"wp_get_current_commenter"
"body":"wp_get_current_commenter()"
"Retrieve the current user object.":
"prefix":"wp_get_current_user"
"body":"wp_get_current_user()"
"Fetch the saved Custom CSS content for rendering.":
"prefix":"wp_get_custom_css"
"body":"wp_get_custom_css( ${1:\\$stylesheet = ''} )"
"Fetch the `custom_css` post for a given theme.":
"prefix":"wp_get_custom_css_post"
"body":"wp_get_custom_css_post( ${1:\\$stylesheet = ''} )"
"Retrieve the SQL for creating database tables.":
"prefix":"wp_get_db_schema"
"body":"wp_get_db_schema( ${1:\\$scope = 'all'}${2:, \\$blog_id = null} )"
"Returns document title for the current page.":
"prefix":"wp_get_document_title"
"body":"wp_get_document_title()"
"Retrieves the list of common file extensions and their types.":
"prefix":"wp_get_ext_types"
"body":"wp_get_ext_types()"
"Perform a HTTP HEAD or GET request.":
"prefix":"wp_get_http"
"body":"wp_get_http( ${1:\\$url}${2:, \\$file_path = false}${3:, \\$red = 1} )"
"Retrieve HTTP Headers from URL.":
"prefix":"wp_get_http_headers"
"body":"wp_get_http_headers( ${1:\\$url}${2:, \\$deprecated = false} )"
"Returns a WP_Image_Editor instance and loads file into it.":
"prefix":"wp_get_image_editor"
"body":"wp_get_image_editor( ${1:\\$path}${2:, \\$args = array()} )"
"Returns the real mime type of an image file.":
"prefix":"wp_get_image_mime"
"body":"wp_get_image_mime( ${1:\\$file} )"
"Get installed translations.":
"prefix":"wp_get_installed_translations"
"body":"wp_get_installed_translations( ${1:\\$type} )"
"Retrieves the link categories associated with the link specified.":
"prefix":"wp_get_link_cats"
"body":"wp_get_link_cats( ${1:\\$link_id} )"
"Gets the links associated with category.":
"prefix":"wp_get_links"
"body":"wp_get_links( ${1:\\$args = ''} )"
"Gets the links associated with the named category.":
"prefix":"wp_get_linksbyname"
"body":"wp_get_linksbyname( ${1:\\$category}${2:, \\$args = ''} )"
"Retrieve list of mime types and file extensions.":
"prefix":"wp_get_mime_types"
"body":"wp_get_mime_types()"
"Retrieve an array of must-use plugin files.":
"prefix":"wp_get_mu_plugins"
"body":"wp_get_mu_plugins()"
"Retrieves all menu items of a navigation menu.":
"prefix":"wp_get_nav_menu_items"
"body":"wp_get_nav_menu_items( ${1:\\$menu}${2:, \\$args = array()} )"
"Returns a navigation menu object.":
"prefix":"wp_get_nav_menu_object"
"body":"wp_get_nav_menu_object( ${1:\\$menu} )"
"Returns the menu formatted to edit.":
"prefix":"wp_get_nav_menu_to_edit"
"body":"wp_get_nav_menu_to_edit( ${1:\\$menu_id} )"
"Returns all navigation menu objects.":
"prefix":"wp_get_nav_menus"
"body":"wp_get_nav_menus( ${1:\\$args = array()} )"
"Retrieve an object containing information about the requested network.":
"prefix":"wp_get_network"
"body":"wp_get_network( ${1:\\$network} )"
"Get the header information to prevent caching.":
"prefix":"wp_get_nocache_headers"
"body":"wp_get_nocache_headers()"
"Retrieves the terms associated with the given object(s), in the supplied taxonomies.":
"prefix":"wp_get_object_terms"
"body":"wp_get_object_terms( ${1:\\$object_ids}${2:, \\$taxonomies}${3:, \\$args = array()} )"
"Retrieve original referer that was posted, if it exists.":
"prefix":"wp_get_original_referer"
"body":"wp_get_original_referer()"
"Gets the text suggesting how to create strong passwords.":
"prefix":"wp_get_password_hint"
"body":"wp_get_password_hint()"
"Extract headers from a PO file.":
"prefix":"wp_get_pomo_file_data"
"body":"wp_get_pomo_file_data( ${1:\\$po_file} )"
"Returns a list from WordPress.org of popular importer plugins.":
"prefix":"wp_get_popular_importers"
"body":"wp_get_popular_importers()"
"Retrieve the autosaved data of the specified post.":
"prefix":"wp_get_post_autosave"
"body":"wp_get_post_autosave( ${1:\\$post_id}${2:, \\$user_id} )"
"Retrieve the list of categories for a post.":
"prefix":"wp_get_post_categories"
"body":"wp_get_post_categories( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieves a list of post categories.":
"prefix":"wp_get_post_cats"
"body":"wp_get_post_cats( ${1:\\$blogid = '1'}${2:, \\$post_ID} )"
"Return the post's parent's post_ID":
"prefix":"wp_get_post_parent_id"
"body":"wp_get_post_parent_id( ${1:\\$post_ID} )"
"Gets a post revision.":
"prefix":"wp_get_post_revision"
"body":"wp_get_post_revision( ${1:\\$post}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Returns all revisions of specified post.":
"prefix":"wp_get_post_revisions"
"body":"wp_get_post_revisions( ${1:\\$post_id}${2:, \\$args = null} )"
"Retrieve the tags for a post. wp_get_post_tags":
"prefix":"wp_get_post_tags"
"body":"wp_get_post_tags( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieve the terms for a post.":
"prefix":"wp_get_post_terms"
"body":"wp_get_post_terms( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'}${3:, \\$args = array()} )"
"Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.":
"prefix":"wp_get_raw_referer"
"body":"wp_get_raw_referer()"
"Retrieve a number of recent posts.":
"prefix":"wp_get_recent_posts"
"body":"wp_get_recent_posts( ${1:\\$args = array()}${2:, \\$output = ARRAY_A} )"
"Retrieve referer from '_wp_http_referer' or HTTP referer.":
"prefix":"wp_get_referer"
"body":"wp_get_referer()"
"Get the revision UI diff.":
"prefix":"wp_get_revision_ui_diff"
"body":"wp_get_revision_ui_diff( ${1:\\$post}${2:, \\$compare_from}${3:, \\$compare_to} )"
"Retrieve the recurrence schedule for an event.":
"prefix":"wp_get_schedule"
"body":"wp_get_schedule( ${1:\\$hook}${2:, \\$args = array()} )"
"Retrieve supported event recurrence schedules.":
"prefix":"wp_get_schedules"
"body":"wp_get_schedules()"
"Return the HTTP protocol sent by the server.":
"prefix":"wp_get_server_protocol"
"body":"wp_get_server_protocol()"
"Retrieve the current session token from the logged_in cookie.":
"prefix":"wp_get_session_token"
"body":"wp_get_session_token()"
"Returns a shortlink for a post, page, attachment, or site.":
"prefix":"wp_get_shortlink"
"body":"wp_get_shortlink( ${1:\\$id}${2:, \\$context = 'post'}${3:, \\$allow_slugs = true} )"
"Retrieve full list of sidebars and their widget instance IDs.":
"prefix":"wp_get_sidebars_widgets"
"body":"wp_get_sidebars_widgets( ${1:\\$deprecated = true} )"
"Retrieve a single post, based on post ID.":
"prefix":"wp_get_single_post"
"body":"wp_get_single_post( ${1:\\$postid}${2:, \\$mode = OBJECT} )"
"Return an array of sites for a network or networks.":
"prefix":"wp_get_sites"
"body":"wp_get_sites( ${1:\\$args = array()} )"
"Get the new term ID corresponding to a previously split term.":
"prefix":"wp_get_split_term"
"body":"wp_get_split_term( ${1:\\$old_term_id}${2:, \\$taxonomy} )"
"Get data about terms that previously shared a single term_id, but have since been split.":
"prefix":"wp_get_split_terms"
"body":"wp_get_split_terms( ${1:\\$old_term_id} )"
"Returns the term's parent's term_ID.":
"prefix":"wp_get_term_taxonomy_parent_id"
"body":"wp_get_term_taxonomy_parent_id( ${1:\\$term_id}${2:, \\$taxonomy} )"
"Gets a WP_Theme object for a theme.":
"prefix":"wp_get_theme"
"body":"wp_get_theme( ${1:\\$stylesheet = null}${2:, \\$theme_root = null} )"
"Returns an array of WP_Theme objects based on the arguments.":
"prefix":"wp_get_themes"
"body":"wp_get_themes( ${1:\\$args = array()} )"
"Retrieves a list of all language updates available.":
"prefix":"wp_get_translation_updates"
"body":"wp_get_translation_updates()"
"Collect counts and UI strings for available updates":
"prefix":"wp_get_update_data"
"body":"wp_get_update_data()"
"Retrieves uploads directory information.":
"prefix":"wp_get_upload_dir"
"body":"wp_get_upload_dir()"
"Set up the user contact methods.":
"prefix":"wp_get_user_contact_methods"
"body":"wp_get_user_contact_methods( ${1:\\$user = null} )"
"Get the user IDs of all users with no role on this site.":
"prefix":"wp_get_users_with_no_role"
"body":"wp_get_users_with_no_role()"
"Returns a filtered list of WP-supported video formats.":
"prefix":"wp_get_video_extensions"
"body":"wp_get_video_extensions()"
"Retrieve default registered sidebars list.":
"prefix":"wp_get_widget_defaults"
"body":"wp_get_widget_defaults()"
"Guess the URL for the site.":
"prefix":"wp_guess_url"
"body":"wp_guess_url()"
"Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form.":
"prefix":"wp_handle_comment_submission"
"body":"wp_handle_comment_submission( ${1:\\$comment_data} )"
"Wrapper for _wp_handle_upload(). wp_handle_sideload":
"prefix":"wp_handle_sideload"
"body":"wp_handle_sideload( ${1:\\$file}${2:, \\$overrides = false}${3:, \\$time = null} )"
"Wrapper for _wp_handle_upload(). wp_handle_upload":
"prefix":"wp_handle_upload"
"body":"wp_handle_upload( ${1:\\$file}${2:, \\$overrides = false}${3:, \\$time = null} )"
"Get hash of given string.":
"prefix":"wp_hash"
"body":"wp_hash( ${1:\\$data}${2:, \\$scheme = 'auth'} )"
"Create a hash (encrypt) of a plain text password.":
"prefix":"wp_hash_password"
"body":"wp_hash_password( ${1:\\$password} )"
"Fire the wp_head action.":
"prefix":"wp_head"
"body":"wp_head()"
"Disable suspension of Heartbeat on the Add/Edit Post screens.":
"prefix":"wp_heartbeat_set_suspension"
"body":"wp_heartbeat_set_suspension( ${1:\\$settings} )"
"Default settings for heartbeat":
"prefix":"wp_heartbeat_settings"
"body":"wp_heartbeat_settings( ${1:\\$settings} )"
"Safely extracts not more than the first $count characters from html string.":
"prefix":"wp_html_excerpt"
"body":"wp_html_excerpt( ${1:\\$str}${2:, \\$count}${3:, \\$more = null} )"
"Separate HTML elements and comments from the text.":
"prefix":"wp_html_split"
"body":"wp_html_split( ${1:\\$input} )"
"Formats text for the HTML editor.":
"prefix":"wp_htmledit_pre"
"body":"wp_htmledit_pre( ${1:\\$output} )"
"Determines if there is an HTTP Transport that can process this request.":
"prefix":"wp_http_supports"
"body":"wp_http_supports( ${1:\\$capabilities = array()}${2:, \\$url = null} )"
"Validate a URL for safe use in the HTTP API.":
"prefix":"wp_http_validate_url"
"body":"wp_http_validate_url( ${1:\\$url} )"
"Adds the iframe to display content for the media upload page":
"prefix":"wp_iframe"
"body":"wp_iframe( ${1:\\$content_func} )"
"Adds 'srcset' and 'sizes' attributes to an existing 'img' element.":
"prefix":"wp_image_add_srcset_and_sizes"
"body":"wp_image_add_srcset_and_sizes( ${1:\\$image}${2:, \\$image_meta}${3:, \\$attachment_id} )"
"Loads the WP image-editing interface.":
"prefix":"wp_image_editor"
"body":"wp_image_editor( ${1:\\$post_id}${2:, \\$msg = false} )"
"Tests whether there is an editor that supports a given mime type or methods.":
"prefix":"wp_image_editor_supports"
"body":"wp_image_editor_supports( ${1:\\$args = array()} )"
"Helper function to test if aspect ratios for two images match.":
"prefix":"wp_image_matches_ratio"
"body":"wp_image_matches_ratio( ${1:\\$source_width}${2:, \\$source_height}${3:, \\$target_width}${4:, \\$target_height} )"
"Create new GD image resource with transparency support":
"prefix":"wp_imagecreatetruecolor"
"body":"wp_imagecreatetruecolor( ${1:\\$width}${2:, \\$height} )"
"Cleanup importer.":
"prefix":"wp_import_cleanup"
"body":"wp_import_cleanup( ${1:\\$id} )"
"Handle importer uploading and add attachment.":
"prefix":"wp_import_handle_upload"
"body":"wp_import_handle_upload()"
"Outputs the form used by the importers to accept the data to be imported":
"prefix":"wp_import_upload_form"
"body":"wp_import_upload_form( ${1:\\$action} )"
"Defines initial WordPress constants":
"prefix":"wp_initial_constants"
"body":"wp_initial_constants()"
"Limit the amount of meta boxes to pages, posts, links, and categories for first time users.":
"prefix":"wp_initial_nav_menu_meta_boxes"
"body":"wp_initial_nav_menu_meta_boxes()"
"Insert an attachment.":
"prefix":"wp_insert_attachment"
"body":"wp_insert_attachment( ${1:\\$args}${2:, \\$file = false}${3:, \\$parent}${4:, \\$wp_error = false} )"
"Updates an existing Category or creates a new Category.":
"prefix":"wp_insert_category"
"body":"wp_insert_category( ${1:\\$catarr}${2:, \\$wp_error = false} )"
"Inserts a comment into the database.":
"prefix":"wp_insert_comment"
"body":"wp_insert_comment( ${1:\\$commentdata} )"
"Inserts/updates links into/in the database.":
"prefix":"wp_insert_link"
"body":"wp_insert_link( ${1:\\$linkdata}${2:, \\$wp_error = false} )"
"Insert or update a post.":
"prefix":"wp_insert_post"
"body":"wp_insert_post( ${1:\\$postarr}${2:, \\$wp_error = false} )"
"Add a new term to the database.":
"prefix":"wp_insert_term"
"body":"wp_insert_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Insert a user into the database.":
"prefix":"wp_insert_user"
"body":"wp_insert_user( ${1:\\$userdata} )"
"Installs the site.":
"prefix":"wp_install"
"body":"wp_install( ${1:\\$blog_title}${2:, \\$user_name}${3:, \\$user_email}${4:, \\$public}${5:, \\$deprecated = ''}${6:, \\$user_password = ''}${7:, \\$language = ''} )"
"Creates the initial content for a newly-installed site.":
"prefix":"wp_install_defaults"
"body":"wp_install_defaults( ${1:\\$user_id} )"
"Output the select form for the language selection on the installation screen.":
"prefix":"wp_install_language_form"
"body":"wp_install_language_form( ${1:\\$languages} )"
"Maybe enable pretty permalinks on install.":
"prefix":"wp_install_maybe_enable_pretty_permalinks"
"body":"wp_install_maybe_enable_pretty_permalinks()"
"Check or set whether WordPress is in "installation" mode.":
"prefix":"wp_installing"
"body":"wp_installing( ${1:\\$is_installing = null} )"
"Determines whether file modifications are allowed.":
"prefix":"wp_is_file_mod_allowed"
"body":"wp_is_file_mod_allowed( ${1:\\$context} )"
"Determines whether a PHP ini value is changeable at runtime.":
"prefix":"wp_is_ini_value_changeable"
"body":"wp_is_ini_value_changeable( ${1:\\$setting} )"
"Whether or not we have a large network.":
"prefix":"wp_is_large_network"
"body":"wp_is_large_network( ${1:\\$using = 'sites'}${2:, \\$network_id = null} )"
"Test if the current browser runs on a mobile device (smart phone, tablet, etc.)":
"prefix":"wp_is_mobile"
"body":"wp_is_mobile()"
"Determines if the variable is a numeric-indexed array.":
"prefix":"wp_is_numeric_array"
"body":"wp_is_numeric_array( ${1:\\$data} )"
"Determines if the specified post is an autosave.":
"prefix":"wp_is_post_autosave"
"body":"wp_is_post_autosave( ${1:\\$post} )"
"Determines if the specified post is a revision.":
"prefix":"wp_is_post_revision"
"body":"wp_is_post_revision( ${1:\\$post} )"
"Test if a given path is a stream URL":
"prefix":"wp_is_stream"
"body":"wp_is_stream( ${1:\\$path} )"
"Determine if a directory is writable.":
"prefix":"wp_is_writable"
"body":"wp_is_writable( ${1:\\$path} )"
"Convert to ASCII from email subjects.":
"prefix":"wp_iso_descrambler"
"body":"wp_iso_descrambler( ${1:\\$string} )"
"Encode a variable into JSON, with some sanity checks.":
"prefix":"wp_json_encode"
"body":"wp_json_encode( ${1:\\$data}${2:, \\$options}${3:, \\$depth = 512} )"
"Load localized data on print rather than initialization.":
"prefix":"wp_just_in_time_script_localization"
"body":"wp_just_in_time_script_localization()"
"Filters content and keeps only allowable HTML elements.":
"prefix":"wp_kses"
"body":"wp_kses( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols = array()} )"
"Return a list of allowed tags and attributes for a given context.":
"prefix":"wp_kses_allowed_html"
"body":"wp_kses_allowed_html( ${1:\\$context = ''} )"
"Goes through an array and changes the keys to all lower case.":
"prefix":"wp_kses_array_lc"
"body":"wp_kses_array_lc( ${1:\\$inarray} )"
"Removes all attributes, if none are allowed for this element.":
"prefix":"wp_kses_attr"
"body":"wp_kses_attr( ${1:\\$element}${2:, \\$attr}${3:, \\$allowed_html}${4:, \\$allowed_protocols} )"
"Determine whether an attribute is allowed.":
"prefix":"wp_kses_attr_check"
"body":"wp_kses_attr_check( ${1:\\$name}${2:, \\$value}${3:, \\$whole}${4:, \\$vless}${5:, \\$element}${6:, \\$allowed_html} )"
"Finds all attributes of an HTML element.":
"prefix":"wp_kses_attr_parse"
"body":"wp_kses_attr_parse( ${1:\\$element} )"
"Sanitize string from bad protocols.":
"prefix":"wp_kses_bad_protocol"
"body":"wp_kses_bad_protocol( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Sanitizes content from bad protocols and other characters.":
"prefix":"wp_kses_bad_protocol_once"
"body":"wp_kses_bad_protocol_once( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Callback for wp_kses_bad_protocol_once() regular expression.":
"prefix":"wp_kses_bad_protocol_once2"
"body":"wp_kses_bad_protocol_once2( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Performs different checks for attribute values.":
"prefix":"wp_kses_check_attr_val"
"body":"wp_kses_check_attr_val( ${1:\\$value}${2:, \\$vless}${3:, \\$checkname}${4:, \\$checkvalue} )"
"Sanitize content with allowed HTML Kses rules. wp_kses_datare":
"prefix":"wp_kses_data"
"body":"wp_kses_data( ${1:\\$data} )"
"Convert all entities to their character counterparts.":
"prefix":"wp_kses_decode_entities"
"body":"wp_kses_decode_entities( ${1:\\$string} )"
"Builds an attribute list from string containing attributes. wp_kses_hair":
"prefix":"wp_kses_hair"
"body":"wp_kses_hair( ${1:\\$attr}${2:, \\$allowed_protocols} )"
"Builds an attribute list from string containing attributes. wp_kses_hair_parse":
"prefix":"wp_kses_hair_parse"
"body":"wp_kses_hair_parse( ${1:\\$attr} )"
"You add any kses hooks here.":
"prefix":"wp_kses_hook"
"body":"wp_kses_hook( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Handles parsing errors in wp_kses_hair().":
"prefix":"wp_kses_html_error"
"body":"wp_kses_html_error( ${1:\\$string} )"
"Removes the HTML JavaScript entities found in early versions of Netscape 4.":
"prefix":"wp_kses_js_entities"
"body":"wp_kses_js_entities( ${1:\\$string} )"
"Callback for wp_kses_normalize_entities() regular expression. wp_kses_named_entitiesre":
"prefix":"wp_kses_named_entities"
"body":"wp_kses_named_entities( ${1:\\$matches} )"
"Removes any invalid control characters in $string.":
"prefix":"wp_kses_no_null"
"body":"wp_kses_no_null( ${1:\\$string}${2:, \\$options = null} )"
"Converts and fixes HTML entities.":
"prefix":"wp_kses_normalize_entities"
"body":"wp_kses_normalize_entities( ${1:\\$string} )"
"Callback for wp_kses_normalize_entities() regular expression. wp_kses_normalize_entities2":
"prefix":"wp_kses_normalize_entities2"
"body":"wp_kses_normalize_entities2( ${1:\\$matches} )"
"Callback for wp_kses_normalize_entities() for regular expression.":
"prefix":"wp_kses_normalize_entities3"
"body":"wp_kses_normalize_entities3( ${1:\\$matches} )"
"Filters one attribute only and ensures its value is allowed.":
"prefix":"wp_kses_one_attr"
"body":"wp_kses_one_attr( ${1:\\$string}${2:, \\$element} )"
"Sanitize content for allowed HTML tags for post content. wp_kses_post":
"prefix":"wp_kses_post"
"body":"wp_kses_post( ${1:\\$data} )"
"Navigates through an array, object, or scalar, and sanitizes content for
allowed HTML tags for post content.":
"prefix":"wp_kses_post_deep"
"body":"wp_kses_post_deep( ${1:\\$data} )"
"Searches for HTML tags, no matter how malformed.":
"prefix":"wp_kses_split"
"body":"wp_kses_split( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Callback for wp_kses_split for fixing malformed HTML tags.":
"prefix":"wp_kses_split2"
"body":"wp_kses_split2( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Strips slashes from in front of quotes.":
"prefix":"wp_kses_stripslashes"
"body":"wp_kses_stripslashes( ${1:\\$string} )"
"This function returns kses' version number.":
"prefix":"wp_kses_version"
"body":"wp_kses_version()"
"Outputs a link category checklist element.":
"prefix":"wp_link_category_checklist"
"body":"wp_link_category_checklist( ${1:\\$link_id} )"
"Outputs the 'disabled' message for the WordPress Link Manager.":
"prefix":"wp_link_manager_disabled_message"
"body":"wp_link_manager_disabled_message()"
"The formatted output of a list of pages.":
"prefix":"wp_link_pages"
"body":"wp_link_pages( ${1:\\$args = ''} )"
"List all the authors of the site, with several options available.":
"prefix":"wp_list_authors"
"body":"wp_list_authors( ${1:\\$args = ''} )"
"Retrieve or echo all of the bookmarks.":
"prefix":"wp_list_bookmarks"
"body":"wp_list_bookmarks( ${1:\\$args = ''} )"
"Display or retrieve the HTML list of categories.":
"prefix":"wp_list_categories"
"body":"wp_list_categories( ${1:\\$args = ''} )"
"Lists categories. wp_list_cats":
"prefix":"wp_list_cats"
"body":"wp_list_cats( ${1:\\$args = ''} )"
"List comments.":
"prefix":"wp_list_comments"
"body":"wp_list_comments( ${1:\\$args = array()}${2:, \\$comments = null} )"
"Filters a list of objects, based on a set of key => value arguments. wp_list_filter":
"prefix":"wp_list_filter"
"body":"wp_list_filter( ${1:\\$list}${2:, \\$args = array()}${3:, \\$operator = 'AND'} )"
"Retrieve or display list of pages (or hierarchical post type items) in list (li) format.":
"prefix":"wp_list_pages"
"body":"wp_list_pages( ${1:\\$args = ''} )"
"Pluck a certain field out of each object in a list.":
"prefix":"wp_list_pluck"
"body":"wp_list_pluck( ${1:\\$list}${2:, \\$field}${3:, \\$index_key = null} )"
"Display list of a post's revisions.":
"prefix":"wp_list_post_revisions"
"body":"wp_list_post_revisions( ${1:\\$post_id}${2:, \\$type = 'all'} )"
"Sorts a list of objects, based on one or more orderby arguments.":
"prefix":"wp_list_sort"
"body":"wp_list_sort( ${1:\\$list}${2:, \\$orderby = array()}${3:, \\$order = 'ASC'}${4:, \\$preserve_keys = false} )"
"Show the widgets and their settings for a sidebar.":
"prefix":"wp_list_widget_controls"
"body":"wp_list_widget_controls( ${1:\\$sidebar}${2:, \\$sidebar_name = ''} )"
"Retrieves the widget control arguments.":
"prefix":"wp_list_widget_controls_dynamic_sidebar"
"body":"wp_list_widget_controls_dynamic_sidebar( ${1:\\$params} )"
"Display list of the available widgets.":
"prefix":"wp_list_widgets"
"body":"wp_list_widgets()"
"Loads and caches all autoloaded options, if available or all options.":
"prefix":"wp_load_alloptions"
"body":"wp_load_alloptions()"
"Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used.":
"prefix":"wp_load_core_site_options"
"body":"wp_load_core_site_options( ${1:\\$site_id = null} )"
"Load an image from a string, if PHP supports it.":
"prefix":"wp_load_image"
"body":"wp_load_image( ${1:\\$file} )"
"Attempt an early load of translations.":
"prefix":"wp_load_translations_early"
"body":"wp_load_translations_early()"
"Localizes community events data that needs to be passed to dashboard.js.":
"prefix":"wp_localize_community_events"
"body":"wp_localize_community_events()"
"Localizes the jQuery UI datepicker.":
"prefix":"wp_localize_jquery_ui_datepicker"
"body":"wp_localize_jquery_ui_datepicker()"
"Localize a script.":
"prefix":"wp_localize_script"
"body":"wp_localize_script( ${1:\\$handle}${2:, \\$object_name}${3:, \\$l10n} )"
"Checks a users login information and logs them in if it checks out. This function is deprecated.":
"prefix":"wp_login"
"body":"wp_login( ${1:\\$username}${2:, \\$password}${3:, \\$deprecated = ''} )"
"Provides a simple login form for use anywhere within WordPress.":
"prefix":"wp_login_form"
"body":"wp_login_form( ${1:\\$args = array()} )"
"Retrieves the login URL.":
"prefix":"wp_login_url"
"body":"wp_login_url( ${1:\\$redirect = ''}${2:, \\$force_reauth = false} )"
"wp_login_viewport_meta":
"prefix":"wp_login_viewport_meta"
"body":"wp_login_viewport_meta()"
"Display the Log In/Out link.":
"prefix":"wp_loginout"
"body":"wp_loginout( ${1:\\$redirect = ''}${2:, \\$echo = true} )"
"Log the current user out.":
"prefix":"wp_logout"
"body":"wp_logout()"
"Retrieves the logout URL.":
"prefix":"wp_logout_url"
"body":"wp_logout_url( ${1:\\$redirect = ''} )"
"Returns the URL that allows the user to retrieve the lost password":
"prefix":"wp_lostpassword_url"
"body":"wp_lostpassword_url( ${1:\\$redirect = ''} )"
"Add magic quotes to `$_GET`, `$_POST`, `$_COOKIE`, and `$_SERVER`.":
"prefix":"wp_magic_quotes"
"body":"wp_magic_quotes()"
"Send mail, similar to PHP's mail":
"prefix":"wp_mail"
"body":"wp_mail( ${1:\\$to}${2:, \\$subject}${3:, \\$message}${4:, \\$headers = ''}${5:, \\$attachments = array()} )"
"Die with a maintenance message when conditions are met.":
"prefix":"wp_maintenance"
"body":"wp_maintenance()"
"Filters 'img' elements in post content to add 'srcset' and 'sizes' attributes.":
"prefix":"wp_make_content_images_responsive"
"body":"wp_make_content_images_responsive( ${1:\\$content} )"
"Convert full URL paths to absolute paths.":
"prefix":"wp_make_link_relative"
"body":"wp_make_link_relative( ${1:\\$link} )"
"Check a MIME-Type against a list.":
"prefix":"wp_match_mime_types"
"body":"wp_match_mime_types( ${1:\\$wildcard_mime_types}${2:, \\$real_mime_types} )"
"Determines the maximum upload size allowed in php.ini.":
"prefix":"wp_max_upload_size"
"body":"wp_max_upload_size()"
"Performs WordPress automatic background updates.":
"prefix":"wp_maybe_auto_update"
"body":"wp_maybe_auto_update()"
"Determines if the date should be declined.":
"prefix":"wp_maybe_decline_date"
"body":"wp_maybe_decline_date( ${1:\\$date} )"
"Maybe attempts to generate attachment metadata, if missing.":
"prefix":"wp_maybe_generate_attachment_metadata"
"body":"wp_maybe_generate_attachment_metadata( ${1:\\$attachment} )"
"Determines if default embed handlers should be loaded.":
"prefix":"wp_maybe_load_embeds"
"body":"wp_maybe_load_embeds()"
"Determines if Widgets library should be loaded.":
"prefix":"wp_maybe_load_widgets"
"body":"wp_maybe_load_widgets()"
"Update the count of sites for the current network.":
"prefix":"wp_maybe_update_network_site_counts"
"body":"wp_maybe_update_network_site_counts( ${1:\\$network_id = null} )"
"Update the network-wide users count.":
"prefix":"wp_maybe_update_network_user_counts"
"body":"wp_maybe_update_network_user_counts( ${1:\\$network_id = null} )"
"Encapsulate logic for Attach/Detach actions":
"prefix":"wp_media_attach_action"
"body":"wp_media_attach_action( ${1:\\$parent_id}${2:, \\$action = 'attach'} )"
"Creates the form for external url":
"prefix":"wp_media_insert_url_form"
"body":"wp_media_insert_url_form( ${1:\\$default_view = 'image'} )"
"Handles the process of uploading media.":
"prefix":"wp_media_upload_handler"
"body":"wp_media_upload_handler()"
"Provides a No-JS Flash fallback as a last resort for audio / video.":
"prefix":"wp_mediaelement_fallback"
"body":"wp_mediaelement_fallback( ${1:\\$url} )"
"Theme container function for the 'wp_meta' action.":
"prefix":"wp_meta"
"body":"wp_meta()"
"Retrieves the queue for lazy-loading metadata.":
"prefix":"wp_metadata_lazyloader"
"body":"wp_metadata_lazyloader()"
"Retrieve the icon for a MIME type.":
"prefix":"wp_mime_type_icon"
"body":"wp_mime_type_icon( ${1:\\$mime} )"
"Recursive directory creation based on full path.":
"prefix":"wp_mkdir_p"
"body":"wp_mkdir_p( ${1:\\$target} )"
"Displays a navigation menu.":
"prefix":"wp_nav_menu"
"body":"wp_nav_menu( ${1:\\$args = array()} )"
"Check whether to disable the Menu Locations meta box submit button":
"prefix":"wp_nav_menu_disabled_check"
"body":"wp_nav_menu_disabled_check( ${1:\\$nav_menu_selected_id} )"
"Displays a meta box for the custom links menu item.":
"prefix":"wp_nav_menu_item_link_meta_box"
"body":"wp_nav_menu_item_link_meta_box()"
"Displays a meta box for a post type menu item.":
"prefix":"wp_nav_menu_item_post_type_meta_box"
"body":"wp_nav_menu_item_post_type_meta_box( ${1:\\$object}${2:, \\$box} )"
"Displays a meta box for a taxonomy menu item.":
"prefix":"wp_nav_menu_item_taxonomy_meta_box"
"body":"wp_nav_menu_item_taxonomy_meta_box( ${1:\\$object}${2:, \\$box} )"
"This was once used to display a meta box for the nav menu theme locations.":
"prefix":"wp_nav_menu_locations_meta_box"
"body":"wp_nav_menu_locations_meta_box()"
"Returns the columns for the nav menus page.":
"prefix":"wp_nav_menu_manage_columns"
"body":"wp_nav_menu_manage_columns()"
"wp_nav_menu_max_depth":
"prefix":"wp_nav_menu_max_depth"
"body":"wp_nav_menu_max_depth( ${1:\\$classes} )"
"Creates meta boxes for any post type menu item..":
"prefix":"wp_nav_menu_post_type_meta_boxes"
"body":"wp_nav_menu_post_type_meta_boxes()"
"Register nav menu meta boxes and advanced menu items.":
"prefix":"wp_nav_menu_setup"
"body":"wp_nav_menu_setup()"
"Creates meta boxes for any taxonomy menu item.":
"prefix":"wp_nav_menu_taxonomy_meta_boxes"
"body":"wp_nav_menu_taxonomy_meta_boxes()"
"Saves nav menu items":
"prefix":"wp_nav_menu_update_menu_items"
"body":"wp_nav_menu_update_menu_items( ${1:\\$nav_menu_selected_id}${2:, \\$nav_menu_selected_title} )"
"wp_network_dashboard_right_now":
"prefix":"wp_network_dashboard_right_now"
"body":"wp_network_dashboard_right_now()"
"Notifies the site admin that the setup is complete.":
"prefix":"wp_new_blog_notification"
"body":"wp_new_blog_notification( ${1:\\$blog_title}${2:, \\$blog_url}${3:, \\$user_id}${4:, \\$password} )"
"Adds a new comment to the database.":
"prefix":"wp_new_comment"
"body":"wp_new_comment( ${1:\\$commentdata}${2:, \\$avoid_die = false} )"
"Send a comment moderation notification to the comment moderator.":
"prefix":"wp_new_comment_notify_moderator"
"body":"wp_new_comment_notify_moderator( ${1:\\$comment_ID} )"
"Send a notification of a new comment to the post author.":
"prefix":"wp_new_comment_notify_postauthor"
"body":"wp_new_comment_notify_postauthor( ${1:\\$comment_ID} )"
"Email login credentials to a newly-registered user.":
"prefix":"wp_new_user_notification"
"body":"wp_new_user_notification( ${1:\\$user_id}${2:, \\$deprecated = null}${3:, \\$notify = ''} )"
"Retrieve the next timestamp for an event.":
"prefix":"wp_next_scheduled"
"body":"wp_next_scheduled( ${1:\\$hook}${2:, \\$args = array()} )"
"Display a noindex meta tag.":
"prefix":"wp_no_robots"
"body":"wp_no_robots()"
"Display "Are You Sure" message to confirm the action being taken.":
"prefix":"wp_nonce_ays"
"body":"wp_nonce_ays( ${1:\\$action} )"
"Retrieve or display nonce hidden field for forms.":
"prefix":"wp_nonce_field"
"body":"wp_nonce_field( ${1:\\$action = -1}${2:, \\$name = '_wpnonce'}${3:, \\$referer = true}${4:, \\$echo = true} )"
"Get the time-dependent variable for nonce creation.":
"prefix":"wp_nonce_tick"
"body":"wp_nonce_tick()"
"Retrieve URL with nonce added to URL query.":
"prefix":"wp_nonce_url"
"body":"wp_nonce_url( ${1:\\$actionurl}${2:, \\$action = -1}${3:, \\$name = '_wpnonce'} )"
"Normalize a filesystem path.":
"prefix":"wp_normalize_path"
"body":"wp_normalize_path( ${1:\\$path} )"
"Redirect to the installer if WordPress is not installed.":
"prefix":"wp_not_installed"
"body":"wp_not_installed()"
"Notifies the moderator of the site about a new comment that is awaiting approval.":
"prefix":"wp_notify_moderator"
"body":"wp_notify_moderator( ${1:\\$comment_id} )"
"Notify an author (and/or others) of a comment/trackback/pingback on a post.":
"prefix":"wp_notify_postauthor"
"body":"wp_notify_postauthor( ${1:\\$comment_id}${2:, \\$deprecated = null} )"
"Flush all output buffers for PHP 5.2.":
"prefix":"wp_ob_end_flush_all"
"body":"wp_ob_end_flush_all()"
"Adds oEmbed discovery links in the website <head>.":
"prefix":"wp_oembed_add_discovery_links"
"body":"wp_oembed_add_discovery_links()"
"Adds the necessary JavaScript to communicate with the embedded iframes.":
"prefix":"wp_oembed_add_host_js"
"body":"wp_oembed_add_host_js()"
"Adds a URL format and oEmbed provider URL pair.":
"prefix":"wp_oembed_add_provider"
"body":"wp_oembed_add_provider( ${1:\\$format}${2:, \\$provider}${3:, \\$regex = false} )"
"Ensures that the specified format is either 'json' or 'xml'.":
"prefix":"wp_oembed_ensure_format"
"body":"wp_oembed_ensure_format( ${1:\\$format} )"
"Attempts to fetch the embed HTML for a provided URL using oEmbed.":
"prefix":"wp_oembed_get"
"body":"wp_oembed_get( ${1:\\$url}${2:, \\$args = ''} )"
"Registers the oEmbed REST API route.":
"prefix":"wp_oembed_register_route"
"body":"wp_oembed_register_route()"
"Removes an oEmbed provider.":
"prefix":"wp_oembed_remove_provider"
"body":"wp_oembed_remove_provider( ${1:\\$format} )"
"Redirect old slugs to the correct permalink.":
"prefix":"wp_old_slug_redirect"
"body":"wp_old_slug_redirect()"
"Retrieve or display original referer hidden field for forms.":
"prefix":"wp_original_referer_field"
"body":"wp_original_referer_field( ${1:\\$echo = true}${2:, \\$jump_back_to = 'current'} )"
"Displays or retrieves a list of pages with an optional home link.":
"prefix":"wp_page_menu"
"body":"wp_page_menu( ${1:\\$args = array()} )"
"Outputs JS that reloads the page if the user navigated to it with the Back or Forward button.":
"prefix":"wp_page_reload_on_back_button_js"
"body":"wp_page_reload_on_back_button_js()"
"Merge user defined arguments into defaults array.":
"prefix":"wp_parse_args"
"body":"wp_parse_args( ${1:\\$args}${2:, \\$defaults = ''} )"
"Parse a cookie into its components":
"prefix":"wp_parse_auth_cookie"
"body":"wp_parse_auth_cookie( ${1:\\$cookie = ''}${2:, \\$scheme = ''} )"
"Clean up an array, comma- or space-separated list of IDs.":
"prefix":"wp_parse_id_list"
"body":"wp_parse_id_list( ${1:\\$list} )"
"Clean up an array, comma- or space-separated list of slugs.":
"prefix":"wp_parse_slug_list"
"body":"wp_parse_slug_list( ${1:\\$list} )"
"Parses a string into variables to be stored in an array.":
"prefix":"wp_parse_str"
"body":"wp_parse_str( ${1:\\$string}${2:, \\$array} )"
"A wrapper for PHP's parse_url() function that handles consistency in the return
values across PHP versions.":
"prefix":"wp_parse_url"
"body":"wp_parse_url( ${1:\\$url}${2:, \\$component = -1} )"
"Notify the blog admin of a user changing password, normally via email.":
"prefix":"wp_password_change_notification"
"body":"wp_password_change_notification( ${1:\\$user} )"
"Outputs and enqueue default scripts and styles for playlists.":
"prefix":"wp_playlist_scripts"
"body":"wp_playlist_scripts( ${1:\\$type} )"
"Builds the Playlist shortcode output.":
"prefix":"wp_playlist_shortcode"
"body":"wp_playlist_shortcode( ${1:\\$attr} )"
"Defines plugin directory WordPress constants":
"prefix":"wp_plugin_directory_constants"
"body":"wp_plugin_directory_constants()"
"Displays update information for a plugin.":
"prefix":"wp_plugin_update_row"
"body":"wp_plugin_update_row( ${1:\\$file}${2:, \\$plugin_data} )"
"wp_plugin_update_rows":
"prefix":"wp_plugin_update_rows"
"body":"wp_plugin_update_rows()"
"Prints default Plupload arguments.":
"prefix":"wp_plupload_default_settings"
"body":"wp_plupload_default_settings()"
"Retrieve a list of the most popular terms from the specified taxonomy.":
"prefix":"wp_popular_terms_checklist"
"body":"wp_popular_terms_checklist( ${1:\\$taxonomy}${2:, \\$default}${3:, \\$number = 10}${4:, \\$echo = true} )"
"Convert MIME types into SQL.":
"prefix":"wp_post_mime_type_where"
"body":"wp_post_mime_type_where( ${1:\\$post_mime_types}${2:, \\$table_alias = ''} )"
"Outputs a small JS snippet on preview tabs/windows to remove `window.name` on unload.":
"prefix":"wp_post_preview_js"
"body":"wp_post_preview_js()"
"Retrieve formatted date timestamp of a revision (linked to that revisions's page). wp_post_revision_title":
"prefix":"wp_post_revision_title"
"body":"wp_post_revision_title( ${1:\\$revision}${2:, \\$link = true} )"
"Retrieve formatted date timestamp of a revision (linked to that revisions's page). wp_post_revision_title_expanded":
"prefix":"wp_post_revision_title_expanded"
"body":"wp_post_revision_title_expanded( ${1:\\$revision}${2:, \\$link = true} )"
"Convert lone less than signs.":
"prefix":"wp_pre_kses_less_than"
"body":"wp_pre_kses_less_than( ${1:\\$text} )"
"Callback function used by preg_replace.":
"prefix":"wp_pre_kses_less_than_callback"
"body":"wp_pre_kses_less_than_callback( ${1:\\$matches} )"
"Preloads TinyMCE dialogs.":
"prefix":"wp_preload_dialogs"
"body":"wp_preload_dialogs()"
"Prepares an attachment post object for JS, where it is expected
to be JSON-encoded and fit into an Attachment model.":
"prefix":"wp_prepare_attachment_for_js"
"body":"wp_prepare_attachment_for_js( ${1:\\$attachment} )"
"Prepare revisions for JavaScript.":
"prefix":"wp_prepare_revisions_for_js"
"body":"wp_prepare_revisions_for_js( ${1:\\$post}${2:, \\$selected_revision_id}${3:, \\$from = null} )"
"Prepare themes for JavaScript.":
"prefix":"wp_prepare_themes_for_js"
"body":"wp_prepare_themes_for_js( ${1:\\$themes = null} )"
"Prints the JavaScript templates for update admin notices.":
"prefix":"wp_print_admin_notice_templates"
"body":"wp_print_admin_notice_templates()"
"Prints the markup for the Community Events section of the Events and News Dashboard widget.":
"prefix":"wp_print_community_events_markup"
"body":"wp_print_community_events_markup()"
"Renders the events templates for the Event and News widget.":
"prefix":"wp_print_community_events_templates"
"body":"wp_print_community_events_templates()"
"Prints TinyMCE editor JS.":
"prefix":"wp_print_editor_js"
"body":"wp_print_editor_js()"
"Hooks to print the scripts and styles in the footer.":
"prefix":"wp_print_footer_scripts"
"body":"wp_print_footer_scripts()"
"Prints the script queue in the HTML head on the front end.":
"prefix":"wp_print_head_scripts"
"body":"wp_print_head_scripts()"
"Prints the templates used in the media manager.":
"prefix":"wp_print_media_templates"
"body":"wp_print_media_templates()"
"Print the filesystem credentials modal when needed.":
"prefix":"wp_print_request_filesystem_credentials_modal"
"body":"wp_print_request_filesystem_credentials_modal()"
"Print JavaScript templates required for the revisions experience.":
"prefix":"wp_print_revision_templates"
"body":"wp_print_revision_templates()"
"Prints scripts in document head that are in the $handles queue.":
"prefix":"wp_print_scripts"
"body":"wp_print_scripts( ${1:\\$handles = false} )"
"Display styles that are in the $handles queue.":
"prefix":"wp_print_styles"
"body":"wp_print_styles( ${1:\\$handles = false} )"
"Prints the JavaScript templates for update and deletion rows in list tables.":
"prefix":"wp_print_update_row_templates"
"body":"wp_print_update_row_templates()"
"Protect WordPress special option from being modified.":
"prefix":"wp_protect_special_option"
"body":"wp_protect_special_option( ${1:\\$option} )"
"Reorder JavaScript scripts array to place prototype before jQuery.":
"prefix":"wp_prototype_before_jquery"
"body":"wp_prototype_before_jquery( ${1:\\$js_array} )"
"Publish a post by transitioning the post status.":
"prefix":"wp_publish_post"
"body":"wp_publish_post( ${1:\\$post} )"
"Queues comments for metadata lazy-loading.":
"prefix":"wp_queue_comments_for_comment_meta_lazyload"
"body":"wp_queue_comments_for_comment_meta_lazyload( ${1:\\$comments} )"
"Queues posts for lazy-loading of term meta.":
"prefix":"wp_queue_posts_for_term_meta_lazyload"
"body":"wp_queue_posts_for_term_meta_lazyload( ${1:\\$posts} )"
"Handles quicktags.":
"prefix":"wp_quicktags"
"body":"wp_quicktags()"
"Attempts to raise the PHP memory limit for memory intensive processes.":
"prefix":"wp_raise_memory_limit"
"body":"wp_raise_memory_limit( ${1:\\$context = 'admin'} )"
"Generates a random number":
"prefix":"wp_rand"
"body":"wp_rand( ${1:\\$min}${2:, \\$max} )"
"Retrieve metadata from a audio file's ID3 tags":
"prefix":"wp_read_audio_metadata"
"body":"wp_read_audio_metadata( ${1:\\$file} )"
"Get extended image metadata, exif or iptc as available.":
"prefix":"wp_read_image_metadata"
"body":"wp_read_image_metadata( ${1:\\$file} )"
"Retrieve metadata from a video file's ID3 tags":
"prefix":"wp_read_video_metadata"
"body":"wp_read_video_metadata( ${1:\\$file} )"
"Redirects to another page.":
"prefix":"wp_redirect"
"body":"wp_redirect( ${1:\\$location}${2:, \\$status = 302} )"
"Redirects a variety of shorthand URLs to the admin.":
"prefix":"wp_redirect_admin_locations"
"body":"wp_redirect_admin_locations()"
"Retrieve or display referer hidden field for forms.":
"prefix":"wp_referer_field"
"body":"wp_referer_field( ${1:\\$echo = true} )"
"Check lock status on the New/Edit Post screen and refresh the lock":
"prefix":"wp_refresh_post_lock"
"body":"wp_refresh_post_lock( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Check nonce expiration on the New/Edit Post screen and refresh if needed":
"prefix":"wp_refresh_post_nonces"
"body":"wp_refresh_post_nonces( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Display the Registration or Admin link.":
"prefix":"wp_register"
"body":"wp_register( ${1:\\$before = '<li>'}${2:, \\$after = '</li>'}${3:, \\$echo = true} )"
"Register a plugin's real path.":
"prefix":"wp_register_plugin_realpath"
"body":"wp_register_plugin_realpath( ${1:\\$file} )"
"Register a new script.":
"prefix":"wp_register_script"
"body":"wp_register_script( ${1:\\$handle}${2:, \\$src}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$in_footer = false} )"
"Register an instance of a widget.":
"prefix":"wp_register_sidebar_widget"
"body":"wp_register_sidebar_widget( ${1:\\$id}${2:, \\$name}${3:, \\$output_callback}${4:, \\$options = array()} )"
"Register a CSS stylesheet.":
"prefix":"wp_register_style"
"body":"wp_register_style( ${1:\\$handle}${2:, \\$src}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$media = 'all'} )"
"Registers widget control callback for customizing options. wp_register_widget_control":
"prefix":"wp_register_widget_control"
"body":"wp_register_widget_control( ${1:\\$id}${2:, \\$name}${3:, \\$control_callback}${4:, \\$options = array()} )"
"Returns the URL that allows the user to register on the site.":
"prefix":"wp_registration_url"
"body":"wp_registration_url()"
"Adds rel nofollow string to all HTML A elements in content.":
"prefix":"wp_rel_nofollow"
"body":"wp_rel_nofollow( ${1:\\$text} )"
"Callback to add rel=nofollow string to HTML A element.":
"prefix":"wp_rel_nofollow_callback"
"body":"wp_rel_nofollow_callback( ${1:\\$matches} )"
"HTTP request for URI to retrieve content.":
"prefix":"wp_remote_fopen"
"body":"wp_remote_fopen( ${1:\\$uri} )"
"Retrieve the raw response from the HTTP request using the GET method.":
"prefix":"wp_remote_get"
"body":"wp_remote_get( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request using the HEAD method.":
"prefix":"wp_remote_head"
"body":"wp_remote_head( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request using the POST method.":
"prefix":"wp_remote_post"
"body":"wp_remote_post( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request.":
"prefix":"wp_remote_request"
"body":"wp_remote_request( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve only the body from the raw response.":
"prefix":"wp_remote_retrieve_body"
"body":"wp_remote_retrieve_body( ${1:\\$response} )"
"Retrieve a single cookie by name from the raw response.":
"prefix":"wp_remote_retrieve_cookie"
"body":"wp_remote_retrieve_cookie( ${1:\\$response}${2:, \\$name} )"
"Retrieve a single cookie's value by name from the raw response.":
"prefix":"wp_remote_retrieve_cookie_value"
"body":"wp_remote_retrieve_cookie_value( ${1:\\$response}${2:, \\$name} )"
"Retrieve only the cookies from the raw response.":
"prefix":"wp_remote_retrieve_cookies"
"body":"wp_remote_retrieve_cookies( ${1:\\$response} )"
"Retrieve a single header by name from the raw response.":
"prefix":"wp_remote_retrieve_header"
"body":"wp_remote_retrieve_header( ${1:\\$response}${2:, \\$header} )"
"Retrieve only the headers from the raw response.":
"prefix":"wp_remote_retrieve_headers"
"body":"wp_remote_retrieve_headers( ${1:\\$response} )"
"Retrieve only the response code from the raw response.":
"prefix":"wp_remote_retrieve_response_code"
"body":"wp_remote_retrieve_response_code( ${1:\\$response} )"
"Retrieve only the response message from the raw response.":
"prefix":"wp_remote_retrieve_response_message"
"body":"wp_remote_retrieve_response_message( ${1:\\$response} )"
"Returns an array of single-use query variable names that can be removed from a URL.":
"prefix":"wp_removable_query_args"
"body":"wp_removable_query_args()"
"Remove term(s) associated with a given object.":
"prefix":"wp_remove_object_terms"
"body":"wp_remove_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy} )"
"Replace characters or phrases within HTML elements only.":
"prefix":"wp_replace_in_html_tags"
"body":"wp_replace_in_html_tags( ${1:\\$haystack}${2:, \\$replace_pairs} )"
"Reschedule a recurring event.":
"prefix":"wp_reschedule_event"
"body":"wp_reschedule_event( ${1:\\$timestamp}${2:, \\$recurrence}${3:, \\$hook}${4:, \\$args = array()} )"
"After looping through a separate query, this function restores
the $post global to the current post in the main query.":
"prefix":"wp_reset_postdata"
"body":"wp_reset_postdata()"
"Destroys the previous query and sets up a new query.":
"prefix":"wp_reset_query"
"body":"wp_reset_query()"
"Resets global variables based on $_GET and $_POST":
"prefix":"wp_reset_vars"
"body":"wp_reset_vars( ${1:\\$vars} )"
"Resolve numeric slugs that collide with date permalinks.":
"prefix":"wp_resolve_numeric_slug_conflicts"
"body":"wp_resolve_numeric_slug_conflicts( ${1:\\$query_vars = array()} )"
"Prints resource hints to browsers for pre-fetching, pre-rendering
and pre-connecting to web sites.":
"prefix":"wp_resource_hints"
"body":"wp_resource_hints()"
"Restores the metadata for a given attachment.":
"prefix":"wp_restore_image"
"body":"wp_restore_image( ${1:\\$post_id} )"
"Restores a post to the specified revision.":
"prefix":"wp_restore_post_revision"
"body":"wp_restore_post_revision( ${1:\\$revision_id}${2:, \\$fields = null} )"
"Determine if revisions are enabled for a given post.":
"prefix":"wp_revisions_enabled"
"body":"wp_revisions_enabled( ${1:\\$post} )"
"Determine how many revisions to retain for a given post.":
"prefix":"wp_revisions_to_keep"
"body":"wp_revisions_to_keep( ${1:\\$post} )"
"Remove all capabilities from user.":
"prefix":"wp_revoke_user"
"body":"wp_revoke_user( ${1:\\$id} )"
"Formats text for the rich text editor.":
"prefix":"wp_richedit_pre"
"body":"wp_richedit_pre( ${1:\\$text} )"
"Retrieves the global WP_Roles instance and instantiates it if necessary.":
"prefix":"wp_roles"
"body":"wp_roles()"
"Display all RSS items in a HTML ordered list.":
"prefix":"wp_rss"
"body":"wp_rss( ${1:\\$url}${2:, \\$num_items = -1} )"
"Performs a safe (local) redirect, using wp_redirect().":
"prefix":"wp_safe_redirect"
"body":"wp_safe_redirect( ${1:\\$location}${2:, \\$status = 302} )"
"Retrieve the raw response from a safe HTTP request using the GET method.":
"prefix":"wp_safe_remote_get"
"body":"wp_safe_remote_get( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request using the HEAD method.":
"prefix":"wp_safe_remote_head"
"body":"wp_safe_remote_head( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request using the POST method.":
"prefix":"wp_safe_remote_post"
"body":"wp_safe_remote_post( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request.":
"prefix":"wp_safe_remote_request"
"body":"wp_safe_remote_request( ${1:\\$url}${2:, \\$args = array()} )"
"Get salt to add to hashes.":
"prefix":"wp_salt"
"body":"wp_salt( ${1:\\$scheme = 'auth'} )"
"Sanitizes a URL for use in a redirect.":
"prefix":"wp_sanitize_redirect"
"body":"wp_sanitize_redirect( ${1:\\$location} )"
"Saves image to post along with enqueued changes
in $_REQUEST['history']":
"prefix":"wp_save_image"
"body":"wp_save_image( ${1:\\$post_id} )"
"Saves Image to File":
"prefix":"wp_save_image_file"
"body":"wp_save_image_file( ${1:\\$filename}${2:, \\$image}${3:, \\$mime_type}${4:, \\$post_id} )"
"Save posted nav menu item data.":
"prefix":"wp_save_nav_menu_items"
"body":"wp_save_nav_menu_items( ${1:\\$menu_id}${2:, \\$menu_data = array()} )"
"Creates a revision for the current version of a post.":
"prefix":"wp_save_post_revision"
"body":"wp_save_post_revision( ${1:\\$post_id} )"
"Schedule a recurring event.":
"prefix":"wp_schedule_event"
"body":"wp_schedule_event( ${1:\\$timestamp}${2:, \\$recurrence}${3:, \\$hook}${4:, \\$args = array()} )"
"Schedules an event to run only once.":
"prefix":"wp_schedule_single_event"
"body":"wp_schedule_single_event( ${1:\\$timestamp}${2:, \\$hook}${3:, \\$args = array()} )"
"Schedule core, theme, and plugin update checks.":
"prefix":"wp_schedule_update_checks"
"body":"wp_schedule_update_checks()"
"Schedule update of the network-wide counts for the current network.":
"prefix":"wp_schedule_update_network_counts"
"body":"wp_schedule_update_network_counts()"
"Permanently delete comments or posts of any type that have held a status
of 'trash' for the number of days defined in EMPTY_TRASH_DAYS.":
"prefix":"wp_scheduled_delete"
"body":"wp_scheduled_delete()"
"Add metadata to a script.":
"prefix":"wp_script_add_data"
"body":"wp_script_add_data( ${1:\\$handle}${2:, \\$key}${3:, \\$value} )"
"Check whether a script has been added to the queue.":
"prefix":"wp_script_is"
"body":"wp_script_is( ${1:\\$handle}${2:, \\$list = 'enqueued'} )"
"Initialize $wp_scripts if it has not been set.":
"prefix":"wp_scripts"
"body":"wp_scripts()"
"Send a JSON response back to an Ajax request.":
"prefix":"wp_send_json"
"body":"wp_send_json( ${1:\\$response}${2:, \\$status_code = null} )"
"Send a JSON response back to an Ajax request, indicating failure.":
"prefix":"wp_send_json_error"
"body":"wp_send_json_error( ${1:\\$data = null}${2:, \\$status_code = null} )"
"Send a JSON response back to an Ajax request, indicating success.":
"prefix":"wp_send_json_success"
"body":"wp_send_json_success( ${1:\\$data = null}${2:, \\$status_code = null} )"
"Initiates email notifications related to the creation of new users.":
"prefix":"wp_send_new_user_notifications"
"body":"wp_send_new_user_notifications( ${1:\\$user_id}${2:, \\$notify = 'both'} )"
"Private. Set all user interface settings.":
"prefix":"wp_set_all_user_settings"
"body":"wp_set_all_user_settings( ${1:\\$user_settings} )"
"Log in a user by setting authentication cookies.":
"prefix":"wp_set_auth_cookie"
"body":"wp_set_auth_cookie( ${1:\\$user_id}${2:, \\$remember = false}${3:, \\$secure = ''}${4:, \\$token = ''} )"
"Sets the cookies used to store an unauthenticated commentator's identity. Typically used
to recall previous comments by this commentator that are still held in moderation.":
"prefix":"wp_set_comment_cookies"
"body":"wp_set_comment_cookies( ${1:\\$comment}${2:, \\$user} )"
"Sets the status of a comment.":
"prefix":"wp_set_comment_status"
"body":"wp_set_comment_status( ${1:\\$comment_id}${2:, \\$comment_status}${3:, \\$wp_error = false} )"
"Changes the current user by ID or name. wp_set_current_user":
"prefix":"wp_set_current_user"
"body":"wp_set_current_user( ${1:\\$id}${2:, \\$name = ''} )"
"Set internal encoding.":
"prefix":"wp_set_internal_encoding"
"body":"wp_set_internal_encoding()"
"Set the location of the language directory.":
"prefix":"wp_set_lang_dir"
"body":"wp_set_lang_dir()"
"Update link with the specified link categories.":
"prefix":"wp_set_link_cats"
"body":"wp_set_link_cats( ${1:\\$link_id}${2:, \\$link_categories = array()} )"
"Create Term and Taxonomy Relationships.":
"prefix":"wp_set_object_terms"
"body":"wp_set_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy}${4:, \\$append = false} )"
"Updates the user's password with a new encrypted one.":
"prefix":"wp_set_password"
"body":"wp_set_password( ${1:\\$password}${2:, \\$user_id} )"
"Set categories for a post.":
"prefix":"wp_set_post_categories"
"body":"wp_set_post_categories( ${1:\\$post_ID}${2:, \\$post_categories = array()}${3:, \\$append = false} )"
"Sets the categories that the post id belongs to.":
"prefix":"wp_set_post_cats"
"body":"wp_set_post_cats( ${1:\\$blogid = '1'}${2:, \\$post_ID}${3:, \\$post_categories = array()} )"
"Mark the post as currently being edited by the current user":
"prefix":"wp_set_post_lock"
"body":"wp_set_post_lock( ${1:\\$post_id} )"
"Set the tags for a post.":
"prefix":"wp_set_post_tags"
"body":"wp_set_post_tags( ${1:\\$post_id}${2:, \\$tags = ''}${3:, \\$append = false} )"
"Set the terms for a post.":
"prefix":"wp_set_post_terms"
"body":"wp_set_post_terms( ${1:\\$post_id}${2:, \\$tags = ''}${3:, \\$taxonomy = 'post_tag'}${4:, \\$append = false} )"
"Set the sidebar widget option to update sidebars.":
"prefix":"wp_set_sidebars_widgets"
"body":"wp_set_sidebars_widgets( ${1:\\$sidebars_widgets} )"
"Set the database table prefix and the format specifiers for database
table columns.":
"prefix":"wp_set_wpdb_vars"
"body":"wp_set_wpdb_vars()"
"Sets a cookie for a user who just logged in. This function is deprecated.":
"prefix":"wp_setcookie"
"body":"wp_setcookie( ${1:\\$username}${2:, \\$password = ''}${3:, \\$already_md5 = false}${4:, \\$home = ''}${5:, \\$siteurl = ''}${6:, \\$remember = false} )"
"Decorates a menu item object with the shared navigation menu item properties.":
"prefix":"wp_setup_nav_menu_item"
"body":"wp_setup_nav_menu_item( ${1:\\$menu_item} )"
"wp_shake_js":
"prefix":"wp_shake_js"
"body":"wp_shake_js()"
"Sends a Link: rel=shortlink header if a shortlink is defined for the current page.":
"prefix":"wp_shortlink_header"
"body":"wp_shortlink_header()"
"Injects rel=shortlink into the head if a shortlink is defined for the current page.":
"prefix":"wp_shortlink_wp_head"
"body":"wp_shortlink_wp_head()"
"Determine if global tables should be upgraded.":
"prefix":"wp_should_upgrade_global_tables"
"body":"wp_should_upgrade_global_tables()"
"Calculates the new dimensions for a downsampled image.":
"prefix":"wp_shrink_dimensions"
"body":"wp_shrink_dimensions( ${1:\\$width}${2:, \\$height}${3:, \\$wmax = 128}${4:, \\$hmax = 96} )"
"Retrieve description for a sidebar.":
"prefix":"wp_sidebar_description"
"body":"wp_sidebar_description( ${1:\\$id} )"
"Authenticates and logs a user in with 'remember' capability.":
"prefix":"wp_signon"
"body":"wp_signon( ${1:\\$credentials = array()}${2:, \\$secure_cookie = ''} )"
"WordPress autoloader for SimplePie.":
"prefix":"wp_simplepie_autoload"
"body":"wp_simplepie_autoload()"
"Display site icon meta tags.":
"prefix":"wp_site_icon"
"body":"wp_site_icon()"
"Add slashes to a string or array of strings.":
"prefix":"wp_slash"
"body":"wp_slash( ${1:\\$value} )"
"Returns the regexp for common whitespace characters.":
"prefix":"wp_spaces_regexp"
"body":"wp_spaces_regexp()"
"Marks a comment as Spam":
"prefix":"wp_spam_comment"
"body":"wp_spam_comment( ${1:\\$comment_id} )"
"Legacy escaping for HTML blocks.":
"prefix":"wp_specialchars"
"body":"wp_specialchars( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES}${3:, \\$charset = false}${4:, \\$double_encode = false} )"
"Converts a number of HTML entities into their special characters.":
"prefix":"wp_specialchars_decode"
"body":"wp_specialchars_decode( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES} )"
"WordPress implementation of PHP sprintf() with filters.":
"prefix":"wp_sprintf"
"body":"wp_sprintf( ${1:\\$pattern}${2:, \\$args} )"
"Localize list items before the rest of the content.":
"prefix":"wp_sprintf_l"
"body":"wp_sprintf_l( ${1:\\$pattern}${2:, \\$args} )"
"Defines cookie related WordPress constants wp_ssl_constants":
"prefix":"wp_ssl_constants"
"body":"wp_ssl_constants()"
"Output a HTML element with a star rating for a given rating.":
"prefix":"wp_star_rating"
"body":"wp_star_rating( ${1:\\$args = array()} )"
"Start the WordPress object cache.":
"prefix":"wp_start_object_cache"
"body":"wp_start_object_cache()"
"Convert emoji to a static img element.":
"prefix":"wp_staticize_emoji"
"body":"wp_staticize_emoji( ${1:\\$text} )"
"Convert emoji in emails into static images.":
"prefix":"wp_staticize_emoji_for_email"
"body":"wp_staticize_emoji_for_email( ${1:\\$mail} )"
"Streams image in WP_Image_Editor to browser.":
"prefix":"wp_stream_image"
"body":"wp_stream_image( ${1:\\$image}${2:, \\$mime_type}${3:, \\$post_id} )"
"Properly strip all HTML tags including script and style":
"prefix":"wp_strip_all_tags"
"body":"wp_strip_all_tags( ${1:\\$string}${2:, \\$remove_breaks = false} )"
"Add metadata to a CSS stylesheet.":
"prefix":"wp_style_add_data"
"body":"wp_style_add_data( ${1:\\$handle}${2:, \\$key}${3:, \\$value} )"
"Check whether a CSS stylesheet has been added to the queue.":
"prefix":"wp_style_is"
"body":"wp_style_is( ${1:\\$handle}${2:, \\$list = 'enqueued'} )"
"Administration Screen CSS for changing the styles.":
"prefix":"wp_style_loader_src"
"body":"wp_style_loader_src( ${1:\\$src}${2:, \\$handle} )"
"Initialize $wp_styles if it has not been set.":
"prefix":"wp_styles"
"body":"wp_styles()"
"Temporarily suspend cache additions.":
"prefix":"wp_suspend_cache_addition"
"body":"wp_suspend_cache_addition( ${1:\\$suspend = null} )"
"Suspend cache invalidation.":
"prefix":"wp_suspend_cache_invalidation"
"body":"wp_suspend_cache_invalidation( ${1:\\$suspend = true} )"
"Display tag cloud.":
"prefix":"wp_tag_cloud"
"body":"wp_tag_cloud( ${1:\\$args = ''} )"
"Defines templating related WordPress constants":
"prefix":"wp_templating_constants"
"body":"wp_templating_constants()"
"Returns a filename of a Temporary unique file.":
"prefix":"wp_tempnam"
"body":"wp_tempnam( ${1:\\$filename = ''}${2:, \\$dir = ''} )"
"Determine whether a term is shared between multiple taxonomies.":
"prefix":"wp_term_is_shared"
"body":"wp_term_is_shared( ${1:\\$term_id} )"
"Output an unordered list of checkbox input elements labelled with term names.":
"prefix":"wp_terms_checklist"
"body":"wp_terms_checklist( ${1:\\$post_id}${2:, \\$args = array()} )"
"Displays a human readable HTML representation of the difference between two strings.":
"prefix":"wp_text_diff"
"body":"wp_text_diff( ${1:\\$left_string}${2:, \\$right_string}${3:, \\$args = null} )"
"Displays update information for a theme.":
"prefix":"wp_theme_update_row"
"body":"wp_theme_update_row( ${1:\\$theme_key}${2:, \\$theme} )"
"wp_theme_update_rows":
"prefix":"wp_theme_update_rows"
"body":"wp_theme_update_rows()"
"Whether a comment should be blocked because of comment flood.":
"prefix":"wp_throttle_comment_flood"
"body":"wp_throttle_comment_flood( ${1:\\$block}${2:, \\$time_lastcomment}${3:, \\$time_newcomment} )"
"Gives a nicely-formatted list of timezone strings.":
"prefix":"wp_timezone_choice"
"body":"wp_timezone_choice( ${1:\\$selected_zone}${2:, \\$locale = null} )"
"gmt_offset modification for smart timezone handling.":
"prefix":"wp_timezone_override_offset"
"body":"wp_timezone_override_offset()"
"Check for PHP timezone support":
"prefix":"wp_timezone_supported"
"body":"wp_timezone_supported()"
"Outputs the TinyMCE editor.":
"prefix":"wp_tiny_mce"
"body":"wp_tiny_mce()"
"Display or retrieve page title for all areas of blog.":
"prefix":"wp_title"
"body":"wp_title( ${1:\\$sep = '»'}${2:, \\$display = true}${3:, \\$seplocation = ''} )"
"Display the blog title for display of the feed title.":
"prefix":"wp_title_rss"
"body":"wp_title_rss( ${1:\\$deprecated = '–'} )"
"Call hooks for when a comment status transition occurs.":
"prefix":"wp_transition_comment_status"
"body":"wp_transition_comment_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$comment} )"
"Fires actions related to the transitioning of a post's status.":
"prefix":"wp_transition_post_status"
"body":"wp_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Moves a comment to the Trash":
"prefix":"wp_trash_comment"
"body":"wp_trash_comment( ${1:\\$comment_id} )"
"Move a post or page to the Trash":
"prefix":"wp_trash_post"
"body":"wp_trash_post( ${1:\\$post_id} )"
"Moves comments for a post to the trash.":
"prefix":"wp_trash_post_comments"
"body":"wp_trash_post_comments( ${1:\\$post = null} )"
"Generates an excerpt from the content, if needed.":
"prefix":"wp_trim_excerpt"
"body":"wp_trim_excerpt( ${1:\\$text = ''} )"
"Trims text to a certain number of words.":
"prefix":"wp_trim_words"
"body":"wp_trim_words( ${1:\\$text}${2:, \\$num_words = 55}${3:, \\$more = null} )"
"Output the markup for a audio tag to be used in an Underscore template
when data.model is passed.":
"prefix":"wp_underscore_audio_template"
"body":"wp_underscore_audio_template()"
"Outputs the templates used by playlists.":
"prefix":"wp_underscore_playlist_templates"
"body":"wp_underscore_playlist_templates()"
"Output the markup for a video tag to be used in an Underscore template
when data.model is passed.":
"prefix":"wp_underscore_video_template"
"body":"wp_underscore_video_template()"
"Get a filename that is sanitized and unique for the given directory.":
"prefix":"wp_unique_filename"
"body":"wp_unique_filename( ${1:\\$dir}${2:, \\$filename}${3:, \\$unique_filename_callback = null} )"
"Computes a unique slug for the post, when given the desired slug and some post details.":
"prefix":"wp_unique_post_slug"
"body":"wp_unique_post_slug( ${1:\\$slug}${2:, \\$post_ID}${3:, \\$post_status}${4:, \\$post_type}${5:, \\$post_parent} )"
"Will make slug unique, if it isn't already.":
"prefix":"wp_unique_term_slug"
"body":"wp_unique_term_slug( ${1:\\$slug}${2:, \\$term} )"
"Turn register globals off.":
"prefix":"wp_unregister_globals"
"body":"wp_unregister_globals()"
"Remove widget from sidebar.":
"prefix":"wp_unregister_sidebar_widget"
"body":"wp_unregister_sidebar_widget( ${1:\\$id} )"
"Remove control callback for widget.":
"prefix":"wp_unregister_widget_control"
"body":"wp_unregister_widget_control( ${1:\\$id} )"
"Unschedule a previously scheduled event.":
"prefix":"wp_unschedule_event"
"body":"wp_unschedule_event( ${1:\\$timestamp}${2:, \\$hook}${3:, \\$args = array()} )"
"Unschedules all events attached to the hook.":
"prefix":"wp_unschedule_hook"
"body":"wp_unschedule_hook( ${1:\\$hook} )"
"Remove slashes from a string or array of strings.":
"prefix":"wp_unslash"
"body":"wp_unslash( ${1:\\$value} )"
"Removes a comment from the Spam":
"prefix":"wp_unspam_comment"
"body":"wp_unspam_comment( ${1:\\$comment_id} )"
"Removes a comment from the Trash":
"prefix":"wp_untrash_comment"
"body":"wp_untrash_comment( ${1:\\$comment_id} )"
"Restore a post or page from the Trash.":
"prefix":"wp_untrash_post"
"body":"wp_untrash_post( ${1:\\$post_id} )"
"Restore comments for a post from the trash.":
"prefix":"wp_untrash_post_comments"
"body":"wp_untrash_post_comments( ${1:\\$post = null} )"
"Update metadata for an attachment.":
"prefix":"wp_update_attachment_metadata"
"body":"wp_update_attachment_metadata( ${1:\\$post_id}${2:, \\$data} )"
"Aliases wp_insert_category() with minimal args.":
"prefix":"wp_update_category"
"body":"wp_update_category( ${1:\\$catarr} )"
"Updates an existing comment in the database.":
"prefix":"wp_update_comment"
"body":"wp_update_comment( ${1:\\$commentarr} )"
"Updates the comment count for post(s).":
"prefix":"wp_update_comment_count"
"body":"wp_update_comment_count( ${1:\\$post_id}${2:, \\$do_deferred = false} )"
"Updates the comment count for the post.":
"prefix":"wp_update_comment_count_now"
"body":"wp_update_comment_count_now( ${1:\\$post_id} )"
"This was once used to kick-off the Core Updater.":
"prefix":"wp_update_core"
"body":"wp_update_core()"
"Update the `custom_css` post for a given theme.":
"prefix":"wp_update_custom_css_post"
"body":"wp_update_custom_css_post( ${1:\\$css}${2:, \\$args = array()} )"
"Updates a link in the database.":
"prefix":"wp_update_link"
"body":"wp_update_link( ${1:\\$linkdata} )"
"Save the properties of a menu item or create a new one.":
"prefix":"wp_update_nav_menu_item"
"body":"wp_update_nav_menu_item( ${1:\\$menu_id}${2:, \\$menu_item_db_id}${3:, \\$menu_item_data = array()} )"
"Save the properties of a menu or create a new menu with those properties.":
"prefix":"wp_update_nav_menu_object"
"body":"wp_update_nav_menu_object( ${1:\\$menu_id}${2:, \\$menu_data = array()} )"
"Update the network-wide counts for the current network.":
"prefix":"wp_update_network_counts"
"body":"wp_update_network_counts( ${1:\\$network_id = null} )"
"Update the network-wide site count.":
"prefix":"wp_update_network_site_counts"
"body":"wp_update_network_site_counts( ${1:\\$network_id = null} )"
"Update the network-wide user count.":
"prefix":"wp_update_network_user_counts"
"body":"wp_update_network_user_counts( ${1:\\$network_id = null} )"
"This was once used to kick-off the Plugin Updater.":
"prefix":"wp_update_plugin"
"body":"wp_update_plugin()"
"Check plugin versions against the latest versions hosted on WordPress.org.":
"prefix":"wp_update_plugins"
"body":"wp_update_plugins( ${1:\\$extra_stats = array()} )"
"Update a post with new post data.":
"prefix":"wp_update_post"
"body":"wp_update_post( ${1:\\$postarr = array()}${2:, \\$wp_error = false} )"
"Update term based on arguments provided.":
"prefix":"wp_update_term"
"body":"wp_update_term( ${1:\\$term_id}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Updates the amount of terms in taxonomy.":
"prefix":"wp_update_term_count"
"body":"wp_update_term_count( ${1:\\$terms}${2:, \\$taxonomy}${3:, \\$do_deferred = false} )"
"Perform term count update immediately.":
"prefix":"wp_update_term_count_now"
"body":"wp_update_term_count_now( ${1:\\$terms}${2:, \\$taxonomy} )"
"This was once used to kick-off the Theme Updater.":
"prefix":"wp_update_theme"
"body":"wp_update_theme()"
"Check theme versions against the latest versions hosted on WordPress.org.":
"prefix":"wp_update_themes"
"body":"wp_update_themes( ${1:\\$extra_stats = array()} )"
"Update a user in the database.":
"prefix":"wp_update_user"
"body":"wp_update_user( ${1:\\$userdata} )"
"Runs WordPress Upgrade functions.":
"prefix":"wp_upgrade"
"body":"wp_upgrade()"
"Create a file in the upload folder with given content.":
"prefix":"wp_upload_bits"
"body":"wp_upload_bits( ${1:\\$name}${2:, \\$deprecated}${3:, \\$bits}${4:, \\$time = null} )"
"Get an array containing the current upload directory's path and url.":
"prefix":"wp_upload_dir"
"body":"wp_upload_dir( ${1:\\$time = null}${2:, \\$create_dir = true}${3:, \\$refresh_cache = false} )"
"Saves and restores user interface settings stored in a cookie.":
"prefix":"wp_user_settings"
"body":"wp_user_settings()"
"Toggle `$_wp_using_ext_object_cache` on and off without directly
touching global.":
"prefix":"wp_using_ext_object_cache"
"body":"wp_using_ext_object_cache( ${1:\\$using = null} )"
"Validates authentication cookie.":
"prefix":"wp_validate_auth_cookie"
"body":"wp_validate_auth_cookie( ${1:\\$cookie = ''}${2:, \\$scheme = ''} )"
"Filter/validate a variable as a boolean.":
"prefix":"wp_validate_boolean"
"body":"wp_validate_boolean( ${1:\\$var} )"
"Validates the logged-in cookie.":
"prefix":"wp_validate_logged_in_cookie"
"body":"wp_validate_logged_in_cookie( ${1:\\$user_id} )"
"Validates a URL for use in a redirect.":
"prefix":"wp_validate_redirect"
"body":"wp_validate_redirect( ${1:\\$location}${2:, \\$default = ''} )"
"Verify that correct nonce was used with time limit.":
"prefix":"wp_verify_nonce"
"body":"wp_verify_nonce( ${1:\\$nonce}${2:, \\$action = -1} )"
"Check WordPress version against the newest version.":
"prefix":"wp_version_check"
"body":"wp_version_check( ${1:\\$extra_stats = array()}${2:, \\$force_check = false} )"
"Builds the Video shortcode output.":
"prefix":"wp_video_shortcode"
"body":"wp_video_shortcode( ${1:\\$attr}${2:, \\$content = ''} )"
"Displays a welcome panel to introduce users to WordPress.":
"prefix":"wp_welcome_panel"
"body":"wp_welcome_panel()"
"Meta widget used to display the control form for a widget.":
"prefix":"wp_widget_control"
"body":"wp_widget_control( ${1:\\$sidebar_args} )"
"Retrieve description for widget.":
"prefix":"wp_widget_description"
"body":"wp_widget_description( ${1:\\$id} )"
"Display RSS widget options form.":
"prefix":"wp_widget_rss_form"
"body":"wp_widget_rss_form( ${1:\\$args}${2:, \\$inputs = null} )"
"Display the RSS entries in a list.":
"prefix":"wp_widget_rss_output"
"body":"wp_widget_rss_output( ${1:\\$rss}${2:, \\$args = array()} )"
"Process RSS feed widget data and optionally retrieve feed items.":
"prefix":"wp_widget_rss_process"
"body":"wp_widget_rss_process( ${1:\\$widget_rss}${2:, \\$check_feed = true} )"
"wp_widgets_access_body_class":
"prefix":"wp_widgets_access_body_class"
"body":"wp_widgets_access_body_class( ${1:\\$classes} )"
"Append the Widgets menu to the themes main menu.":
"prefix":"wp_widgets_add_menu"
"body":"wp_widgets_add_menu()"
"Registers all of the default WordPress widgets on startup.":
"prefix":"wp_widgets_init"
"body":"wp_widgets_init()"
"Creates a new post from the "Write Post" form using $_POST information.":
"prefix":"wp_write_post"
"body":"wp_write_post()"
"Replaces double line-breaks with paragraph elements.":
"prefix":"wpautop"
"body":"wpautop( ${1:\\$pee}${2:, \\$br = true} )"
"Activate a signup.":
"prefix":"wpmu_activate_signup"
"body":"wpmu_activate_signup( ${1:\\$key} )"
"Loads styles specific to this page.":
"prefix":"wpmu_activate_stylesheet"
"body":"wpmu_activate_stylesheet()"
"Redirect a user based on $_GET or $_POST arguments.":
"prefix":"wpmu_admin_do_redirect"
"body":"wpmu_admin_do_redirect( ${1:\\$url = ''} )"
"Adds an 'updated=true' argument to a URL.":
"prefix":"wpmu_admin_redirect_add_updated_param"
"body":"wpmu_admin_redirect_add_updated_param( ${1:\\$url = ''} )"
"Determines if the available space defined by the admin has been exceeded by the user.":
"prefix":"wpmu_checkavailablespace"
"body":"wpmu_checkavailablespace()"
"Create a site.":
"prefix":"wpmu_create_blog"
"body":"wpmu_create_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user_id}${5:, \\$meta = array()}${6:, \\$site_id = 1} )"
"Create a user.":
"prefix":"wpmu_create_user"
"body":"wpmu_create_user( ${1:\\$user_name}${2:, \\$password}${3:, \\$email} )"
"This deprecated function managed much of the site and network loading in multisite.":
"prefix":"wpmu_current_site"
"body":"wpmu_current_site()"
"Delete a site.":
"prefix":"wpmu_delete_blog"
"body":"wpmu_delete_blog( ${1:\\$blog_id}${2:, \\$drop = false} )"
"Delete a user from the network and remove from all sites.":
"prefix":"wpmu_delete_user"
"body":"wpmu_delete_user( ${1:\\$id} )"
"Deprecated functionality for getting themes allowed on a specific site.":
"prefix":"wpmu_get_blog_allowedthemes"
"body":"wpmu_get_blog_allowedthemes()"
"Logs the user email, IP, and registration date of a new site.":
"prefix":"wpmu_log_new_registrations"
"body":"wpmu_log_new_registrations( ${1:\\$blog_id}${2:, \\$user_id} )"
"Outputs the WPMU menu.":
"prefix":"wpmu_menu"
"body":"wpmu_menu()"
"Record site signup information for future activation.":
"prefix":"wpmu_signup_blog"
"body":"wpmu_signup_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user}${5:, \\$user_email}${6:, \\$meta = array()} )"
"Notify user of signup success. wpmu_signup_blog_notification":
"prefix":"wpmu_signup_blog_notification"
"body":"wpmu_signup_blog_notification( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user_login}${5:, \\$user_email}${6:, \\$key}${7:, \\$meta = array()} )"
"Prints styles for front-end Multisite signup pages":
"prefix":"wpmu_signup_stylesheet"
"body":"wpmu_signup_stylesheet()"
"Record user signup information for future activation.":
"prefix":"wpmu_signup_user"
"body":"wpmu_signup_user( ${1:\\$user}${2:, \\$user_email}${3:, \\$meta = array()} )"
"Notify user of signup success. wpmu_signup_user_notificationre":
"prefix":"wpmu_signup_user_notification"
"body":"wpmu_signup_user_notification( ${1:\\$user_login}${2:, \\$user_email}${3:, \\$key}${4:, \\$meta = array()} )"
"Update the last_updated field for the current site.":
"prefix":"wpmu_update_blogs_date"
"body":"wpmu_update_blogs_date()"
"Processes new site registrations.":
"prefix":"wpmu_validate_blog_signup"
"body":"wpmu_validate_blog_signup( ${1:\\$blogname}${2:, \\$blog_title}${3:, \\$user = ''} )"
"Sanitize and validate data required for a user sign-up.":
"prefix":"wpmu_validate_user_signup"
"body":"wpmu_validate_user_signup( ${1:\\$user_name}${2:, \\$user_email} )"
"Notify a user that their blog activation has been successful.":
"prefix":"wpmu_welcome_notification"
"body":"wpmu_welcome_notification( ${1:\\$blog_id}${2:, \\$user_id}${3:, \\$password}${4:, \\$title}${5:, \\$meta = array()} )"
"Notify a user that their account activation has been successful.":
"prefix":"wpmu_welcome_user_notification"
"body":"wpmu_welcome_user_notification( ${1:\\$user_id}${2:, \\$password}${3:, \\$meta = array()} )"
"Replaces common plain text characters into formatted entities":
"prefix":"wptexturize"
"body":"wptexturize( ${1:\\$text}${2:, \\$reset = false} )"
"Implements a logic tree to determine whether or not "7'." represents seven feet,
then converts the special char into either a prime char or a closing quote char.":
"prefix":"wptexturize_primes"
"body":"wptexturize_primes( ${1:\\$haystack}${2:, \\$needle}${3:, \\$prime}${4:, \\$open_quote}${5:, \\$close_quote} )"
"Returns the URLs for CSS files used in an iframe-sandbox'd TinyMCE media view.":
"prefix":"wpview_media_sandbox_styles"
"body":"wpview_media_sandbox_styles()"
"Calls wp_write_post() and handles the errors.":
"prefix":"write_post"
"body":"write_post()"
"Display checked checkboxes attribute for xfn microformat options.":
"prefix":"xfn_check"
"body":"xfn_check( ${1:\\$class}${2:, \\$value = ''}${3:, \\$deprecated = ''} )"
"Retrieve the post category or categories from XMLRPC XML.":
"prefix":"xmlrpc_getpostcategory"
"body":"xmlrpc_getpostcategory( ${1:\\$content} )"
"Retrieve post title from XMLRPC XML.":
"prefix":"xmlrpc_getposttitle"
"body":"xmlrpc_getposttitle( ${1:\\$content} )"
"Default filter attached to xmlrpc_pingback_error.":
"prefix":"xmlrpc_pingback_error"
"body":"xmlrpc_pingback_error( ${1:\\$ixr_error} )"
"XMLRPC XML content without title and category elements.":
"prefix":"xmlrpc_removepostdata"
"body":"xmlrpc_removepostdata( ${1:\\$content} )"
"Add leading zeros when necessary.":
"prefix":"zeroise"
"body":"zeroise( ${1:\\$number}${2:, \\$threshold} )"
| true | '.source.php':
"_":
"prefix":"_"
"body":"_()"
"Retrieve the translation of $text.":
"prefix":"__"
"body":"__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Autoloader compatibility callback.":
"prefix":"__autoload"
"body":"__autoload( ${1:\\$classname} )"
"Private helper function for checked, selected, and disabled.":
"prefix":"__checked_selected_helper"
"body":"__checked_selected_helper( ${1:\\$helper}${2:, \\$current}${3:, \\$echo}${4:, \\$type} )"
"Helper function to clear the cache for number of authors.":
"prefix":"__clear_multi_author_cache"
"body":"__clear_multi_author_cache()"
"Utility version of get_option that is private to install/upgrade.":
"prefix":"__get_option"
"body":"__get_option( ${1:\\$setting} )"
"Retrieve the plural or single form based on the amount.":
"prefix":"__ngettext"
"body":"__ngettext()"
"Register plural strings in POT file, but don't translate them.":
"prefix":"__ngettext_noop"
"body":"__ngettext_noop()"
"Returns an empty array.":
"prefix":"__return_empty_array"
"body":"__return_empty_array()"
"Returns an empty string.":
"prefix":"__return_empty_string"
"body":"__return_empty_string()"
"Returns false.":
"prefix":"__return_false"
"body":"__return_false()"
"Returns null.":
"prefix":"__return_null"
"body":"__return_null()"
"Returns true.":
"prefix":"__return_true"
"body":"__return_true()"
"Returns 0.":
"prefix":"__return_zero"
"body":"__return_zero()"
"Displays an access denied message when a user tries to view a site's dashboard they
do not have access to.":
"prefix":"_access_denied_splash"
"body":"_access_denied_splash()"
"Add submenus for post types.":
"prefix":"_add_post_type_submenus"
"body":"_add_post_type_submenus()"
"Adds the (theme) 'Editor' link to the bottom of the Appearance menu.":
"prefix":"_add_themes_utility_last"
"body":"_add_themes_utility_last()"
"Default admin bar callback.":
"prefix":"_admin_bar_bump_cb"
"body":"_admin_bar_bump_cb()"
"Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post.":
"prefix":"_admin_notice_post_locked"
"body":"_admin_notice_post_locked()"
"Displays the search query.":
"prefix":"_admin_search_query"
"body":"_admin_search_query()"
"Kill WordPress ajax execution.":
"prefix":"_ajax_wp_die_handler"
"body":"_ajax_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Newline preservation help function for wpautop":
"prefix":"_autop_newline_preservation_helper"
"body":"_autop_newline_preservation_helper( ${1:\\$matches} )"
"Retrieve translated string with vertical bar context":
"prefix":"_c"
"body":"_c( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Retrieve a canonical form of the provided charset appropriate for passing to PHP
functions such as htmlspecialchars() and charset html attributes.":
"prefix":"_canonical_charset"
"body":"_canonical_charset( ${1:\\$charset} )"
"Strip close comment and close php tags from file headers used by WP.":
"prefix":"_cleanup_header_comment"
"body":"_cleanup_header_comment( ${1:\\$str} )"
"Private preg_replace callback used in image_add_caption()":
"prefix":"_cleanup_image_add_caption"
"body":"_cleanup_image_add_caption()"
"Clear the lastcommentmodified cached value when a comment status is changed.":
"prefix":"_clear_modified_cache_on_transition_comment_status"
"body":"_clear_modified_cache_on_transition_comment_status( ${1:\\$new_status}${2:, \\$old_status} )"
"Close comments on an old post. Hooked to comments_open and pings_open.":
"prefix":"_close_comments_for_old_post"
"body":"_close_comments_for_old_post( ${1:\\$open}${2:, \\$post_id} )"
"Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts.":
"prefix":"_close_comments_for_old_posts"
"body":"_close_comments_for_old_posts( ${1:\\$posts}${2:, \\$query} )"
"Retrieve the WordPress home page URL.":
"prefix":"_config_wp_home"
"body":"_config_wp_home( ${1:\\$url = ''} )"
"Retrieve the WordPress site URL.":
"prefix":"_config_wp_siteurl"
"body":"_config_wp_siteurl( ${1:\\$url = ''} )"
"Preview fix for JavaScript bug with foreign languages.":
"prefix":"_convert_urlencoded_to_entities"
"body":"_convert_urlencoded_to_entities( ${1:\\$match} )"
"_copy_dir":
"prefix":"_copy_dir"
"body":"_copy_dir( ${1:\\$from}${2:, \\$to}${3:, \\$skip_list = array()} )"
"Copy an existing image file.":
"prefix":"_copy_image_file"
"body":"_copy_image_file( ${1:\\$attachment_id} )"
"Return the cache key for wp_count_posts() based on the passed arguments.":
"prefix":"_count_posts_cache_key"
"body":"_count_posts_cache_key( ${1:\\$type = 'post'}${2:, \\$perm = ''} )"
"Crops an image resource. Internal use only.":
"prefix":"_crop_image_resource"
"body":"_crop_image_resource( ${1:\\$img}${2:, \\$x}${3:, \\$y}${4:, \\$w}${5:, \\$h} )"
"Default custom background callback.":
"prefix":"_custom_background_cb"
"body":"_custom_background_cb()"
"Registers the internal custom header and background routines.":
"prefix":"_custom_header_background_just_in_time"
"body":"_custom_header_background_just_in_time()"
"Adds CSS to hide header text for custom logo, based on Customizer setting.":
"prefix":"_custom_logo_header_styles"
"body":"_custom_logo_header_styles()"
"Perform a deep string replace operation to ensure the values in $search are no longer present":
"prefix":"_deep_replace"
"body":"_deep_replace( ${1:\\$search}${2:, \\$subject} )"
"Kills WordPress execution and display HTML message with error message.":
"prefix":"_default_wp_die_handler"
"body":"_default_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Checks an attachment being deleted to see if it's a header or background image.":
"prefix":"_delete_attachment_theme_mod"
"body":"_delete_attachment_theme_mod( ${1:\\$id} )"
"Delete the fresh site option.":
"prefix":"_delete_option_fresh_site"
"body":"_delete_option_fresh_site()"
"Mark a function argument as deprecated and inform when it has been used.":
"prefix":"_deprecated_argument"
"body":"_deprecated_argument( ${1:\\$function}${2:, \\$version}${3:, \\$message = null} )"
"Marks a constructor as deprecated and informs when it has been used.":
"prefix":"_deprecated_constructor"
"body":"_deprecated_constructor( ${1:\\$class}${2:, \\$version}${3:, \\$parent_class = ''} )"
"Mark a file as deprecated and inform when it has been used.":
"prefix":"_deprecated_file"
"body":"_deprecated_file( ${1:\\$file}${2:, \\$version}${3:, \\$replacement = null}${4:, \\$message = ''} )"
"Mark a function as deprecated and inform when it has been used.":
"prefix":"_deprecated_function"
"body":"_deprecated_function( ${1:\\$function}${2:, \\$version}${3:, \\$replacement = null} )"
"Marks a deprecated action or filter hook as deprecated and throws a notice.":
"prefix":"_deprecated_hook"
"body":"_deprecated_hook( ${1:\\$hook}${2:, \\$version}${3:, \\$replacement = null}${4:, \\$message = null} )"
"Test if the current device has the capability to upload files.":
"prefix":"_device_can_upload"
"body":"_device_can_upload()"
"Mark something as being incorrectly called.":
"prefix":"_doing_it_wrong"
"body":"_doing_it_wrong( ${1:\\$function}${2:, \\$message}${3:, \\$version} )"
"Get the post title.":
"prefix":"_draft_or_post_title"
"body":"_draft_or_post_title( ${1:\\$post} )"
"Display translated text.":
"prefix":"_e"
"body":"_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated string with gettext context.":
"prefix":"_ex"
"body":"_ex( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Retrieve URL headers and content using WP HTTP Request API.":
"prefix":"_fetch_remote_file"
"body":"_fetch_remote_file( ${1:\\$url}${2:, \\$headers = ''} )"
"Filter the SQL clauses of an attachment query to include filenames.":
"prefix":"_filter_query_attachment_filenames"
"body":"_filter_query_attachment_filenames( ${1:\\$clauses} )"
"Replace hrefs of attachment anchors with up-to-date permalinks.":
"prefix":"_fix_attachment_links"
"body":"_fix_attachment_links( ${1:\\$post} )"
"Flips an image resource. Internal use only.":
"prefix":"_flip_image_resource"
"body":"_flip_image_resource( ${1:\\$img}${2:, \\$horz}${3:, \\$vert} )"
"Hook used to schedule publication for a post marked for the future.":
"prefix":"_future_post_hook"
"body":"_future_post_hook( ${1:\\$deprecated}${2:, \\$post} )"
"Returns a list of meta keys to be (maybe) populated in wp_update_user().":
"prefix":"_get_additional_user_keys"
"body":"_get_additional_user_keys( ${1:\\$user} )"
"Retrieve the admin bar display preference of a user.":
"prefix":"_get_admin_bar_pref"
"body":"_get_admin_bar_pref( ${1:\\$context = 'front'}${2:, \\$user} )"
"Retrieve a specific component from a parsed URL array.":
"prefix":"_get_component_from_parsed_url_array"
"body":"_get_component_from_parsed_url_array( ${1:\\$url_parts}${2:, \\$component = -1} )"
"Retrieve cron info array option.":
"prefix":"_get_cron_array"
"body":"_get_cron_array()"
"Retrieves the cron lock.":
"prefix":"_get_cron_lock"
"body":"_get_cron_lock()"
"Build an object with custom-something object (post type, taxonomy) labels
out of a custom-something object":
"prefix":"_get_custom_object_labels"
"body":"_get_custom_object_labels( ${1:\\$object}${2:, \\$nohier_vs_hier_defaults} )"
"Returns drop-ins that WordPress uses.":
"prefix":"_get_dropins"
"body":"_get_dropins()"
"Get the timestamp of the last time any post was modified or published.":
"prefix":"_get_last_post_time"
"body":"_get_last_post_time( ${1:\\$timezone}${2:, \\$field}${3:, \\$post_type = 'any'} )"
"Fetch an instance of a WP_List_Table class.":
"prefix":"_get_list_table"
"body":"_get_list_table( ${1:\\$class}${2:, \\$args = array()} )"
"Retrieve the name of the metadata table for the specified object type.":
"prefix":"_get_meta_table"
"body":"_get_meta_table( ${1:\\$type} )"
"Retrieve ids that are not already present in the cache.":
"prefix":"_get_non_cached_ids"
"body":"_get_non_cached_ids( ${1:\\$object_ids}${2:, \\$cache_key} )"
"Retrieves the page permalink.":
"prefix":"_get_page_link"
"body":"_get_page_link( ${1:\\$post = false}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Gets the path to a translation file for loading a textdomain just in time.":
"prefix":"_get_path_to_translation"
"body":"_get_path_to_translation( ${1:\\$domain}${2:, \\$reset = false} )"
"Gets the path to a translation file in the languages directory for the current locale.":
"prefix":"_get_path_to_translation_from_lang_dir"
"body":"_get_path_to_translation_from_lang_dir( ${1:\\$domain} )"
"Sanitizes plugin data, optionally adds markup, optionally translates.":
"prefix":"_get_plugin_data_markup_translate"
"body":"_get_plugin_data_markup_translate()"
"Retrieve post ancestors.":
"prefix":"_get_post_ancestors"
"body":"_get_post_ancestors( ${1:\\$post} )"
"Get random header image data from registered images in theme.":
"prefix":"_get_random_header_data"
"body":"_get_random_header_data()"
"Tidies a filename for url display by the theme editor.":
"prefix":"_get_template_edit_filename"
"body":"_get_template_edit_filename( ${1:\\$fullpath}${2:, \\$containingfolder} )"
"Get the subset of $terms that are descendants of $term_id.":
"prefix":"_get_term_children"
"body":"_get_term_children( ${1:\\$term_id}${2:, \\$terms}${3:, \\$taxonomy}${4:, \\$ancestors = array()} )"
"Retrieves children of taxonomy as Term IDs.":
"prefix":"_get_term_hierarchy"
"body":"_get_term_hierarchy( ${1:\\$taxonomy} )"
"Retrieves the widget ID base value.":
"prefix":"_get_widget_id_base"
"body":"_get_widget_id_base( ${1:\\$id} )"
"Retrieve the regular expression for shortcodes.":
"prefix":"_get_wptexturize_shortcode_regex"
"body":"_get_wptexturize_shortcode_regex( ${1:\\$tagnames} )"
"Retrieve the combined regular expression for HTML and shortcodes.":
"prefix":"_get_wptexturize_split_regex"
"body":"_get_wptexturize_split_regex( ${1:\\$shortcode_regex = ''} )"
"Internal compat function to mimic hash_hmac().":
"prefix":"_hash_hmac"
"body":"_hash_hmac( ${1:\\$algo}${2:, \\$data}${3:, \\$key}${4:, \\$raw_output = false} )"
"From php.net (modified by PI:NAME:<NAME>END_PI to behave like the native PHP5 function).":
"prefix":"_http_build_query"
"body":"_http_build_query( ${1:\\$data}${2:, \\$prefix = null}${3:, \\$sep = null}${4:, \\$key = ''}${5:, \\$urlencode = true} )"
"Image preview ratio. Internal use only.":
"prefix":"_image_get_preview_ratio"
"body":"_image_get_preview_ratio( ${1:\\$w}${2:, \\$h} )"
"This was once used to display an 'Insert into Post' button.":
"prefix":"_insert_into_post_button"
"body":"_insert_into_post_button()"
"_ipad_meta":
"prefix":"_ipad_meta"
"body":"_ipad_meta()"
"Return if a menu item is valid.":
"prefix":"_is_valid_nav_menu_item"
"body":"_is_valid_nav_menu_item( ${1:\\$item} )"
"_json_decode_object_helper":
"prefix":"_json_decode_object_helper"
"body":"_json_decode_object_helper( ${1:\\$data} )"
"Callback to add a base url to relative links in passed content.":
"prefix":"_links_add_base"
"body":"_links_add_base( ${1:\\$m} )"
"Callback to add a target attribute to all links in passed content.":
"prefix":"_links_add_target"
"body":"_links_add_target( ${1:\\$m} )"
"Outputs a single row of public meta data in the Custom Fields meta box.":
"prefix":"_list_meta_row"
"body":"_list_meta_row( ${1:\\$entry}${2:, \\$count} )"
"Retrieve the path or url of an attachment's attached file.":
"prefix":"_load_image_to_edit_path"
"body":"_load_image_to_edit_path( ${1:\\$attachment_id}${2:, \\$size = 'full'} )"
"Loads plugin and theme textdomains just-in-time.":
"prefix":"_load_textdomain_just_in_time"
"body":"_load_textdomain_just_in_time( ${1:\\$domain} )"
"Output the HTML for restoring the post data from DOM storage":
"prefix":"_local_storage_notice"
"body":"_local_storage_notice()"
"Update category structure to old pre 2.3 from new taxonomy structure.":
"prefix":"_make_cat_compat"
"body":"_make_cat_compat( ${1:\\$category} )"
"Callback to convert email address match to HTML A element.":
"prefix":"_make_email_clickable_cb"
"body":"_make_email_clickable_cb( ${1:\\$matches} )"
"Callback to convert URI match to HTML A element.":
"prefix":"_make_url_clickable_cb"
"body":"_make_url_clickable_cb( ${1:\\$matches} )"
"Callback to convert URL match to HTML A element.":
"prefix":"_make_web_ftp_clickable_cb"
"body":"_make_web_ftp_clickable_cb( ${1:\\$matches} )"
"Determines whether core should be updated.":
"prefix":"_maybe_update_core"
"body":"_maybe_update_core()"
"Check the last time plugins were run before checking plugin versions.":
"prefix":"_maybe_update_plugins"
"body":"_maybe_update_plugins()"
"Check themes versions only after a duration of time.":
"prefix":"_maybe_update_themes"
"body":"_maybe_update_themes()"
"Internal compat function to mimic mb_strlen().":
"prefix":"_mb_strlen"
"body":"_mb_strlen( ${1:\\$str}${2:, \\$encoding = null} )"
"Internal compat function to mimic mb_substr().":
"prefix":"_mb_substr"
"body":"_mb_substr( ${1:\\$str}${2:, \\$start}${3:, \\$length = null}${4:, \\$encoding = null} )"
"Set the localized direction for MCE plugin.":
"prefix":"_mce_set_direction"
"body":"_mce_set_direction( ${1:\\$mce_init} )"
"This was once used to display a media button.":
"prefix":"_media_button"
"body":"_media_button()"
"_media_states":
"prefix":"_media_states"
"body":"_media_states( ${1:\\$post} )"
"Translates and retrieves the singular or plural form based on the supplied number.":
"prefix":"_n"
"body":"_n( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$domain = 'default'} )"
"Registers plural strings in POT file, but does not translate them.":
"prefix":"_n_noop"
"body":"_n_noop( ${1:\\$singular}${2:, \\$plural}${3:, \\$domain = null} )"
"Prevents a menu item ID from being used more than once.":
"prefix":"_nav_menu_item_id_use_once"
"body":"_nav_menu_item_id_use_once( ${1:\\$id}${2:, \\$item} )"
"Wraps passed links in navigational markup.":
"prefix":"_navigation_markup"
"body":"_navigation_markup( ${1:\\$links}${2:, \\$class = 'posts-navigation'}${3:, \\$screen_reader_text = ''} )"
"Legacy version of _n(), which supports contexts.":
"prefix":"_nc"
"body":"_nc( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$domain = 'default'} )"
"Translates and retrieves the singular or plural form based on the supplied number, with gettext context.":
"prefix":"_nx"
"body":"_nx( ${1:\\$single}${2:, \\$plural}${3:, \\$number}${4:, \\$context}${5:, \\$domain = 'default'} )"
"Registers plural strings with gettext context in POT file, but does not translate them.":
"prefix":"_nx_noop"
"body":"_nx_noop( ${1:\\$singular}${2:, \\$plural}${3:, \\$context}${4:, \\$domain = null} )"
"Creates an XML string from a given array.":
"prefix":"_oembed_create_xml"
"body":"_oembed_create_xml( ${1:\\$data}${2:, \\$node = null} )"
"Prepare the oembed HTML to be displayed in an RSS feed.":
"prefix":"_oembed_filter_feed_content"
"body":"_oembed_filter_feed_content( ${1:\\$content} )"
"Hooks into the REST API output to print XML instead of JSON.":
"prefix":"_oembed_rest_pre_serve_request"
"body":"_oembed_rest_pre_serve_request( ${1:\\$served}${2:, \\$result}${3:, \\$request}${4:, \\$server} )"
"Add count of children to parent count.":
"prefix":"_pad_term_counts"
"body":"_pad_term_counts( ${1:\\$terms}${2:, \\$taxonomy} )"
"Traverse and return all the nested children post names of a root page.":
"prefix":"_page_traverse_name"
"body":"_page_traverse_name( ${1:\\$page_id}${2:, \\$children}${3:, \\$result} )"
"Remove the post format prefix from the name property of the term object created by get_term().":
"prefix":"_post_format_get_term"
"body":"_post_format_get_term( ${1:\\$term} )"
"Remove the post format prefix from the name property of the term objects created by get_terms().":
"prefix":"_post_format_get_terms"
"body":"_post_format_get_terms( ${1:\\$terms}${2:, \\$taxonomies}${3:, \\$args} )"
"Filters the post format term link to remove the format prefix.":
"prefix":"_post_format_link"
"body":"_post_format_link( ${1:\\$link}${2:, \\$term}${3:, \\$taxonomy} )"
"Filters the request to allow for the format prefix.":
"prefix":"_post_format_request"
"body":"_post_format_request( ${1:\\$qvs} )"
"Remove the post format prefix from the name property of the term objects created by wp_get_object_terms().":
"prefix":"_post_format_wp_get_object_terms"
"body":"_post_format_wp_get_object_terms( ${1:\\$terms} )"
"_post_states":
"prefix":"_post_states"
"body":"_post_states( ${1:\\$post} )"
"Store or return a list of post type meta caps for map_meta_cap().":
"prefix":"_post_type_meta_capabilities"
"body":"_post_type_meta_capabilities( ${1:\\$capabilities = null} )"
"Private function to modify the current stylesheet when previewing a theme":
"prefix":"_preview_theme_stylesheet_filter"
"body":"_preview_theme_stylesheet_filter()"
"Private function to modify the current template when previewing a theme":
"prefix":"_preview_theme_template_filter"
"body":"_preview_theme_template_filter()"
"Adds any comments from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_comment_caches"
"body":"_prime_comment_caches( ${1:\\$comment_ids}${2:, \\$update_meta_cache = true} )"
"Adds any networks from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_network_caches"
"body":"_prime_network_caches( ${1:\\$network_ids} )"
"Adds any posts from the given ids to the cache that do not already exist in cache":
"prefix":"_prime_post_caches"
"body":"_prime_post_caches( ${1:\\$ids}${2:, \\$update_term_cache = true}${3:, \\$update_meta_cache = true} )"
"Adds any sites from the given ids to the cache that do not already exist in cache.":
"prefix":"_prime_site_caches"
"body":"_prime_site_caches( ${1:\\$ids} )"
"Adds any terms from the given IDs to the cache that do not already exist in cache.":
"prefix":"_prime_term_caches"
"body":"_prime_term_caches( ${1:\\$term_ids}${2:, \\$update_meta_cache = true} )"
"Prints inline Emoji dection script":
"prefix":"_print_emoji_detection_script"
"body":"_print_emoji_detection_script()"
"Print scripts (internal use only)":
"prefix":"_print_scripts"
"body":"_print_scripts()"
"Print styles (internal use only)":
"prefix":"_print_styles"
"body":"_print_styles()"
"Hook to schedule pings and enclosures when a post is published.":
"prefix":"_publish_post_hook"
"body":"_publish_post_hook( ${1:\\$post_id} )"
"Redirect to the About WordPress page after a successful upgrade.":
"prefix":"_redirect_to_about_wordpress"
"body":"_redirect_to_about_wordpress( ${1:\\$new_version} )"
"Registers the form callback for a widget.":
"prefix":"_register_widget_form_callback"
"body":"_register_widget_form_callback( ${1:\\$id}${2:, \\$name}${3:, \\$form_callback}${4:, \\$options = array()} )"
"Registers the update callback for a widget.":
"prefix":"_register_widget_update_callback"
"body":"_register_widget_update_callback( ${1:\\$id_base}${2:, \\$update_callback}${3:, \\$options = array()} )"
"This was once used to move child posts to a new parent.":
"prefix":"_relocate_children"
"body":"_relocate_children( ${1:\\$old_ID}${2:, \\$new_ID} )"
"Removes arguments from a query string if they are not present in a URL
DO NOT use this in plugin code.":
"prefix":"_remove_qs_args_if_not_in_url"
"body":"_remove_qs_args_if_not_in_url( ${1:\\$query_string}${2:, \\$args_to_check}${3:, \\$url} )"
"Do not use. Removes theme support internally, ignorant of the blacklist.":
"prefix":"_remove_theme_support"
"body":"_remove_theme_support( ${1:\\$feature} )"
"Reset the page_on_front, show_on_front, and page_for_post settings when
a linked page is deleted or trashed.":
"prefix":"_reset_front_page_settings_for_post"
"body":"_reset_front_page_settings_for_post( ${1:\\$post_id} )"
"Retrieve":
"prefix":"_response_to_rss"
"body":"_response_to_rss( ${1:\\$resp} )"
"Returns an image resource. Internal use only.":
"prefix":"_rotate_image_resource"
"body":"_rotate_image_resource( ${1:\\$img}${2:, \\$angle} )"
"Internal helper function to sanitize a string from user input or from the db":
"prefix":"_sanitize_text_fields"
"body":"_sanitize_text_fields( ${1:\\$str}${2:, \\$keep_newlines = false} )"
"Callback formerly fired on the save_post hook. No longer needed.":
"prefix":"_save_post_hook"
"body":"_save_post_hook()"
"Kill WordPress execution.":
"prefix":"_scalar_wp_die_handler"
"body":"_scalar_wp_die_handler( ${1:\\$message = ''} )"
"Formerly used internally to tidy up the search terms.":
"prefix":"_search_terms_tidy"
"body":"_search_terms_tidy( ${1:\\$t} )"
"Updates the CRON option with the new CRON array.":
"prefix":"_set_cron_array"
"body":"_set_cron_array( ${1:\\$cron} )"
"Sets up the post object for preview based on the post autosave.":
"prefix":"_set_preview"
"body":"_set_preview( ${1:\\$post} )"
"Filters the latest content for preview from the post autosave.":
"prefix":"_show_post_preview"
"body":"_show_post_preview()"
"Callback to sort array by a 'name' key.":
"prefix":"_sort_name_callback"
"body":"_sort_name_callback()"
"Sort menu items by the desired key.":
"prefix":"_sort_nav_menu_items"
"body":"_sort_nav_menu_items( ${1:\\$a}${2:, \\$b} )"
"Callback to sort array by a 'Name' key.":
"prefix":"_sort_uname_callback"
"body":"_sort_uname_callback()"
"Create a new term for a term_taxonomy item that currently shares its term
with another term_taxonomy.":
"prefix":"_split_shared_term"
"body":"_split_shared_term( ${1:\\$term_id}${2:, \\$term_taxonomy_id}${3:, \\$record = true} )"
"Breaks a string into chunks by splitting at whitespace characters.":
"prefix":"_split_str_by_whitespace"
"body":"_split_str_by_whitespace( ${1:\\$string}${2:, \\$goal} )"
"Thickbox image paths for Network Admin.":
"prefix":"_thickbox_path_admin_subfolder"
"body":"_thickbox_path_admin_subfolder()"
"Hook for managing future post transitions to published.":
"prefix":"_transition_post_status"
"body":"_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Truncate a post slug.":
"prefix":"_truncate_post_slug"
"body":"_truncate_post_slug( ${1:\\$slug}${2:, \\$length = 200} )"
"This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the PclZip library.":
"prefix":"_unzip_file_pclzip"
"body":"_unzip_file_pclzip( ${1:\\$file}${2:, \\$to}${3:, \\$needed_dirs = array()} )"
"This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the ZipArchive class.":
"prefix":"_unzip_file_ziparchive"
"body":"_unzip_file_ziparchive( ${1:\\$file}${2:, \\$to}${3:, \\$needed_dirs = array()} )"
"Handler for updating the blog date when a published post is deleted.":
"prefix":"_update_blog_date_on_post_delete"
"body":"_update_blog_date_on_post_delete( ${1:\\$post_id} )"
"Handler for updating the blog date when a post is published or an already published post is changed.":
"prefix":"_update_blog_date_on_post_publish"
"body":"_update_blog_date_on_post_publish( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Will update term count based on number of objects.":
"prefix":"_update_generic_term_count"
"body":"_update_generic_term_count( ${1:\\$terms}${2:, \\$taxonomy} )"
"Will update term count based on object types of the current taxonomy.":
"prefix":"_update_post_term_count"
"body":"_update_post_term_count( ${1:\\$terms}${2:, \\$taxonomy} )"
"Handler for updating the blog posts count date when a post is deleted.":
"prefix":"_update_posts_count_on_delete"
"body":"_update_posts_count_on_delete( ${1:\\$post_id} )"
"Handler for updating the blog posts count date when a post status changes.":
"prefix":"_update_posts_count_on_transition_post_status"
"body":"_update_posts_count_on_transition_post_status( ${1:\\$new_status}${2:, \\$old_status} )"
"Update the custom taxonomies' term counts when a post's status is changed.":
"prefix":"_update_term_count_on_transition_post_status"
"body":"_update_term_count_on_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Recursively find Genericons example files in a given folder.":
"prefix":"_upgrade_422_find_genericons_files_in_folder"
"body":"_upgrade_422_find_genericons_files_in_folder( ${1:\\$directory} )"
"Cleans up Genericons example files.":
"prefix":"_upgrade_422_remove_genericons"
"body":"_upgrade_422_remove_genericons()"
"_upgrade_440_force_deactivate_incompatible_plugins":
"prefix":"_upgrade_440_force_deactivate_incompatible_plugins"
"body":"_upgrade_440_force_deactivate_incompatible_plugins()"
"Upgrade a Cron info array.":
"prefix":"_upgrade_cron_array"
"body":"_upgrade_cron_array( ${1:\\$cron} )"
"Sorts a multidimensional array by first member of each top level member":
"prefix":"_usort_by_first_member"
"body":"_usort_by_first_member( ${1:\\$a}${2:, \\$b} )"
"Sort categories by ID.":
"prefix":"_usort_terms_by_id"
"body":"_usort_terms_by_id( ${1:\\$a}${2:, \\$b} )"
"Sort categories by name.":
"prefix":"_usort_terms_by_name"
"body":"_usort_terms_by_name( ${1:\\$a}${2:, \\$b} )"
"The formatted output of a list of bookmarks.":
"prefix":"_walk_bookmarks"
"body":"_walk_bookmarks( ${1:\\$bookmarks}${2:, \\$args = ''} )"
"Helper function to add global attributes to a tag in the allowed html list.":
"prefix":"_wp_add_global_attributes"
"body":"_wp_add_global_attributes( ${1:\\$value} )"
"Instantiate the admin bar object and set it up as a global for access elsewhere.":
"prefix":"_wp_admin_bar_init"
"body":"_wp_admin_bar_init()"
"_wp_admin_html_begin":
"prefix":"_wp_admin_html_begin"
"body":"_wp_admin_html_begin()"
"Ajax handler for adding a hierarchical term.":
"prefix":"_wp_ajax_add_hierarchical_term"
"body":"_wp_ajax_add_hierarchical_term()"
"Sends back current comment total and new page links if they need to be updated.":
"prefix":"_wp_ajax_delete_comment_response"
"body":"_wp_ajax_delete_comment_response( ${1:\\$comment_id}${2:, \\$delta = -1} )"
"Prints the appropriate response to a menu quick search.":
"prefix":"_wp_ajax_menu_quick_search"
"body":"_wp_ajax_menu_quick_search( ${1:\\$request = array()} )"
"Automatically add newly published page objects to menus with that as an option.":
"prefix":"_wp_auto_add_pages_to_menu"
"body":"_wp_auto_add_pages_to_menu( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Splits a batch of shared taxonomy terms.":
"prefix":"_wp_batch_split_terms"
"body":"_wp_batch_split_terms()"
"Call the 'all' hook, which will process the functions hooked into it.":
"prefix":"_wp_call_all_hook"
"body":"_wp_call_all_hook( ${1:\\$args} )"
"Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.":
"prefix":"_wp_can_use_pcre_u"
"body":"_wp_can_use_pcre_u( ${1:\\$set = null} )"
"In order to avoid the _wp_batch_split_terms() job being accidentally removed,
check that it's still scheduled while we haven't finished splitting terms.":
"prefix":"_wp_check_for_scheduled_split_terms"
"body":"_wp_check_for_scheduled_split_terms()"
"Check default categories when a term gets split to see if any of them need to be updated.":
"prefix":"_wp_check_split_default_terms"
"body":"_wp_check_split_default_terms( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"If the term being split is a nav_menu, change associations.":
"prefix":"_wp_check_split_nav_menu_terms"
"body":"_wp_check_split_nav_menu_terms( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"Check menu items when a term gets split to see if any of them need to be updated.":
"prefix":"_wp_check_split_terms_in_menus"
"body":"_wp_check_split_terms_in_menus( ${1:\\$term_id}${2:, \\$new_term_id}${3:, \\$term_taxonomy_id}${4:, \\$taxonomy} )"
"Retrieve the link to a contributor's WordPress.org profile page.":
"prefix":"_wp_credits_add_profile_link"
"body":"_wp_credits_add_profile_link( ${1:\\$display_name}${2:, \\$username}${3:, \\$profiles} )"
"Retrieve the link to an external library used in WordPress.":
"prefix":"_wp_credits_build_object_link"
"body":"_wp_credits_build_object_link( ${1:\\$data} )"
"Filters changeset post data upon insert to ensure post_name is intact.":
"prefix":"_wp_customize_changeset_filter_insert_post_data"
"body":"_wp_customize_changeset_filter_insert_post_data( ${1:\\$post_data}${2:, \\$supplied_post_data} )"
"Includes and instantiates the WP_Customize_Manager class.":
"prefix":"_wp_customize_include"
"body":"_wp_customize_include()"
"Adds settings for the customize-loader script.":
"prefix":"_wp_customize_loader_settings"
"body":"_wp_customize_loader_settings()"
"Publish a snapshot's changes.":
"prefix":"_wp_customize_publish_changeset"
"body":"_wp_customize_publish_changeset( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$changeset_post} )"
"Outputs controls for the current dashboard widget.":
"prefix":"_wp_dashboard_control_callback"
"body":"_wp_dashboard_control_callback( ${1:\\$dashboard}${2:, \\$meta_box} )"
"Outputs a row for the Recent Comments widget.":
"prefix":"_wp_dashboard_recent_comments_row"
"body":"_wp_dashboard_recent_comments_row( ${1:\\$comment}${2:, \\$show_date = true} )"
"Delete auto-draft posts associated with the supplied changeset.":
"prefix":"_wp_delete_customize_changeset_dependent_auto_drafts"
"body":"_wp_delete_customize_changeset_dependent_auto_drafts( ${1:\\$post_id} )"
"Deletes orphaned draft menu items":
"prefix":"_wp_delete_orphaned_draft_menu_items"
"body":"_wp_delete_orphaned_draft_menu_items()"
"Callback for handling a menu item when its original object is deleted.":
"prefix":"_wp_delete_post_menu_item"
"body":"_wp_delete_post_menu_item( ${1:\\$object_id} )"
"Serves as a callback for handling a menu item when its original object is deleted.":
"prefix":"_wp_delete_tax_menu_item"
"body":"_wp_delete_tax_menu_item( ${1:\\$object_id}${2:, \\$tt_id}${3:, \\$taxonomy} )"
"If a JSON blob of navigation menu data is in POST data, expand it and inject
it into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.":
"prefix":"_wp_expand_nav_menu_post_data"
"body":"_wp_expand_nav_menu_post_data()"
"Build Unique ID for storage and retrieval.":
"prefix":"_wp_filter_build_unique_id"
"body":"_wp_filter_build_unique_id( ${1:\\$tag}${2:, \\$function}${3:, \\$priority} )"
"Filters the URL base for taxonomies.":
"prefix":"_wp_filter_taxonomy_base"
"body":"_wp_filter_taxonomy_base( ${1:\\$base} )"
"Private, for use in *_footer_scripts hooks":
"prefix":"_wp_footer_scripts"
"body":"_wp_footer_scripts()"
"Get the attachment path relative to the upload directory.":
"prefix":"_wp_get_attachment_relative_path"
"body":"_wp_get_attachment_relative_path( ${1:\\$file} )"
"Retrieves the current user object.":
"prefix":"_wp_get_current_user"
"body":"_wp_get_current_user()"
"Get the image size as array from its meta data.":
"prefix":"_wp_get_image_size_from_meta"
"body":"_wp_get_image_size_from_meta( ${1:\\$size_name}${2:, \\$image_meta} )"
"Gets the post revision version.":
"prefix":"_wp_get_post_revision_version"
"body":"_wp_get_post_revision_version( ${1:\\$revision} )"
"The old private function for setting up user contact methods.":
"prefix":"_wp_get_user_contactmethods"
"body":"_wp_get_user_contactmethods( ${1:\\$user = null} )"
"Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type,
and moving the file to the appropriate directory within the uploads directory.":
"prefix":"_wp_handle_upload"
"body":"_wp_handle_upload( ${1:\\$file}${2:, \\$overrides}${3:, \\$time}${4:, \\$action} )"
"Returns the initialized WP_Http Object":
"prefix":"_wp_http_get_object"
"body":"_wp_http_get_object()"
"Tests which editors are capable of supporting the request.":
"prefix":"_wp_image_editor_choose"
"body":"_wp_image_editor_choose( ${1:\\$args = array()} )"
"Helper function to convert hex encoded chars to ASCII":
"prefix":"_wp_iso_convert"
"body":"_wp_iso_convert( ${1:\\$match} )"
"Convert a string to UTF-8, so that it can be safely encoded to JSON.":
"prefix":"_wp_json_convert_string"
"body":"_wp_json_convert_string( ${1:\\$string} )"
"Prepares response data to be serialized to JSON.":
"prefix":"_wp_json_prepare_data"
"body":"_wp_json_prepare_data( ${1:\\$data} )"
"Perform sanity checks on data that shall be encoded to JSON.":
"prefix":"_wp_json_sanity_check"
"body":"_wp_json_sanity_check( ${1:\\$data}${2:, \\$depth} )"
"Make sure that auto-draft posts get their post_date bumped to prevent premature garbage-collection.":
"prefix":"_wp_keep_alive_customize_changeset_dependent_auto_drafts"
"body":"_wp_keep_alive_customize_changeset_dependent_auto_drafts( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Regex callback for wp_kses_decode_entities":
"prefix":"_wp_kses_decode_entities_chr"
"body":"_wp_kses_decode_entities_chr( ${1:\\$match} )"
"Regex callback for wp_kses_decode_entities()":
"prefix":"_wp_kses_decode_entities_chr_hexdec"
"body":"_wp_kses_decode_entities_chr_hexdec( ${1:\\$match} )"
"Callback for wp_kses_split.":
"prefix":"_wp_kses_split_callback"
"body":"_wp_kses_split_callback()"
"Helper function for wp_link_pages().":
"prefix":"_wp_link_page"
"body":"_wp_link_page( ${1:\\$i} )"
"Add the class property classes for the current context, if applicable.":
"prefix":"_wp_menu_item_classes_by_context"
"body":"_wp_menu_item_classes_by_context( ${1:\\$menu_items} )"
"Display menu.":
"prefix":"_wp_menu_output"
"body":"_wp_menu_output( ${1:\\$menu}${2:, \\$submenu}${3:, \\$submenu_as_parent = true} )"
"Return a MySQL expression for selecting the week number based on the start_of_week option.":
"prefix":"_wp_mysql_week"
"body":"_wp_mysql_week( ${1:\\$column} )"
"Adds custom arguments to some of the meta box object types.":
"prefix":"_wp_nav_menu_meta_box_object"
"body":"_wp_nav_menu_meta_box_object( ${1:\\$object = null} )"
"Serves as a callback for comparing objects based on count.":
"prefix":"_wp_object_count_sort_cb"
"body":"_wp_object_count_sort_cb( ${1:\\$a}${2:, \\$b} )"
"Serves as a callback for comparing objects based on name.":
"prefix":"_wp_object_name_sort_cb"
"body":"_wp_object_name_sort_cb( ${1:\\$a}${2:, \\$b} )"
"Returns the initialized WP_oEmbed object.":
"prefix":"_wp_oembed_get_object"
"body":"_wp_oembed_get_object()"
"Returns a post array ready to be inserted into the posts table as a post revision.":
"prefix":"_wp_post_revision_data"
"body":"_wp_post_revision_data( ${1:\\$post = array()}${2:, \\$autosave = false} )"
"Determines which fields of posts are to be saved in revisions.":
"prefix":"_wp_post_revision_fields"
"body":"_wp_post_revision_fields( ${1:\\$post = array()}${2:, \\$deprecated = false} )"
"Adds a 'wp-post-image' class to post thumbnails. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter"
"body":"_wp_post_thumbnail_class_filter( ${1:\\$attr} )"
"Adds '_wp_post_thumbnail_class_filter' callback to the 'wp_get_attachment_image_attributes'
filter hook. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter_add"
"body":"_wp_post_thumbnail_class_filter_add( ${1:\\$attr} )"
"Removes the '_wp_post_thumbnail_class_filter' callback from the 'wp_get_attachment_image_attributes'
filter hook. Internal use only.":
"prefix":"_wp_post_thumbnail_class_filter_remove"
"body":"_wp_post_thumbnail_class_filter_remove( ${1:\\$attr} )"
"Output HTML for the post thumbnail meta-box.":
"prefix":"_wp_post_thumbnail_html"
"body":"_wp_post_thumbnail_html( ${1:\\$thumbnail_id = null}${2:, \\$post = null} )"
"Output a notice when editing the page for posts (internal use only).":
"prefix":"_wp_posts_page_notice"
"body":"_wp_posts_page_notice()"
"Filters post thumbnail lookup to set the post thumbnail.":
"prefix":"_wp_preview_post_thumbnail_filter"
"body":"_wp_preview_post_thumbnail_filter( ${1:\\$value}${2:, \\$post_id}${3:, \\$meta_key} )"
"Filters terms lookup to set the post format.":
"prefix":"_wp_preview_terms_filter"
"body":"_wp_preview_terms_filter( ${1:\\$terms}${2:, \\$post_id}${3:, \\$taxonomy} )"
"Inserts post data into the posts table as a post revision.":
"prefix":"_wp_put_post_revision"
"body":"_wp_put_post_revision( ${1:\\$post = null}${2:, \\$autosave = false} )"
"Filter out `register_meta()` args based on a whitelist.":
"prefix":"_wp_register_meta_args_whitelist"
"body":"_wp_register_meta_args_whitelist( ${1:\\$args}${2:, \\$default_args} )"
"Return relative path to an uploaded file.":
"prefix":"_wp_relative_upload_path"
"body":"_wp_relative_upload_path( ${1:\\$path} )"
"Displays title tag with content.":
"prefix":"_wp_render_title_tag"
"body":"_wp_render_title_tag()"
"URL encode UTF-8 characters in a URL.":
"prefix":"_wp_sanitize_utf8_in_redirect"
"body":"_wp_sanitize_utf8_in_redirect( ${1:\\$matches} )"
"Helper function to output a _doing_it_wrong message when applicable.":
"prefix":"_wp_scripts_maybe_doing_it_wrong"
"body":"_wp_scripts_maybe_doing_it_wrong( ${1:\\$function} )"
"Handle sidebars config after theme change":
"prefix":"_wp_sidebars_changed"
"body":"_wp_sidebars_changed()"
"Converts a number of special characters into their HTML entities.":
"prefix":"_wp_specialchars"
"body":"_wp_specialchars( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES}${3:, \\$charset = false}${4:, \\$double_encode = false} )"
"Sort-helper for timezones.":
"prefix":"_wp_timezone_choice_usort_callback"
"body":"_wp_timezone_choice_usort_callback( ${1:\\$a}${2:, \\$b} )"
"Translate a PHP_URL_* constant to the named array keys PHP uses.":
"prefix":"_wp_translate_php_url_constant_to_key"
"body":"_wp_translate_php_url_constant_to_key( ${1:\\$constant} )"
"Rename $_POST data from form names to DB post columns.":
"prefix":"_wp_translate_postdata"
"body":"_wp_translate_postdata( ${1:\\$update = false}${2:, \\$post_data = null} )"
"Upgrade the revisions author, add the current post as a revision and set the revisions version to 1":
"prefix":"_wp_upgrade_revisions_of_post"
"body":"_wp_upgrade_revisions_of_post( ${1:\\$post}${2:, \\$revisions} )"
"A non-filtered, non-cached version of wp_upload_dir() that doesn't check the path.":
"prefix":"_wp_upload_dir"
"body":"_wp_upload_dir( ${1:\\$time = null} )"
"Search for disabled element tags. Push element to stack on tag open and pop
on tag close.":
"prefix":"_wptexturize_pushpop_element"
"body":"_wptexturize_pushpop_element( ${1:\\$text}${2:, \\$stack}${3:, \\$disabled_elements} )"
"Retrieve translated string with gettext context.":
"prefix":"_x"
"body":"_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Kill WordPress execution and display XML message with error message.":
"prefix":"_xmlrpc_wp_die_handler"
"body":"_xmlrpc_wp_die_handler( ${1:\\$message}${2:, \\$title = ''}${3:, \\$args = array()} )"
"Convert a value to non-negative integer.":
"prefix":"absint"
"body":"absint( ${1:\\$maybeint} )"
"Attempts activation of plugin in a "sandbox" and redirects on success.":
"prefix":"activate_plugin"
"body":"activate_plugin( ${1:\\$plugin}${2:, \\$redirect = ''}${3:, \\$network_wide = false}${4:, \\$silent = false} )"
"Activate multiple plugins.":
"prefix":"activate_plugins"
"body":"activate_plugins( ${1:\\$plugins}${2:, \\$redirect = ''}${3:, \\$network_wide = false}${4:, \\$silent = false} )"
"Deprecated functionality for activating a network-only plugin.":
"prefix":"activate_sitewide_plugin"
"body":"activate_sitewide_plugin()"
"Hooks a function on to a specific action.":
"prefix":"add_action"
"body":"add_action( ${1:\\$tag}${2:, \\$function_to_add}${3:, \\$priority = 10}${4:, \\$accepted_args = 1} )"
"Add a new option for a given blog id.":
"prefix":"add_blog_option"
"body":"add_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$value} )"
"Adds an index to a specified table.":
"prefix":"add_clean_index"
"body":"add_clean_index( ${1:\\$table}${2:, \\$index} )"
"Add meta data field to a comment.":
"prefix":"add_comment_meta"
"body":"add_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Add submenu page to the Comments main menu.":
"prefix":"add_comments_page"
"body":"add_comments_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add contextual help text for a page.":
"prefix":"add_contextual_help"
"body":"add_contextual_help( ${1:\\$screen}${2:, \\$help} )"
"add_cssclass":
"prefix":"add_cssclass"
"body":"add_cssclass( ${1:\\$add}${2:, \\$class} )"
"Add callbacks for background image display.":
"prefix":"add_custom_background"
"body":"add_custom_background( ${1:\\$wp_head_callback = ''}${2:, \\$admin_head_callback = ''}${3:, \\$admin_preview_callback = ''} )"
"Add callbacks for image header display.":
"prefix":"add_custom_image_header"
"body":"add_custom_image_header( ${1:\\$wp_head_callback}${2:, \\$admin_head_callback}${3:, \\$admin_preview_callback = ''} )"
"Add submenu page to the Dashboard main menu.":
"prefix":"add_dashboard_page"
"body":"add_dashboard_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add callback for custom TinyMCE editor stylesheets.":
"prefix":"add_editor_style"
"body":"add_editor_style( ${1:\\$stylesheet = 'editor-style.css'} )"
"Add a user to a blog based on details from maybe_add_existing_user_to_blog().":
"prefix":"add_existing_user_to_blog"
"body":"add_existing_user_to_blog( ${1:\\$details = false} )"
"Add a new feed type like /atom1/.":
"prefix":"add_feed"
"body":"add_feed( ${1:\\$feedname}${2:, \\$function} )"
"Hook a function or method to a specific filter action.":
"prefix":"add_filter"
"body":"add_filter( ${1:\\$tag}${2:, \\$function_to_add}${3:, \\$priority = 10}${4:, \\$accepted_args = 1} )"
"Register a new image size.":
"prefix":"add_image_size"
"body":"add_image_size( ${1:\\$name}${2:, \\$width}${3:, \\$height}${4:, \\$crop = false} )"
"Add a link to using values provided in $_POST.":
"prefix":"add_link"
"body":"add_link()"
"Add submenu page to the Links main menu.":
"prefix":"add_links_page"
"body":"add_links_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Walks the array while sanitizing the contents.":
"prefix":"add_magic_quotes"
"body":"add_magic_quotes( ${1:\\$array} )"
"Add submenu page to the Tools main menu.":
"prefix":"add_management_page"
"body":"add_management_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add submenu page to the Media main menu.":
"prefix":"add_media_page"
"body":"add_media_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"add_menu_classes":
"prefix":"add_menu_classes"
"body":"add_menu_classes( ${1:\\$menu} )"
"Add a top-level menu page.":
"prefix":"add_menu_page"
"body":"add_menu_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''}${7:, \\$position = null} )"
"Add post meta data defined in $_POST superglobal for post with given ID.":
"prefix":"add_meta"
"body":"add_meta( ${1:\\$post_ID} )"
"Adds a meta box to one or more screens.":
"prefix":"add_meta_box"
"body":"add_meta_box( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$screen = null}${5:, \\$context = 'advanced'}${6:, \\$priority = 'default'}${7:, \\$callback_args = null} )"
"Add metadata for the specified object.":
"prefix":"add_metadata"
"body":"add_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value}${5:, \\$unique = false} )"
"Add a new network option.":
"prefix":"add_network_option"
"body":"add_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$value} )"
"Adds a newly created user to the appropriate blog":
"prefix":"add_new_user_to_blog"
"body":"add_new_user_to_blog( ${1:\\$user_id}${2:, \\$password}${3:, \\$meta} )"
"Add a top-level menu page in the 'objects' section.":
"prefix":"add_object_page"
"body":"add_object_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''} )"
"Add a new option.":
"prefix":"add_option"
"body":"add_option( ${1:\\$option}${2:, \\$value = ''}${3:, \\$deprecated = ''}${4:, \\$autoload = 'yes'} )"
"Register a setting and its sanitization callback":
"prefix":"add_option_update_handler"
"body":"add_option_update_handler( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$sanitize_callback = ''} )"
"Adds an array of options to the options whitelist.":
"prefix":"add_option_whitelist"
"body":"add_option_whitelist( ${1:\\$new_options}${2:, \\$options = ''} )"
"Add submenu page to the Settings main menu.":
"prefix":"add_options_page"
"body":"add_options_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add submenu page to the Pages main menu.":
"prefix":"add_pages_page"
"body":"add_pages_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add permalink structure.":
"prefix":"add_permastruct"
"body":"add_permastruct( ${1:\\$name}${2:, \\$struct}${3:, \\$args = array()} )"
"Add a URL to those already pinged.":
"prefix":"add_ping"
"body":"add_ping( ${1:\\$post_id}${2:, \\$uri} )"
"Add submenu page to the Plugins main menu.":
"prefix":"add_plugins_page"
"body":"add_plugins_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add meta data field to a post.":
"prefix":"add_post_meta"
"body":"add_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Register support of certain features for a post type.":
"prefix":"add_post_type_support"
"body":"add_post_type_support( ${1:\\$post_type}${2:, \\$feature} )"
"Add submenu page to the Posts main menu.":
"prefix":"add_posts_page"
"body":"add_posts_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Retrieves a modified URL query string.":
"prefix":"add_query_arg"
"body":"add_query_arg( ${1:\\$key}${2:, \\$value}${3:, \\$url} )"
"Add an endpoint, like /trackback/.":
"prefix":"add_rewrite_endpoint"
"body":"add_rewrite_endpoint( ${1:\\$name}${2:, \\$places}${3:, \\$query_var = true} )"
"Adds a rewrite rule that transforms a URL structure to a set of query vars.":
"prefix":"add_rewrite_rule"
"body":"add_rewrite_rule( ${1:\\$regex}${2:, \\$query}${3:, \\$after = 'bottom'} )"
"Add a new rewrite tag (like %postname%).":
"prefix":"add_rewrite_tag"
"body":"add_rewrite_tag( ${1:\\$tag}${2:, \\$regex}${3:, \\$query = ''} )"
"Add role, if it does not exist.":
"prefix":"add_role"
"body":"add_role( ${1:\\$role}${2:, \\$display_name}${3:, \\$capabilities = array()} )"
"Register and configure an admin screen option":
"prefix":"add_screen_option"
"body":"add_screen_option( ${1:\\$option}${2:, \\$args = array()} )"
"Register a settings error to be displayed to the user":
"prefix":"add_settings_error"
"body":"add_settings_error( ${1:\\$setting}${2:, \\$code}${3:, \\$message}${4:, \\$type = 'error'} )"
"Add a new field to a section of a settings page":
"prefix":"add_settings_field"
"body":"add_settings_field( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$page}${5:, \\$section = 'default'}${6:, \\$args = array()} )"
"Add a new section to a settings page.":
"prefix":"add_settings_section"
"body":"add_settings_section( ${1:\\$id}${2:, \\$title}${3:, \\$callback}${4:, \\$page} )"
"Add hook for shortcode tag.":
"prefix":"add_shortcode"
"body":"add_shortcode( ${1:\\$tag}${2:, \\$func} )"
"Add a new option for the current network.":
"prefix":"add_site_option"
"body":"add_site_option( ${1:\\$option}${2:, \\$value} )"
"Add a submenu page.":
"prefix":"add_submenu_page"
"body":"add_submenu_page( ${1:\\$parent_slug}${2:, \\$page_title}${3:, \\$menu_title}${4:, \\$capability}${5:, \\$menu_slug}${6:, \\$function = ''} )"
"Adds metadata to a term.":
"prefix":"add_term_meta"
"body":"add_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Add submenu page to the Appearance main menu.":
"prefix":"add_theme_page"
"body":"add_theme_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Registers theme support for a given feature.":
"prefix":"add_theme_support"
"body":"add_theme_support( ${1:\\$feature}${2:, \\$args,...} )"
"Enqueues the default ThickBox js and css.":
"prefix":"add_thickbox"
"body":"add_thickbox()"
"Creates a new user from the "Users" form using $_POST information.":
"prefix":"add_user"
"body":"add_user()"
"Add meta data field to a user.":
"prefix":"add_user_meta"
"body":"add_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$unique = false} )"
"Adds a user to a blog.":
"prefix":"add_user_to_blog"
"body":"add_user_to_blog( ${1:\\$blog_id}${2:, \\$user_id}${3:, \\$role} )"
"Add submenu page to the Users/Profile main menu.":
"prefix":"add_users_page"
"body":"add_users_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''} )"
"Add a top-level menu page in the 'utility' section.":
"prefix":"add_utility_page"
"body":"add_utility_page( ${1:\\$page_title}${2:, \\$menu_title}${3:, \\$capability}${4:, \\$menu_slug}${5:, \\$function = ''}${6:, \\$icon_url = ''} )"
"Adds slashes to escape strings.":
"prefix":"addslashes_gpc"
"body":"addslashes_gpc( ${1:\\$gpc} )"
"Displays next or previous image link that has the same post parent.":
"prefix":"adjacent_image_link"
"body":"adjacent_image_link( ${1:\\$prev = true}${2:, \\$size = 'thumbnail'}${3:, \\$text = false} )"
"Displays the adjacent post link.":
"prefix":"adjacent_post_link"
"body":"adjacent_post_link( ${1:\\$format}${2:, \\$link}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$previous = true}${6:, \\$taxonomy = 'category'} )"
"Displays the relational links for the posts adjacent to the current post.":
"prefix":"adjacent_posts_rel_link"
"body":"adjacent_posts_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Displays relational links for the posts adjacent to the current post for single post pages.":
"prefix":"adjacent_posts_rel_link_wp_head"
"body":"adjacent_posts_rel_link_wp_head()"
"Display the default admin color scheme picker (Used in user-edit.php)":
"prefix":"admin_color_scheme_picker"
"body":"admin_color_scheme_picker( ${1:\\$user_id} )"
"admin_created_user_email":
"prefix":"admin_created_user_email"
"body":"admin_created_user_email( ${1:\\$text} )"
"Retrieves the URL to the admin area for the current site.":
"prefix":"admin_url"
"body":"admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Allow subdirectory install.":
"prefix":"allow_subdirectory_install"
"body":"allow_subdirectory_install()"
"Allow subdomain install":
"prefix":"allow_subdomain_install"
"body":"allow_subdomain_install()"
"Whitelists allowed redirect hosts for safe HTTP requests as well.":
"prefix":"allowed_http_request_hosts"
"body":"allowed_http_request_hosts( ${1:\\$is_external}${2:, \\$host} )"
"Display all of the allowed tags in HTML format with attributes.":
"prefix":"allowed_tags"
"body":"allowed_tags()"
"Converts email addresses characters to HTML entities to block spam bots.":
"prefix":"antispambot"
"body":"antispambot( ${1:\\$email_address}${2:, \\$hex_encoding} )"
"Does the specified module exist in the Apache config?":
"prefix":"apache_mod_loaded"
"body":"apache_mod_loaded( ${1:\\$mod}${2:, \\$default = false} )"
"Call the functions added to a filter hook.":
"prefix":"apply_filters"
"body":"apply_filters( ${1:\\$tag}${2:, \\$value}${3:, \\$var,...} )"
"Fires functions attached to a deprecated filter hook.":
"prefix":"apply_filters_deprecated"
"body":"apply_filters_deprecated( ${1:\\$tag}${2:, \\$args}${3:, \\$version}${4:, \\$replacement = false}${5:, \\$message = null} )"
"Execute functions hooked on a specific filter hook, specifying arguments in an array.":
"prefix":"apply_filters_ref_array"
"body":"apply_filters_ref_array( ${1:\\$tag}${2:, \\$args} )"
"PHP-agnostic version of {@link array_replace_recursive()}.":
"prefix":"array_replace_recursive"
"body":"array_replace_recursive( ${1:\\$base = array()}${2:, \\$replacements = array()} )"
"Display the atom enclosure for the current post.":
"prefix":"atom_enclosure"
"body":"atom_enclosure()"
"Displays Site Icon in atom feeds.":
"prefix":"atom_site_icon"
"body":"atom_site_icon()"
"Display fields for ID3 data":
"prefix":"attachment_id3_data_meta_box"
"body":"attachment_id3_data_meta_box( ${1:\\$post} )"
"Display attachment submit form fields.":
"prefix":"attachment_submit_meta_box"
"body":"attachment_submit_meta_box( ${1:\\$post} )"
"Displays non-editable attachment metadata in the publish meta box.":
"prefix":"attachment_submitbox_metadata"
"body":"attachment_submitbox_metadata()"
"Tries to convert an attachment URL into a post ID.":
"prefix":"attachment_url_to_postid"
"body":"attachment_url_to_postid( ${1:\\$url} )"
"Escaping for HTML attributes":
"prefix":"attribute_escape"
"body":"attribute_escape( ${1:\\$text} )"
"Checks if a user is logged in, if not it redirects them to the login page.":
"prefix":"auth_redirect"
"body":"auth_redirect()"
"Whether author of supplied post has capability or role.":
"prefix":"author_can"
"body":"author_can( ${1:\\$post}${2:, \\$capability} )"
"Enable/disable automatic general feed link outputting.":
"prefix":"automatic_feed_links"
"body":"automatic_feed_links( ${1:\\$add = true} )"
"Avoids a collision between a site slug and a permalink slug.":
"prefix":"avoid_blog_page_permalink_collision"
"body":"avoid_blog_page_permalink_collision( ${1:\\$data}${2:, \\$postarr} )"
"Display background color value.":
"prefix":"background_color"
"body":"background_color()"
"Display background image path.":
"prefix":"background_image"
"body":"background_image()"
"Adds backslashes before letters and before a number at the start of a string.":
"prefix":"backslashit"
"body":"backslashit( ${1:\\$string} )"
"Balances tags if forced to, or if the 'use_balanceTags' option is set to true.":
"prefix":"balancetags"
"body":"balancetags( ${1:\\$text}${2:, \\$force = false} )"
"Remove last item on a pipe-delimited string.":
"prefix":"before_last_bar"
"body":"before_last_bar( ${1:\\$string} )"
"Displays information about the current site.":
"prefix":"bloginfo"
"body":"bloginfo( ${1:\\$show = ''} )"
"Display RSS container for the bloginfo function.":
"prefix":"bloginfo_rss"
"body":"bloginfo_rss( ${1:\\$show = ''} )"
"Display the classes for the body element.":
"prefix":"body_class"
"body":"body_class( ${1:\\$class = ''} )"
"Whether input is yes or no.":
"prefix":"bool_from_yn"
"body":"bool_from_yn( ${1:\\$yn} )"
"Build URL query based on an associative and, or indexed array.":
"prefix":"build_query"
"body":"build_query( ${1:\\$data} )"
"Process the post data for the bulk editing of posts.":
"prefix":"bulk_edit_posts"
"body":"bulk_edit_posts( ${1:\\$post_data = null} )"
"Set the headers for caching for 10 days with JavaScript content type.":
"prefix":"cache_javascript_headers"
"body":"cache_javascript_headers()"
"Retrieve info for user lists to prevent multiple queries by get_userdata()":
"prefix":"cache_users"
"body":"cache_users( ${1:\\$user_ids} )"
"Get number of days since the start of the week.":
"prefix":"calendar_week_mod"
"body":"calendar_week_mod( ${1:\\$num} )"
"Whether or not we can edit this network from this page.":
"prefix":"can_edit_network"
"body":"can_edit_network( ${1:\\$site_id} )"
"Display HTML content for cancel comment reply link.":
"prefix":"cancel_comment_reply_link"
"body":"cancel_comment_reply_link( ${1:\\$text = ''} )"
"Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).":
"prefix":"capital_p_dangit"
"body":"capital_p_dangit( ${1:\\$text} )"
"Check if a category is an ancestor of another category.":
"prefix":"cat_is_ancestor_of"
"body":"cat_is_ancestor_of( ${1:\\$cat1}${2:, \\$cat2} )"
"Retrieve category description.":
"prefix":"category_description"
"body":"category_description( ${1:\\$category} )"
"Check whether a category exists.":
"prefix":"category_exists"
"body":"category_exists( ${1:\\$cat_name}${2:, \\$parent = null} )"
"Makes sure that a user was referred from another admin page.":
"prefix":"check_admin_referer"
"body":"check_admin_referer( ${1:\\$action = -1}${2:, \\$query_arg = '_wpnonce'} )"
"Verifies the Ajax request to prevent processing requests external of the blog.":
"prefix":"check_ajax_referer"
"body":"check_ajax_referer( ${1:\\$action = -1}${2:, \\$query_arg = false}${3:, \\$die = true} )"
"Publish future post and make sure post ID has future post status.":
"prefix":"check_and_publish_future_post"
"body":"check_and_publish_future_post( ${1:\\$post_id} )"
"Check column matches criteria.":
"prefix":"check_column"
"body":"check_column( ${1:\\$table_name}${2:, \\$col_name}${3:, \\$col_type}${4:, \\$is_null = null}${5:, \\$key = null}${6:, \\$default = null}${7:, \\$extra = null} )"
"Check whether a comment passes internal checks to be allowed to add.":
"prefix":"check_comment"
"body":"check_comment( ${1:\\$author}${2:, \\$email}${3:, \\$url}${4:, \\$comment}${5:, \\$user_ip}${6:, \\$user_agent}${7:, \\$comment_type} )"
"Hooks WP's native database-based comment-flood check.":
"prefix":"check_comment_flood_db"
"body":"check_comment_flood_db()"
"Checks if the current user has permissions to import new users.":
"prefix":"check_import_new_users"
"body":"check_import_new_users( ${1:\\$permission} )"
"Retrieves a user row based on password reset key and login":
"prefix":"check_password_reset_key"
"body":"check_password_reset_key( ${1:\\$key}${2:, \\$login} )"
"Checks if a theme has been changed and runs 'after_switch_theme' hook on the next WP load.":
"prefix":"check_theme_switched"
"body":"check_theme_switched()"
"Check an array of MIME types against a whitelist.":
"prefix":"check_upload_mimes"
"body":"check_upload_mimes( ${1:\\$mimes} )"
"Determine if uploaded file exceeds space quota.":
"prefix":"check_upload_size"
"body":"check_upload_size( ${1:\\$file} )"
"Outputs the html checked attribute.":
"prefix":"checked"
"body":"checked( ${1:\\$checked}${2:, \\$current = true}${3:, \\$echo = true} )"
"Handles the display of choosing a user's primary site.":
"prefix":"choose_primary_blog"
"body":"choose_primary_blog()"
"Will clean the attachment in the cache.":
"prefix":"clean_attachment_cache"
"body":"clean_attachment_cache( ${1:\\$id}${2:, \\$clean_terms = false} )"
"Clean the blog cache":
"prefix":"clean_blog_cache"
"body":"clean_blog_cache( ${1:\\$blog} )"
"Deletes the bookmark cache.":
"prefix":"clean_bookmark_cache"
"body":"clean_bookmark_cache( ${1:\\$bookmark_id} )"
"Remove the category cache data based on ID.":
"prefix":"clean_category_cache"
"body":"clean_category_cache( ${1:\\$id} )"
"Removes a comment from the object cache.":
"prefix":"clean_comment_cache"
"body":"clean_comment_cache( ${1:\\$ids} )"
"Removes a network from the object cache.":
"prefix":"clean_network_cache"
"body":"clean_network_cache( ${1:\\$ids} )"
"Removes the taxonomy relationship to terms from the cache.":
"prefix":"clean_object_term_cache"
"body":"clean_object_term_cache( ${1:\\$object_ids}${2:, \\$object_type} )"
"Will clean the page in the cache.":
"prefix":"clean_page_cache"
"body":"clean_page_cache( ${1:\\$id} )"
"Will clean the post in the cache.":
"prefix":"clean_post_cache"
"body":"clean_post_cache( ${1:\\$post} )"
"Accepts matches array from preg_replace_callback in wpautop() or a string.":
"prefix":"clean_pre"
"body":"clean_pre( ${1:\\$matches} )"
"Cleans the site details cache for a site.":
"prefix":"clean_site_details_cache"
"body":"clean_site_details_cache( ${1:\\$site_id} )"
"Clean the caches for a taxonomy.":
"prefix":"clean_taxonomy_cache"
"body":"clean_taxonomy_cache( ${1:\\$taxonomy} )"
"Will remove all of the term ids from the cache.":
"prefix":"clean_term_cache"
"body":"clean_term_cache( ${1:\\$ids}${2:, \\$taxonomy = ''}${3:, \\$clean_taxonomy = true} )"
"Checks and cleans a URLr":
"prefix":"clean_url"
"body":"clean_url( ${1:\\$url}${2:, \\$protocols = null}${3:, \\$context = 'display'} )"
"Clean all user caches":
"prefix":"clean_user_cache"
"body":"clean_user_cache( ${1:\\$user} )"
"Deprecated functionality to clear the global post cache.":
"prefix":"clear_global_post_cache"
"body":"clear_global_post_cache( ${1:\\$post_id} )"
"Adds JavaScript required to make CodePress work on the theme/plugin editors.":
"prefix":"codepress_footer_js"
"body":"codepress_footer_js()"
"Determines the language to use for CodePress syntax highlighting.":
"prefix":"codepress_get_lang"
"body":"codepress_get_lang( ${1:\\$filename} )"
"Displays the author of the current comment.":
"prefix":"comment_author"
"body":"comment_author( ${1:\\$comment_ID} )"
"Display the email of the author of the current global $comment.":
"prefix":"comment_author_email"
"body":"comment_author_email( ${1:\\$comment_ID} )"
"Display the html email link to the author of the current comment.":
"prefix":"comment_author_email_link"
"body":"comment_author_email_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment = null} )"
"Display the IP address of the author of the current comment.":
"prefix":"comment_author_ip"
"body":"comment_author_ip( ${1:\\$comment_ID} )"
"Display the html link to the url of the author of the current comment.":
"prefix":"comment_author_link"
"body":"comment_author_link( ${1:\\$comment_ID} )"
"Display the current comment author in the feed.":
"prefix":"comment_author_rss"
"body":"comment_author_rss()"
"Display the url of the author of the current comment.":
"prefix":"comment_author_url"
"body":"comment_author_url( ${1:\\$comment_ID} )"
"Displays the HTML link of the url of the author of the current comment.":
"prefix":"comment_author_url_link"
"body":"comment_author_url_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment} )"
"Generates semantic classes for each comment element.":
"prefix":"comment_class"
"body":"comment_class( ${1:\\$class = ''}${2:, \\$comment = null}${3:, \\$post_id = null}${4:, \\$echo = true} )"
"Display the comment date of the current comment.":
"prefix":"comment_date"
"body":"comment_date( ${1:\\$d = ''}${2:, \\$comment_ID} )"
"Display the excerpt of the current comment.":
"prefix":"comment_excerpt"
"body":"comment_excerpt( ${1:\\$comment_ID} )"
"Determine if a comment exists based on author and date.":
"prefix":"comment_exists"
"body":"comment_exists( ${1:\\$comment_author}${2:, \\$comment_date}${3:, \\$timezone = 'blog'} )"
"Display error message at bottom of comments.":
"prefix":"comment_footer_die"
"body":"comment_footer_die( ${1:\\$msg} )"
"Outputs a complete commenting form for use within a template.":
"prefix":"comment_form"
"body":"comment_form( ${1:\\$args = array()}${2:, \\$post_id = null} )"
"Display text based on comment reply status.":
"prefix":"comment_form_title"
"body":"comment_form_title( ${1:\\$noreplytext = false}${2:, \\$replytext = false}${3:, \\$linktoparent = true} )"
"Display the feed GUID for the current comment.":
"prefix":"comment_guid"
"body":"comment_guid( ${1:\\$comment_id = null} )"
"Display the comment id of the current comment.":
"prefix":"comment_id"
"body":"comment_id()"
"Output hidden input HTML for replying to comments.":
"prefix":"comment_id_fields"
"body":"comment_id_fields( ${1:\\$id} )"
"Display the link to the comments.":
"prefix":"comment_link"
"body":"comment_link( ${1:\\$comment = null} )"
"Displays the HTML content for reply to comment link.":
"prefix":"comment_reply_link"
"body":"comment_reply_link( ${1:\\$args = array()}${2:, \\$comment = null}${3:, \\$post = null} )"
"Display the text of the current comment.":
"prefix":"comment_text"
"body":"comment_text( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Display the current comment content for use in the feeds.":
"prefix":"comment_text_rss"
"body":"comment_text_rss()"
"Display the comment time of the current comment.":
"prefix":"comment_time"
"body":"comment_time( ${1:\\$d = ''} )"
"Display the comment type of the current comment.":
"prefix":"comment_type"
"body":"comment_type( ${1:\\$commenttxt = false}${2:, \\$trackbacktxt = false}${3:, \\$pingbacktxt = false} )"
"Display the link to the current post comments.":
"prefix":"comments_link"
"body":"comments_link( ${1:\\$deprecated = ''}${2:, \\$deprecated_2 = ''} )"
"Outputs the link to the comments for the current post in an xml safe way":
"prefix":"comments_link_feed"
"body":"comments_link_feed()"
"Display the language string for the number of comments the current post has.":
"prefix":"comments_number"
"body":"comments_number( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false}${4:, \\$deprecated = ''} )"
"Whether the current post is open for comments.":
"prefix":"comments_open"
"body":"comments_open( ${1:\\$post_id = null} )"
"Displays the link to the comments for the current post ID.":
"prefix":"comments_popup_link"
"body":"comments_popup_link( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false}${4:, \\$css_class = ''}${5:, \\$none = false} )"
"Display the JS popup script to show a comment.":
"prefix":"comments_popup_script"
"body":"comments_popup_script()"
"Return link to the post RSS feed.":
"prefix":"comments_rss"
"body":"comments_rss()"
"Print RSS comment feed link.":
"prefix":"comments_rss_link"
"body":"comments_rss_link( ${1:\\$link_text = 'Comments RSS'} )"
"Load the comment template specified in $file.":
"prefix":"comments_template"
"body":"comments_template( ${1:\\$file = '/comments.php'}${2:, \\$separate_comments = false} )"
"Test support for compressing JavaScript from PHP":
"prefix":"compression_test"
"body":"compression_test()"
"Confirm a new site signup.":
"prefix":"confirm_another_blog_signup"
"body":"confirm_another_blog_signup( ${1:\\$domain}${2:, \\$path}${3:, \\$blog_title}${4:, \\$user_name}${5:, \\$user_email = ''}${6:, \\$meta = array()}${7:, \\$blog_id} )"
"New site signup confirmation":
"prefix":"confirm_blog_signup"
"body":"confirm_blog_signup( ${1:\\$domain}${2:, \\$path}${3:, \\$blog_title}${4:, \\$user_name = ''}${5:, \\$user_email = ''}${6:, \\$meta = array()} )"
"confirm_delete_users":
"prefix":"confirm_delete_users"
"body":"confirm_delete_users( ${1:\\$users} )"
"New user signup confirmation":
"prefix":"confirm_user_signup"
"body":"confirm_user_signup( ${1:\\$user_name}${2:, \\$user_email} )"
"Retrieves the URL to the content directory.":
"prefix":"content_url"
"body":"content_url( ${1:\\$path = ''} )"
"Converts lone & characters into `&#038;` (a.k.a. `&amp;`)":
"prefix":"convert_chars"
"body":"convert_chars( ${1:\\$content}${2:, \\$deprecated = ''} )"
"Converts invalid Unicode references range to valid range.":
"prefix":"convert_invalid_entities"
"body":"convert_invalid_entities( ${1:\\$content} )"
"Convert text equivalent of smilies to images.":
"prefix":"convert_smilies"
"body":"convert_smilies( ${1:\\$text} )"
"Convert a screen string to a screen object":
"prefix":"convert_to_screen"
"body":"convert_to_screen( ${1:\\$hook_name} )"
"Copies a directory from one location to another via the WordPress Filesystem Abstraction.":
"prefix":"copy_dir"
"body":"copy_dir( ${1:\\$from}${2:, \\$to}${3:, \\$skip_list = array()} )"
"core_update_footer":
"prefix":"core_update_footer"
"body":"core_update_footer( ${1:\\$msg = ''} )"
"Display upgrade WordPress for downloading latest or upgrading automatically form.":
"prefix":"core_upgrade_preamble"
"body":"core_upgrade_preamble()"
"Number of posts written by a list of users.":
"prefix":"count_many_users_posts"
"body":"count_many_users_posts( ${1:\\$users}${2:, \\$post_type = 'post'}${3:, \\$public_only = false} )"
"Number of posts user has written.":
"prefix":"count_user_posts"
"body":"count_user_posts( ${1:\\$userid}${2:, \\$post_type = 'post'}${3:, \\$public_only = false} )"
"Count number of users who have each of the user roles.":
"prefix":"count_users"
"body":"count_users( ${1:\\$strategy = 'time'} )"
"Create an empty blog.":
"prefix":"create_empty_blog"
"body":"create_empty_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$weblog_title}${4:, \\$site_id = 1} )"
"Creates the initial post types when 'init' action is fired.":
"prefix":"create_initial_post_types"
"body":"create_initial_post_types()"
"Registers default REST API routes.":
"prefix":"create_initial_rest_routes"
"body":"create_initial_rest_routes()"
"Creates the initial taxonomies.":
"prefix":"create_initial_taxonomies"
"body":"create_initial_taxonomies()"
"An alias of wp_create_user().":
"prefix":"create_user"
"body":"create_user( ${1:\\$username}${2:, \\$password}${3:, \\$email} )"
"Retrieve the name of the current action.":
"prefix":"current_action"
"body":"current_action()"
"Retrieve the name of the current filter or action.":
"prefix":"current_filter"
"body":"current_filter()"
"Retrieves information on the current active theme.":
"prefix":"current_theme_info"
"body":"current_theme_info()"
"Checks a theme's support for a given feature":
"prefix":"current_theme_supports"
"body":"current_theme_supports( ${1:\\$feature} )"
"Retrieve the current time based on specified type.":
"prefix":"current_time"
"body":"current_time( ${1:\\$type}${2:, \\$gmt} )"
"Whether the current user has a specific capability.":
"prefix":"current_user_can"
"body":"current_user_can( ${1:\\$capability}${2:, \\$object_id} )"
"Whether current user has a capability or role for a given site.":
"prefix":"current_user_can_for_blog"
"body":"current_user_can_for_blog( ${1:\\$blog_id}${2:, \\$capability} )"
"Print JS templates for the theme-browsing UI in the Customizer.":
"prefix":"customize_themes_print_templates"
"body":"customize_themes_print_templates()"
"dashboard_browser_nag_class":
"prefix":"dashboard_browser_nag_class"
"body":"dashboard_browser_nag_class( ${1:\\$classes} )"
"Retrieve the date in localized format, based on timestamp.":
"prefix":"date_i18n"
"body":"date_i18n( ${1:\\$dateformatstring}${2:, \\$unixtimestamp = false}${3:, \\$gmt = false} )"
"Modifies the database based on specified SQL statements.":
"prefix":"dbdelta"
"body":"dbdelta( ${1:\\$queries = ''}${2:, \\$execute = true} )"
"Deactivate a single plugin or multiple plugins.":
"prefix":"deactivate_plugins"
"body":"deactivate_plugins( ${1:\\$plugins}${2:, \\$silent = false}${3:, \\$network_wide = null} )"
"Deprecated functionality for deactivating a network-only plugin.":
"prefix":"deactivate_sitewide_plugin"
"body":"deactivate_sitewide_plugin()"
"Load custom DB error or display WordPress DB error.":
"prefix":"dead_db"
"body":"dead_db()"
"Close the debugging file handle.":
"prefix":"debug_fclose"
"body":"debug_fclose( ${1:\\$fp} )"
"Open the file handle for debugging.":
"prefix":"debug_fopen"
"body":"debug_fopen( ${1:\\$filename}${2:, \\$mode} )"
"Write contents to the file used for debugging.":
"prefix":"debug_fwrite"
"body":"debug_fwrite( ${1:\\$fp}${2:, \\$string} )"
"default_password_nag":
"prefix":"default_password_nag"
"body":"default_password_nag()"
"default_password_nag_edit_user":
"prefix":"default_password_nag_edit_user"
"body":"default_password_nag_edit_user( ${1:\\$user_ID}${2:, \\$old_data} )"
"default_password_nag_handler":
"prefix":"default_password_nag_handler"
"body":"default_password_nag_handler( ${1:\\$errors = false} )"
"Default topic count scaling for tag links.":
"prefix":"default_topic_count_scale"
"body":"default_topic_count_scale( ${1:\\$count} )"
"Old callback for tag link tooltips.":
"prefix":"default_topic_count_text"
"body":"default_topic_count_text( ${1:\\$count} )"
"Delete the user settings of the current user.":
"prefix":"delete_all_user_settings"
"body":"delete_all_user_settings()"
"Removes option by name for a given blog id. Prevents removal of protected WordPress options.":
"prefix":"delete_blog_option"
"body":"delete_blog_option( ${1:\\$id}${2:, \\$option} )"
"Remove metadata matching criteria from a comment.":
"prefix":"delete_comment_meta"
"body":"delete_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Purge the cached results of get_calendar.":
"prefix":"delete_get_calendar_cache"
"body":"delete_get_calendar_cache()"
"Delete post meta data by meta ID.":
"prefix":"delete_meta"
"body":"delete_meta( ${1:\\$mid} )"
"Delete metadata for the specified object.":
"prefix":"delete_metadata"
"body":"delete_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value = ''}${5:, \\$delete_all = false} )"
"Delete meta data by meta ID":
"prefix":"delete_metadata_by_mid"
"body":"delete_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id} )"
"Removes a network option by name.":
"prefix":"delete_network_option"
"body":"delete_network_option( ${1:\\$network_id}${2:, \\$option} )"
"Removes option by name. Prevents removal of protected WordPress options.":
"prefix":"delete_option"
"body":"delete_option( ${1:\\$option} )"
"Remove directory and files of a plugin for a list of plugins.":
"prefix":"delete_plugins"
"body":"delete_plugins( ${1:\\$plugins}${2:, \\$deprecated = ''} )"
"Remove metadata matching criteria from a post.":
"prefix":"delete_post_meta"
"body":"delete_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Delete everything from post meta matching meta key.":
"prefix":"delete_post_meta_by_key"
"body":"delete_post_meta_by_key( ${1:\\$post_meta_key} )"
"Remove a post thumbnail.":
"prefix":"delete_post_thumbnail"
"body":"delete_post_thumbnail( ${1:\\$post} )"
"Removes a option by name for the current network.":
"prefix":"delete_site_option"
"body":"delete_site_option( ${1:\\$option} )"
"Delete a site transient.":
"prefix":"delete_site_transient"
"body":"delete_site_transient( ${1:\\$transient} )"
"Removes metadata matching criteria from a term.":
"prefix":"delete_term_meta"
"body":"delete_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Remove a theme":
"prefix":"delete_theme"
"body":"delete_theme( ${1:\\$stylesheet}${2:, \\$redirect = ''} )"
"Delete a transient.":
"prefix":"delete_transient"
"body":"delete_transient( ${1:\\$transient} )"
"Remove metadata matching criteria from a user.":
"prefix":"delete_user_meta"
"body":"delete_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"Delete user option with global blog capability.":
"prefix":"delete_user_option"
"body":"delete_user_option( ${1:\\$user_id}${2:, \\$option_name}${3:, \\$global = false} )"
"Delete user interface settings.":
"prefix":"delete_user_setting"
"body":"delete_user_setting( ${1:\\$names} )"
"Remove user meta data.":
"prefix":"delete_usermeta"
"body":"delete_usermeta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value = ''} )"
"delete_users_add_js":
"prefix":"delete_users_add_js"
"body":"delete_users_add_js()"
"Filters for content to remove unnecessary slashes.":
"prefix":"deslash"
"body":"deslash( ${1:\\$content} )"
"Retrieve the number of times an action is fired.":
"prefix":"did_action"
"body":"did_action( ${1:\\$tag} )"
"Outputs the html disabled attribute.":
"prefix":"disabled"
"body":"disabled( ${1:\\$disabled}${2:, \\$current = true}${3:, \\$echo = true} )"
"Finds a pingback server URI based on the given URL.":
"prefix":"discover_pingback_server_uri"
"body":"discover_pingback_server_uri( ${1:\\$url}${2:, \\$deprecated = ''} )"
"dismiss_core_update":
"prefix":"dismiss_core_update"
"body":"dismiss_core_update( ${1:\\$update} )"
"dismissed_updates":
"prefix":"dismissed_updates"
"body":"dismissed_updates()"
"Display install header.":
"prefix":"display_header"
"body":"display_header( ${1:\\$body_classes = ''} )"
"Whether to display the header text.":
"prefix":"display_header_text"
"body":"display_header_text()"
"Display plugin content based on plugin list.":
"prefix":"display_plugins_table"
"body":"display_plugins_table()"
"Display installer setup form.":
"prefix":"display_setup_form"
"body":"display_setup_form( ${1:\\$error = null} )"
"Displays the amount of disk space used by the current site. Not used in core.":
"prefix":"display_space_usage"
"body":"display_space_usage()"
"Prints a theme on the Install Themes pages.":
"prefix":"display_theme"
"body":"display_theme( ${1:\\$theme} )"
"Display theme content based on theme list.":
"prefix":"display_themes"
"body":"display_themes()"
"Meta Box Accordion Template Function":
"prefix":"do_accordion_sections"
"body":"do_accordion_sections( ${1:\\$screen}${2:, \\$context}${3:, \\$object} )"
"Execute functions hooked on a specific action hook.":
"prefix":"do_action"
"body":"do_action( ${1:\\$tag}${2:, \\$arg,... = ''} )"
"Fires functions attached to a deprecated action hook.":
"prefix":"do_action_deprecated"
"body":"do_action_deprecated( ${1:\\$tag}${2:, \\$args}${3:, \\$version}${4:, \\$replacement = false}${5:, \\$message = null} )"
"Execute functions hooked on a specific action hook, specifying arguments in an array.":
"prefix":"do_action_ref_array"
"body":"do_action_ref_array( ${1:\\$tag}${2:, \\$args} )"
"Adds an action hook specific to this page.":
"prefix":"do_activate_header"
"body":"do_activate_header()"
"Perform all pingbacks, enclosures, trackbacks, and send to pingback services.":
"prefix":"do_all_pings"
"body":"do_all_pings()"
"Upgrade WordPress core display.":
"prefix":"do_core_upgrade"
"body":"do_core_upgrade( ${1:\\$reinstall = false} )"
"do_dismiss_core_update":
"prefix":"do_dismiss_core_update"
"body":"do_dismiss_core_update()"
"Check content for video and audio links to add as enclosures.":
"prefix":"do_enclose"
"body":"do_enclose( ${1:\\$content}${2:, \\$post_ID} )"
"Load the feed template from the use of an action hook.":
"prefix":"do_feed"
"body":"do_feed()"
"Load either Atom comment feed or Atom posts feed.":
"prefix":"do_feed_atom"
"body":"do_feed_atom( ${1:\\$for_comments} )"
"Load the RDF RSS 0.91 Feed template.":
"prefix":"do_feed_rdf"
"body":"do_feed_rdf()"
"Load the RSS 1.0 Feed Template.":
"prefix":"do_feed_rss"
"body":"do_feed_rss()"
"Load either the RSS2 comment feed or the RSS2 posts feed.":
"prefix":"do_feed_rss2"
"body":"do_feed_rss2( ${1:\\$for_comments} )"
"Meta-Box template function":
"prefix":"do_meta_boxes"
"body":"do_meta_boxes( ${1:\\$screen}${2:, \\$context}${3:, \\$object} )"
"Display the robots.txt file content.":
"prefix":"do_robots"
"body":"do_robots()"
"Print out the settings fields for a particular settings section":
"prefix":"do_settings_fields"
"body":"do_settings_fields( ${1:\\$page}${2:, \\$section} )"
"Prints out all settings sections added to a particular settings page":
"prefix":"do_settings_sections"
"body":"do_settings_sections( ${1:\\$page} )"
"Search content for shortcodes and filter shortcodes through their hooks.":
"prefix":"do_shortcode"
"body":"do_shortcode( ${1:\\$content}${2:, \\$ignore_html = false} )"
"Regular Expression callable for do_shortcode() for calling shortcode hook.":
"prefix":"do_shortcode_tag"
"body":"do_shortcode_tag( ${1:\\$m} )"
"Search only inside HTML elements for shortcodes and process them.":
"prefix":"do_shortcodes_in_html_tags"
"body":"do_shortcodes_in_html_tags( ${1:\\$content}${2:, \\$ignore_html}${3:, \\$tagnames} )"
"Prints signup_header via wp_head":
"prefix":"do_signup_header"
"body":"do_signup_header()"
"Perform trackbacks.":
"prefix":"do_trackbacks"
"body":"do_trackbacks( ${1:\\$post_id} )"
"do_undismiss_core_update":
"prefix":"do_undismiss_core_update"
"body":"do_undismiss_core_update()"
"Unused Admin function.":
"prefix":"documentation_link"
"body":"documentation_link()"
"Retrieve the name of an action currently being processed.":
"prefix":"doing_action"
"body":"doing_action( ${1:\\$action = null} )"
"Retrieve the name of a filter currently being processed.":
"prefix":"doing_filter"
"body":"doing_filter( ${1:\\$filter = null} )"
"Check whether a blogname is already taken.":
"prefix":"domain_exists"
"body":"domain_exists( ${1:\\$domain}${2:, \\$path}${3:, \\$site_id = 1} )"
"Downloads a URL to a local temporary file using the WordPress HTTP Class.":
"prefix":"download_url"
"body":"download_url( ${1:\\$url}${2:, \\$timeout = 300} )"
"Drops a specified index from a table.":
"prefix":"drop_index"
"body":"drop_index( ${1:\\$table}${2:, \\$index} )"
"Legacy function used to generate the categories checklist control.":
"prefix":"dropdown_categories"
"body":"dropdown_categories( ${1:\\$default}${2:, \\$parent}${3:, \\$popular_ids = array()} )"
"Deprecated method for generating a drop-down of categories.":
"prefix":"dropdown_cats"
"body":"dropdown_cats( ${1:\\$optionall = 1}${2:, \\$all = 'All'}${3:, \\$orderby = 'ID'}${4:, \\$order = 'asc'}${5:, \\$show_last_update}${6:, \\$show_count}${7:, \\$hide_empty = 1}${8:, \\$optionnone = false}${9:, \\$selected}${10:, \\$exclude} )"
"Legacy function used to generate a link categories checklist control.":
"prefix":"dropdown_link_categories"
"body":"dropdown_link_categories( ${1:\\$default} )"
"Display dynamic sidebar.":
"prefix":"dynamic_sidebar"
"body":"dynamic_sidebar( ${1:\\$index = 1} )"
"Displays the edit bookmark link anchor content.":
"prefix":"edit_bookmark_link"
"body":"edit_bookmark_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$bookmark = null} )"
"Update a comment with values provided in $_POST.":
"prefix":"edit_comment"
"body":"edit_comment()"
"Displays the edit comment link with formatting.":
"prefix":"edit_comment_link"
"body":"edit_comment_link( ${1:\\$text = null}${2:, \\$before = ''}${3:, \\$after = ''} )"
"Displays the image and editor in the post editor":
"prefix":"edit_form_image_editor"
"body":"edit_form_image_editor( ${1:\\$post} )"
"Updates or inserts a link using values provided in $_POST.":
"prefix":"edit_link"
"body":"edit_link( ${1:\\$link_id} )"
"Update an existing post with values provided in $_POST.":
"prefix":"edit_post"
"body":"edit_post( ${1:\\$post_data = null} )"
"Displays the edit post link for post.":
"prefix":"edit_post_link"
"body":"edit_post_link( ${1:\\$text = null}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$id}${5:, \\$class = 'post-edit-link'} )"
"Displays or retrieves the edit link for a tag with formatting.":
"prefix":"edit_tag_link"
"body":"edit_tag_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$tag = null} )"
"Displays or retrieves the edit term link with formatting.":
"prefix":"edit_term_link"
"body":"edit_term_link( ${1:\\$link = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$term = null}${5:, \\$echo = true} )"
"Edit user settings based on contents of $_POST":
"prefix":"edit_user"
"body":"edit_user( ${1:\\$user_id} )"
"Checks whether the given email exists.":
"prefix":"email_exists"
"body":"email_exists( ${1:\\$email} )"
"XML callback function that is called at the end of a XML tag.":
"prefix":"endelement"
"body":"endelement( ${1:\\$parser}${2:, \\$tagName} )"
"enqueue_comment_hotkeys_js":
"prefix":"enqueue_comment_hotkeys_js"
"body":"enqueue_comment_hotkeys_js()"
"Enqueue embed iframe default CSS and JS & fire do_action('enqueue_embed_scripts')":
"prefix":"enqueue_embed_scripts"
"body":"enqueue_embed_scripts()"
"Converts named entities into numbered entities.":
"prefix":"ent2ncr"
"body":"ent2ncr( ${1:\\$text} )"
"Escaping for HTML attributes.":
"prefix":"esc_attr"
"body":"esc_attr( ${1:\\$text} )"
"Retrieve the translation of $text and escapes it for safe use in an attribute.":
"prefix":"esc_attr__"
"body":"esc_attr__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated text that has been escaped for safe use in an attribute.":
"prefix":"esc_attr_e"
"body":"esc_attr_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate string with gettext context, and escapes it for safe use in an attribute.":
"prefix":"esc_attr_x"
"body":"esc_attr_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Escaping for HTML blocks.":
"prefix":"esc_html"
"body":"esc_html( ${1:\\$text} )"
"Retrieve the translation of $text and escapes it for safe use in HTML output.":
"prefix":"esc_html__"
"body":"esc_html__( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Display translated text that has been escaped for safe use in HTML output.":
"prefix":"esc_html_e"
"body":"esc_html_e( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate string with gettext context, and escapes it for safe use in HTML output.":
"prefix":"esc_html_x"
"body":"esc_html_x( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Escape single quotes, htmlspecialchar " < > &, and fix line endings.":
"prefix":"esc_js"
"body":"esc_js( ${1:\\$text} )"
"Escapes data for use in a MySQL query.":
"prefix":"esc_sql"
"body":"esc_sql( ${1:\\$data} )"
"Escaping for textarea values.":
"prefix":"esc_textarea"
"body":"esc_textarea( ${1:\\$text} )"
"Checks and cleans a URL.":
"prefix":"esc_url"
"body":"esc_url( ${1:\\$url}${2:, \\$protocols = null}${3:, \\$_context = 'display'} )"
"Performs esc_url() for database usage.":
"prefix":"esc_url_raw"
"body":"esc_url_raw( ${1:\\$url}${2:, \\$protocols = null} )"
"Display JavaScript on the page.":
"prefix":"export_add_js"
"body":"export_add_js()"
"Create the date options fields for exporting a given post type.":
"prefix":"export_date_options"
"body":"export_date_options( ${1:\\$post_type = 'post'} )"
"Generates the WXR export file for download.":
"prefix":"export_wp"
"body":"export_wp( ${1:\\$args = array()} )"
"Extracts strings from between the BEGIN and END markers in the .htaccess file.":
"prefix":"extract_from_markers"
"body":"extract_from_markers( ${1:\\$filename}${2:, \\$marker} )"
"Favorite actions were deprecated in version 3.2. Use the admin bar instead.":
"prefix":"favorite_actions"
"body":"favorite_actions()"
"Return the content type for specified feed type.":
"prefix":"feed_content_type"
"body":"feed_content_type( ${1:\\$type = ''} )"
"Display the links to the general feeds.":
"prefix":"feed_links"
"body":"feed_links( ${1:\\$args = array()} )"
"Display the links to the extra feeds such as category feeds.":
"prefix":"feed_links_extra"
"body":"feed_links_extra( ${1:\\$args = array()} )"
"Build SimplePie object based on RSS or Atom feed from URL.":
"prefix":"fetch_feed"
"body":"fetch_feed( ${1:\\$url} )"
"Build Magpie object based on RSS from URL.":
"prefix":"fetch_rss"
"body":"fetch_rss( ${1:\\$url} )"
"Validate that file is suitable for displaying within a web page.":
"prefix":"file_is_displayable_image"
"body":"file_is_displayable_image( ${1:\\$path} )"
"Validate that file is an image.":
"prefix":"file_is_valid_image"
"body":"file_is_valid_image( ${1:\\$path} )"
"Filter the default value for the option.":
"prefix":"filter_default_option"
"body":"filter_default_option( ${1:\\$default}${2:, \\$option}${3:, \\$passed_default} )"
"Formats a URL to use https.":
"prefix":"filter_ssl"
"body":"filter_ssl( ${1:\\$url} )"
"Gets the best available (and enabled) Auto-Update for WordPress Core.":
"prefix":"find_core_auto_update"
"body":"find_core_auto_update()"
"find_core_update":
"prefix":"find_core_update"
"body":"find_core_update( ${1:\\$version}${2:, \\$locale} )"
"Outputs the modal window used for attaching media to posts or pages in the media-listing screen.":
"prefix":"find_posts_div"
"body":"find_posts_div( ${1:\\$found_action = ''} )"
"Get the remaining upload space for this site.":
"prefix":"fix_import_form_size"
"body":"fix_import_form_size( ${1:\\$size} )"
"Correct From host on outgoing mail to match the site domain":
"prefix":"fix_phpmailer_messageid"
"body":"fix_phpmailer_messageid( ${1:\\$phpmailer} )"
"Add avatars to relevant places in admin, or try to.":
"prefix":"floated_admin_avatar"
"body":"floated_admin_avatar( ${1:\\$name} )"
"Remove rewrite rules and then recreate rewrite rules.":
"prefix":"flush_rewrite_rules"
"body":"flush_rewrite_rules( ${1:\\$hard = true} )"
"Balances tags of string using a modified stack.":
"prefix":"force_balance_tags"
"body":"force_balance_tags( ${1:\\$text} )"
"Whether to force SSL used for the Administration Screens.":
"prefix":"force_ssl_admin"
"body":"force_ssl_admin( ${1:\\$force = null} )"
"Whether to force SSL on content.":
"prefix":"force_ssl_content"
"body":"force_ssl_content( ${1:\\$force = ''} )"
"Whether SSL login should be forced.":
"prefix":"force_ssl_login"
"body":"force_ssl_login( ${1:\\$force = null} )"
"Print option value after sanitizing for forms.":
"prefix":"form_option"
"body":"form_option( ${1:\\$option} )"
"Returns the language for a language code.":
"prefix":"format_code_lang"
"body":"format_code_lang( ${1:\\$code = ''} )"
"Formats text for the editor.":
"prefix":"format_for_editor"
"body":"format_for_editor( ${1:\\$text}${2:, \\$default_editor = null} )"
"Acts on text which is about to be edited.":
"prefix":"format_to_edit"
"body":"format_to_edit( ${1:\\$content}${2:, \\$rich_text = false} )"
"Formerly used to escape strings before inserting into the DB.":
"prefix":"format_to_post"
"body":"format_to_post( ${1:\\$content} )"
"Callback used to change %uXXXX to &#YYY; syntax":
"prefix":"funky_javascript_callback"
"body":"funky_javascript_callback( ${1:\\$matches} )"
"Fixes JavaScript bugs in browsers.":
"prefix":"funky_javascript_fix"
"body":"funky_javascript_fix( ${1:\\$text} )"
"Builds the Gallery shortcode output.":
"prefix":"gallery_shortcode"
"body":"gallery_shortcode( ${1:\\$attr} )"
"Check if the installed version of GD supports particular image type":
"prefix":"gd_edit_image_support"
"body":"gd_edit_image_support( ${1:\\$mime_type} )"
"Generates a random password.":
"prefix":"generate_random_password"
"body":"generate_random_password( ${1:\\$len = 8} )"
"Sends pings to all of the ping site services.":
"prefix":"generic_ping"
"body":"generic_ping( ${1:\\$post_id} )"
"Retrieve path of 404 template in current or parent template.":
"prefix":"get_404_template"
"body":"get_404_template()"
"Get one of a user's active blogs":
"prefix":"get_active_blog_for_user"
"body":"get_active_blog_for_user( ${1:\\$user_id} )"
"Retrieves the adjacent post.":
"prefix":"get_adjacent_post"
"body":"get_adjacent_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$previous = true}${4:, \\$taxonomy = 'category'} )"
"Retrieves the adjacent post link.":
"prefix":"get_adjacent_post_link"
"body":"get_adjacent_post_link( ${1:\\$format}${2:, \\$link}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$previous = true}${6:, \\$taxonomy = 'category'} )"
"Retrieves the adjacent post relational link.":
"prefix":"get_adjacent_post_rel_link"
"body":"get_adjacent_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$previous = true}${5:, \\$taxonomy = 'category'} )"
"get_admin_page_parent":
"prefix":"get_admin_page_parent"
"body":"get_admin_page_parent()"
"get_admin_page_title":
"prefix":"get_admin_page_title"
"body":"get_admin_page_title()"
"Retrieves the URL to the admin area for a given site.":
"prefix":"get_admin_url"
"body":"get_admin_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = 'admin'} )"
"Get the admin for a domain/path combination.":
"prefix":"get_admin_users_for_domain"
"body":"get_admin_users_for_domain( ${1:\\$sitedomain = ''}${2:, \\$path = ''} )"
"Retrieves all category IDs.":
"prefix":"get_all_category_ids"
"body":"get_all_category_ids()"
"Get a list of page IDs.":
"prefix":"get_all_page_ids"
"body":"get_all_page_ids()"
"Get all the post type features":
"prefix":"get_all_post_type_supports"
"body":"get_all_post_type_supports( ${1:\\$post_type} )"
"Retrieve all user interface settings.":
"prefix":"get_all_user_settings"
"body":"get_all_user_settings()"
"Retrieve all autoload options, or all options if no autoloaded ones exist.":
"prefix":"get_alloptions"
"body":"get_alloptions()"
"Retrieve all options as it was for 1.2.":
"prefix":"get_alloptions_110"
"body":"get_alloptions_110()"
"Retrieve list of allowed HTTP origins.":
"prefix":"get_allowed_http_origins"
"body":"get_allowed_http_origins()"
"Retrieve list of allowed mime types and file extensions.":
"prefix":"get_allowed_mime_types"
"body":"get_allowed_mime_types( ${1:\\$user = null} )"
"Get the allowed themes for the current site.":
"prefix":"get_allowed_themes"
"body":"get_allowed_themes()"
"Get an array of ancestor IDs for a given object.":
"prefix":"get_ancestors"
"body":"get_ancestors( ${1:\\$object_id}${2:, \\$object_type = ''}${3:, \\$resource_type = ''} )"
"Retrieve the approved comments for post $post_id.":
"prefix":"get_approved_comments"
"body":"get_approved_comments( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieve path of archive template in current or parent template.":
"prefix":"get_archive_template"
"body":"get_archive_template()"
"Retrieves a list of archives.":
"prefix":"get_archives"
"body":"get_archives( ${1:\\$type = ''}${2:, \\$limit = ''}${3:, \\$format = 'html'}${4:, \\$before = ''}${5:, \\$after = ''}${6:, \\$show_post_count = false} )"
"Retrieve archive link content based on predefined or custom code.":
"prefix":"get_archives_link"
"body":"get_archives_link( ${1:\\$url}${2:, \\$text}${3:, \\$format = 'html'}${4:, \\$before = ''}${5:, \\$after = ''} )"
"Retrieve attached file path based on attachment ID.":
"prefix":"get_attached_file"
"body":"get_attached_file( ${1:\\$attachment_id}${2:, \\$unfiltered = false} )"
"Retrieves media attached to the passed post.":
"prefix":"get_attached_media"
"body":"get_attached_media( ${1:\\$type}${2:, \\$post} )"
"Retrieves the attachment fields to edit form fields.":
"prefix":"get_attachment_fields_to_edit"
"body":"get_attachment_fields_to_edit( ${1:\\$post}${2:, \\$errors = null} )"
"Retrieve HTML content of icon attachment image element.":
"prefix":"get_attachment_icon"
"body":"get_attachment_icon( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false} )"
"Retrieve icon URL and Path.":
"prefix":"get_attachment_icon_src"
"body":"get_attachment_icon_src( ${1:\\$id}${2:, \\$fullsize = false} )"
"Retrieve HTML content of image element.":
"prefix":"get_attachment_innerhtml"
"body":"get_attachment_innerhtml( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false} )"
"Retrieves the permalink for an attachment.":
"prefix":"get_attachment_link"
"body":"get_attachment_link( ${1:\\$post = null}${2:, \\$leavename = false} )"
"Retrieves taxonomies attached to given the attachment.":
"prefix":"get_attachment_taxonomies"
"body":"get_attachment_taxonomies( ${1:\\$attachment}${2:, \\$output = 'names'} )"
"Retrieve path of attachment template in current or parent template.":
"prefix":"get_attachment_template"
"body":"get_attachment_template()"
"Retrieves the feed link for a given author.":
"prefix":"get_author_feed_link"
"body":"get_author_feed_link( ${1:\\$author_id}${2:, \\$feed = ''} )"
"Returns or Prints link to the author's posts.":
"prefix":"get_author_link"
"body":"get_author_link( ${1:\\$echo}${2:, \\$author_id}${3:, \\$author_nicename = ''} )"
"Retrieve the specified author's preferred display name.":
"prefix":"get_author_name"
"body":"get_author_name( ${1:\\$auth_id = false} )"
"Retrieve the URL to the author page for the user with the ID provided.":
"prefix":"get_author_posts_url"
"body":"get_author_posts_url( ${1:\\$author_id}${2:, \\$author_nicename = ''} )"
"Print/Return link to author RSS feed.":
"prefix":"get_author_rss_link"
"body":"get_author_rss_link( ${1:\\$echo = false}${2:, \\$author_id = 1} )"
"Retrieve path of author template in current or parent template.":
"prefix":"get_author_template"
"body":"get_author_template()"
"Get all user IDs.":
"prefix":"get_author_user_ids"
"body":"get_author_user_ids()"
"Gets the auto_toggle setting.":
"prefix":"get_autotoggle"
"body":"get_autotoggle( ${1:\\$id} )"
"Get all available languages based on the presence of *.mo files in a given directory.":
"prefix":"get_available_languages"
"body":"get_available_languages( ${1:\\$dir = null} )"
"Get all available post MIME types for a given post type.":
"prefix":"get_available_post_mime_types"
"body":"get_available_post_mime_types( ${1:\\$type = 'attachment'} )"
"Get all the possible statuses for a post_type":
"prefix":"get_available_post_statuses"
"body":"get_available_post_statuses( ${1:\\$type = 'post'} )"
"Retrieve the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post.":
"prefix":"get_avatar"
"body":"get_avatar( ${1:\\$id_or_email}${2:, \\$size = 96}${3:, \\$default = ''}${4:, \\$alt = ''}${5:, \\$args = null} )"
"Retrieves default data about the avatar.":
"prefix":"get_avatar_data"
"body":"get_avatar_data( ${1:\\$id_or_email}${2:, \\$args = null} )"
"Retrieves the avatar URL.":
"prefix":"get_avatar_url"
"body":"get_avatar_url( ${1:\\$id_or_email}${2:, \\$args = null} )"
"Retrieve value for custom background color.":
"prefix":"get_background_color"
"body":"get_background_color()"
"Retrieve background image for custom background.":
"prefix":"get_background_image"
"body":"get_background_image()"
"The number of active sites on your installation.":
"prefix":"get_blog_count"
"body":"get_blog_count( ${1:\\$network_id = null} )"
"Retrieve the details for a blog from the blogs table and blog options.":
"prefix":"get_blog_details"
"body":"get_blog_details( ${1:\\$fields = null}${2:, \\$get_all = true} )"
"Get a blog's numeric ID from its URL.":
"prefix":"get_blog_id_from_url"
"body":"get_blog_id_from_url( ${1:\\$domain}${2:, \\$path = '/'} )"
"Deprecated functionality to retrieve a list of all sites.":
"prefix":"get_blog_list"
"body":"get_blog_list( ${1:\\$start}${2:, \\$num = 10}${3:, \\$deprecated = ''} )"
"Retrieve option value for a given blog id based on name of option.":
"prefix":"get_blog_option"
"body":"get_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$default = false} )"
"Get the permalink for a post on another blog.":
"prefix":"get_blog_permalink"
"body":"get_blog_permalink( ${1:\\$blog_id}${2:, \\$post_id} )"
"Get a blog post from any site on the network.":
"prefix":"get_blog_post"
"body":"get_blog_post( ${1:\\$blog_id}${2:, \\$post_id} )"
"Get a blog details field.":
"prefix":"get_blog_status"
"body":"get_blog_status( ${1:\\$id}${2:, \\$pref} )"
"Get a full blog URL, given a domain and a path.":
"prefix":"get_blogaddress_by_domain"
"body":"get_blogaddress_by_domain( ${1:\\$domain}${2:, \\$path} )"
"Get a full blog URL, given a blog id.":
"prefix":"get_blogaddress_by_id"
"body":"get_blogaddress_by_id( ${1:\\$blog_id} )"
"Get a full blog URL, given a blog name.":
"prefix":"get_blogaddress_by_name"
"body":"get_blogaddress_by_name( ${1:\\$blogname} )"
"Retrieves information about the current site.":
"prefix":"get_bloginfo"
"body":"get_bloginfo( ${1:\\$show = ''}${2:, \\$filter = 'raw'} )"
"RSS container for the bloginfo function.":
"prefix":"get_bloginfo_rss"
"body":"get_bloginfo_rss( ${1:\\$show = ''} )"
"Get the sites a user belongs to.":
"prefix":"get_blogs_of_user"
"body":"get_blogs_of_user( ${1:\\$user_id}${2:, \\$all = false} )"
"Retrieve the classes for the body element as an array.":
"prefix":"get_body_class"
"body":"get_body_class( ${1:\\$class = ''} )"
"Retrieve Bookmark data":
"prefix":"get_bookmark"
"body":"get_bookmark( ${1:\\$bookmark}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve single bookmark data item or field.":
"prefix":"get_bookmark_field"
"body":"get_bookmark_field( ${1:\\$field}${2:, \\$bookmark}${3:, \\$context = 'display'} )"
"Retrieves the list of bookmarks":
"prefix":"get_bookmarks"
"body":"get_bookmarks( ${1:\\$args = ''} )"
"Retrieves the boundary post.":
"prefix":"get_boundary_post"
"body":"get_boundary_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$start = true}${4:, \\$taxonomy = 'category'} )"
"Get boundary post relational link.":
"prefix":"get_boundary_post_rel_link"
"body":"get_boundary_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_cat = false}${3:, \\$excluded_categories = ''}${4:, \\$start = true} )"
"Retrieves a list of broken themes.":
"prefix":"get_broken_themes"
"body":"get_broken_themes()"
"Display calendar with days that have posts as links.":
"prefix":"get_calendar"
"body":"get_calendar( ${1:\\$initial = true}${2:, \\$echo = true} )"
"Retrieve HTML content for cancel comment reply link.":
"prefix":"get_cancel_comment_reply_link"
"body":"get_cancel_comment_reply_link( ${1:\\$text = ''} )"
"Retrieve the ID of a category from its name.":
"prefix":"get_cat_id"
"body":"get_cat_id( ${1:\\$cat_name} )"
"Retrieve the name of a category from its ID.":
"prefix":"get_cat_name"
"body":"get_cat_name( ${1:\\$cat_id} )"
"Retrieve list of category objects.":
"prefix":"get_categories"
"body":"get_categories( ${1:\\$args = ''} )"
"Retrieves category data given a category ID or category object.":
"prefix":"get_category"
"body":"get_category( ${1:\\$category}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve category based on URL containing the category slug.":
"prefix":"get_category_by_path"
"body":"get_category_by_path( ${1:\\$category_path}${2:, \\$full_match = true}${3:, \\$output = OBJECT} )"
"Retrieve category object by category slug.":
"prefix":"get_category_by_slug"
"body":"get_category_by_slug( ${1:\\$slug} )"
"Retrieve category children list separated before and after the term IDs.":
"prefix":"get_category_children"
"body":"get_category_children( ${1:\\$id}${2:, \\$before = '/'}${3:, \\$after = ''}${4:, \\$visited = array()} )"
"Retrieves the feed link for a category.":
"prefix":"get_category_feed_link"
"body":"get_category_feed_link( ${1:\\$cat_id}${2:, \\$feed = ''} )"
"Retrieve category link URL.":
"prefix":"get_category_link"
"body":"get_category_link( ${1:\\$category} )"
"Retrieve category parents with separator.":
"prefix":"get_category_parents"
"body":"get_category_parents( ${1:\\$id}${2:, \\$link = false}${3:, \\$separator = '/'}${4:, \\$nicename = false}${5:, \\$deprecated = array()} )"
"Print/Return link to category RSS2 feed.":
"prefix":"get_category_rss_link"
"body":"get_category_rss_link( ${1:\\$echo = false}${2:, \\$cat_ID = 1} )"
"Retrieve path of category template in current or parent template.":
"prefix":"get_category_template"
"body":"get_category_template()"
"Get category object for given ID and 'edit' filter context.":
"prefix":"get_category_to_edit"
"body":"get_category_to_edit( ${1:\\$id} )"
"Retrieve the category name by the category ID.":
"prefix":"get_catname"
"body":"get_catname( ${1:\\$cat_ID} )"
"Retrieve all children of the post parent ID.":
"prefix":"get_children"
"body":"get_children( ${1:\\$args = ''}${2:, \\$output = OBJECT} )"
"Get base domain of network.":
"prefix":"get_clean_basedomain"
"body":"get_clean_basedomain()"
"Returns value of command line params.":
"prefix":"get_cli_args"
"body":"get_cli_args( ${1:\\$param}${2:, \\$required = false} )"
"Get the column headers for a screen":
"prefix":"get_column_headers"
"body":"get_column_headers( ${1:\\$screen} )"
"Retrieves comment data given a comment ID or comment object.":
"prefix":"get_comment"
"body":"get_comment( ${1:\\$comment = null}${2:, \\$output = OBJECT} )"
"Retrieve the author of the current comment.":
"prefix":"get_comment_author"
"body":"get_comment_author( ${1:\\$comment_ID} )"
"Retrieve the email of the author of the current comment.":
"prefix":"get_comment_author_email"
"body":"get_comment_author_email( ${1:\\$comment_ID} )"
"Return the html email link to the author of the current comment.":
"prefix":"get_comment_author_email_link"
"body":"get_comment_author_email_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment = null} )"
"Retrieve the IP address of the author of the current comment.":
"prefix":"get_comment_author_ip"
"body":"get_comment_author_ip( ${1:\\$comment_ID} )"
"Retrieve the HTML link to the URL of the author of the current comment.":
"prefix":"get_comment_author_link"
"body":"get_comment_author_link( ${1:\\$comment_ID} )"
"Retrieve the current comment author for use in the feeds.":
"prefix":"get_comment_author_rss"
"body":"get_comment_author_rss()"
"Retrieve the url of the author of the current comment.":
"prefix":"get_comment_author_url"
"body":"get_comment_author_url( ${1:\\$comment_ID} )"
"Retrieves the HTML link of the url of the author of the current comment.":
"prefix":"get_comment_author_url_link"
"body":"get_comment_author_url_link( ${1:\\$linktext = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$comment} )"
"Returns the classes for the comment div as an array.":
"prefix":"get_comment_class"
"body":"get_comment_class( ${1:\\$class = ''}${2:, \\$comment_id = null}${3:, \\$post_id = null} )"
"The amount of comments in a post or total comments.":
"prefix":"get_comment_count"
"body":"get_comment_count( ${1:\\$post_id} )"
"Retrieve the comment date of the current comment.":
"prefix":"get_comment_date"
"body":"get_comment_date( ${1:\\$d = ''}${2:, \\$comment_ID} )"
"Retrieve the excerpt of the current comment.":
"prefix":"get_comment_excerpt"
"body":"get_comment_excerpt( ${1:\\$comment_ID} )"
"Retrieve the feed GUID for the current comment.":
"prefix":"get_comment_guid"
"body":"get_comment_guid( ${1:\\$comment_id = null} )"
"Retrieve the comment id of the current comment.":
"prefix":"get_comment_id"
"body":"get_comment_id()"
"Retrieve hidden input HTML for replying to comments.":
"prefix":"get_comment_id_fields"
"body":"get_comment_id_fields( ${1:\\$id} )"
"Retrieve the link to a given comment.":
"prefix":"get_comment_link"
"body":"get_comment_link( ${1:\\$comment = null}${2:, \\$args = array()} )"
"Retrieve comment meta field for a comment.":
"prefix":"get_comment_meta"
"body":"get_comment_meta( ${1:\\$comment_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Calculate the total number of comment pages.":
"prefix":"get_comment_pages_count"
"body":"get_comment_pages_count( ${1:\\$comments = null}${2:, \\$per_page = null}${3:, \\$threaded = null} )"
"Retrieve HTML content for reply to comment link.":
"prefix":"get_comment_reply_link"
"body":"get_comment_reply_link( ${1:\\$args = array()}${2:, \\$comment = null}${3:, \\$post = null} )"
"Retrieve all of the WordPress supported comment statuses.":
"prefix":"get_comment_statuses"
"body":"get_comment_statuses()"
"Retrieve the text of the current comment.":
"prefix":"get_comment_text"
"body":"get_comment_text( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Retrieve the comment time of the current comment.":
"prefix":"get_comment_time"
"body":"get_comment_time( ${1:\\$d = ''}${2:, \\$gmt = false}${3:, \\$translate = true} )"
"Returns a WP_Comment object based on comment ID.":
"prefix":"get_comment_to_edit"
"body":"get_comment_to_edit( ${1:\\$id} )"
"Retrieve the comment type of the current comment.":
"prefix":"get_comment_type"
"body":"get_comment_type( ${1:\\$comment_ID} )"
"Retrieve an array of comment data about comment $comment_ID.":
"prefix":"get_commentdata"
"body":"get_commentdata( ${1:\\$comment_ID}${2:, \\$no_cache}${3:, \\$include_unapproved = false} )"
"Retrieve a list of comments.":
"prefix":"get_comments"
"body":"get_comments( ${1:\\$args = ''} )"
"Retrieves the link to the current post comments.":
"prefix":"get_comments_link"
"body":"get_comments_link( ${1:\\$post_id} )"
"Retrieve the amount of comments a post has.":
"prefix":"get_comments_number"
"body":"get_comments_number( ${1:\\$post_id} )"
"Display the language string for the number of comments the current post has":
"prefix":"get_comments_number_text"
"body":"get_comments_number_text( ${1:\\$zero = false}${2:, \\$one = false}${3:, \\$more = false} )"
"Retrieves the comments page number link.":
"prefix":"get_comments_pagenum_link"
"body":"get_comments_pagenum_link( ${1:\\$pagenum = 1}${2:, \\$max_page} )"
"Retrieve path of comment popup template in current or parent template.":
"prefix":"get_comments_popup_template"
"body":"get_comments_popup_template()"
"get_compat_media_markup":
"prefix":"get_compat_media_markup"
"body":"get_compat_media_markup( ${1:\\$attachment_id}${2:, \\$args = null} )"
"Gets and caches the checksums for the given version of WordPress.":
"prefix":"get_core_checksums"
"body":"get_core_checksums( ${1:\\$version}${2:, \\$locale} )"
"Get available core updates.":
"prefix":"get_core_updates"
"body":"get_core_updates( ${1:\\$options = array()} )"
"Retrieve the current site ID.":
"prefix":"get_current_blog_id"
"body":"get_current_blog_id()"
"Retrieves the current network ID.":
"prefix":"get_current_network_id"
"body":"get_current_network_id()"
"Get the current screen object":
"prefix":"get_current_screen"
"body":"get_current_screen()"
"Get the current network.":
"prefix":"get_current_site"
"body":"get_current_site()"
"This deprecated function formerly set the site_name property of the $current_site object.":
"prefix":"get_current_site_name"
"body":"get_current_site_name( ${1:\\$current_site} )"
"Retrieve current theme name.":
"prefix":"get_current_theme"
"body":"get_current_theme()"
"Get the current user's ID":
"prefix":"get_current_user_id"
"body":"get_current_user_id()"
"Populate global variables with information about the currently logged in user.":
"prefix":"get_currentuserinfo"
"body":"get_currentuserinfo()"
"Get the header image data.":
"prefix":"get_custom_header"
"body":"get_custom_header()"
"Retrieve the markup for a custom header.":
"prefix":"get_custom_header_markup"
"body":"get_custom_header_markup()"
"Returns a custom logo, linked to home.":
"prefix":"get_custom_logo"
"body":"get_custom_logo( ${1:\\$blog_id} )"
"Get the "dashboard blog", the blog where users without a blog edit their profile data.":
"prefix":"get_dashboard_blog"
"body":"get_dashboard_blog()"
"Retrieves the URL to the user's dashboard.":
"prefix":"get_dashboard_url"
"body":"get_dashboard_url( ${1:\\$user_id}${2:, \\$path = ''}${3:, \\$scheme = 'admin'} )"
"Converts a GMT date into the correct format for the blog.":
"prefix":"get_date_from_gmt"
"body":"get_date_from_gmt( ${1:\\$string}${2:, \\$format = 'Y-m-d H:i:s'} )"
"Retrieve path of date template in current or parent template.":
"prefix":"get_date_template"
"body":"get_date_template()"
"Retrieves the permalink for the day archives with year and month.":
"prefix":"get_day_link"
"body":"get_day_link( ${1:\\$year}${2:, \\$month}${3:, \\$day} )"
"Gets the default comment status for a post type.":
"prefix":"get_default_comment_status"
"body":"get_default_comment_status( ${1:\\$post_type = 'post'}${2:, \\$comment_type = 'comment'} )"
"Retrieve the default feed.":
"prefix":"get_default_feed"
"body":"get_default_feed()"
"Retrieves the default link for editing.":
"prefix":"get_default_link_to_edit"
"body":"get_default_link_to_edit()"
"Gets the default page information to use.":
"prefix":"get_default_page_to_edit"
"body":"get_default_page_to_edit()"
"Default post information to use when populating the "Write Post" form.":
"prefix":"get_default_post_to_edit"
"body":"get_default_post_to_edit( ${1:\\$post_type = 'post'}${2:, \\$create_in_db = false} )"
"Retrieves the delete posts link for post.":
"prefix":"get_delete_post_link"
"body":"get_delete_post_link( ${1:\\$id}${2:, \\$deprecated = ''}${3:, \\$force_delete = false} )"
"Get the size of a directory.":
"prefix":"get_dirsize"
"body":"get_dirsize( ${1:\\$directory} )"
"Check the wp-content directory and retrieve all drop-ins with any plugin data.":
"prefix":"get_dropins"
"body":"get_dropins()"
"Displays the edit bookmark link.":
"prefix":"get_edit_bookmark_link"
"body":"get_edit_bookmark_link( ${1:\\$link} )"
"Retrieves the edit comment link.":
"prefix":"get_edit_comment_link"
"body":"get_edit_comment_link( ${1:\\$comment_id} )"
"Retrieves the edit post link for post.":
"prefix":"get_edit_post_link"
"body":"get_edit_post_link( ${1:\\$id}${2:, \\$context = 'display'} )"
"Retrieves the URL to the user's profile editor.":
"prefix":"get_edit_profile_url"
"body":"get_edit_profile_url( ${1:\\$user_id}${2:, \\$scheme = 'admin'} )"
"Retrieves the edit link for a tag.":
"prefix":"get_edit_tag_link"
"body":"get_edit_tag_link( ${1:\\$tag_id}${2:, \\$taxonomy = 'post_tag'} )"
"Retrieves the URL for editing a given term.":
"prefix":"get_edit_term_link"
"body":"get_edit_term_link( ${1:\\$term_id}${2:, \\$taxonomy = ''}${3:, \\$object_type = ''} )"
"Retrieves the edit user link.":
"prefix":"get_edit_user_link"
"body":"get_edit_user_link( ${1:\\$user_id = null} )"
"Gets author users who can edit posts.":
"prefix":"get_editable_authors"
"body":"get_editable_authors( ${1:\\$user_id} )"
"Fetch a filtered list of user roles that the current user is
allowed to edit.":
"prefix":"get_editable_roles"
"body":"get_editable_roles()"
"Gets the IDs of any users who can edit posts.":
"prefix":"get_editable_user_ids"
"body":"get_editable_user_ids( ${1:\\$user_id}${2:, \\$exclude_zeros = true} )"
"Retrieve any registered editor stylesheets":
"prefix":"get_editor_stylesheets"
"body":"get_editor_stylesheets()"
"Retrieves an embed template path in the current or parent template.":
"prefix":"get_embed_template"
"body":"get_embed_template()"
"Retrieve enclosures already enclosed for a post.":
"prefix":"get_enclosed"
"body":"get_enclosed( ${1:\\$post_id} )"
"Get extended entry info (<!--more-->).":
"prefix":"get_extended"
"body":"get_extended( ${1:\\$post} )"
"Retrieves the permalink for the feed type.":
"prefix":"get_feed_link"
"body":"get_feed_link( ${1:\\$feed = ''} )"
"Retrieve metadata from a file.":
"prefix":"get_file_data"
"body":"get_file_data( ${1:\\$file}${2:, \\$default_headers}${3:, \\$context = ''} )"
"Get the description for standard WordPress theme files and other various standard
WordPress files":
"prefix":"get_file_description"
"body":"get_file_description( ${1:\\$file} )"
"Determines which method to use for reading, writing, modifying, or deleting
files on the filesystem.":
"prefix":"get_filesystem_method"
"body":"get_filesystem_method( ${1:\\$args = array()}${2:, \\$context = ''}${3:, \\$allow_relaxed_file_ownership = false} )"
"Load footer template.":
"prefix":"get_footer"
"body":"get_footer( ${1:\\$name = null} )"
"Retrieve path of front page template in current or parent template.":
"prefix":"get_front_page_template"
"body":"get_front_page_template()"
"Returns a date in the GMT equivalent.":
"prefix":"get_gmt_from_date"
"body":"get_gmt_from_date( ${1:\\$string}${2:, \\$format = 'Y-m-d H:i:s'} )"
"Load header template.":
"prefix":"get_header"
"body":"get_header( ${1:\\$name = null} )"
"Retrieve header image for custom header.":
"prefix":"get_header_image"
"body":"get_header_image()"
"Create image tag markup for a custom header image.":
"prefix":"get_header_image_tag"
"body":"get_header_image_tag( ${1:\\$attr = array()} )"
"Retrieves the custom header text color in 3- or 6-digit hexadecimal form.":
"prefix":"get_header_textcolor"
"body":"get_header_textcolor()"
"Retrieve header video settings.":
"prefix":"get_header_video_settings"
"body":"get_header_video_settings()"
"Retrieve header video URL for custom header.":
"prefix":"get_header_video_url"
"body":"get_header_video_url()"
"Get a list of hidden columns.":
"prefix":"get_hidden_columns"
"body":"get_hidden_columns( ${1:\\$screen} )"
"Get Hidden Meta Boxes":
"prefix":"get_hidden_meta_boxes"
"body":"get_hidden_meta_boxes( ${1:\\$screen} )"
"Get the absolute filesystem path to the root of the WordPress installation":
"prefix":"get_home_path"
"body":"get_home_path()"
"Retrieve path of home template in current or parent template.":
"prefix":"get_home_template"
"body":"get_home_template()"
"Retrieves the URL for a given site where the front end is accessible.":
"prefix":"get_home_url"
"body":"get_home_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = null} )"
"Retrieve the regular expression for an HTML element.":
"prefix":"get_html_split_regex"
"body":"get_html_split_regex()"
"Get the HTTP Origin of the current request.":
"prefix":"get_http_origin"
"body":"get_http_origin()"
"Retrieves a sites ID given its (subdomain or directory) slug.":
"prefix":"get_id_from_blogname"
"body":"get_id_from_blogname( ${1:\\$slug} )"
"Retrieves the image HTML to send to the editor.":
"prefix":"get_image_send_to_editor"
"body":"get_image_send_to_editor( ${1:\\$id}${2:, \\$caption}${3:, \\$title}${4:, \\$align}${5:, \\$url = ''}${6:, \\$rel = false}${7:, \\$size = 'medium'}${8:, \\$alt = ''} )"
"Gets an img tag for an image attachment, scaling it down if requested.":
"prefix":"get_image_tag"
"body":"get_image_tag( ${1:\\$id}${2:, \\$alt}${3:, \\$title}${4:, \\$align}${5:, \\$size = 'medium'} )"
"Retrieve list of importers.":
"prefix":"get_importers"
"body":"get_importers()"
"Get site index relational link.":
"prefix":"get_index_rel_link"
"body":"get_index_rel_link()"
"Retrieve path of index template in current or parent template.":
"prefix":"get_index_template"
"body":"get_index_template()"
"Adds hidden fields with the data for use in the inline editor for posts and pages.":
"prefix":"get_inline_data"
"body":"get_inline_data( ${1:\\$post} )"
"Gets the available intermediate image sizes.":
"prefix":"get_intermediate_image_sizes"
"body":"get_intermediate_image_sizes()"
"Gets the language attributes for the html tag.":
"prefix":"get_language_attributes"
"body":"get_language_attributes( ${1:\\$doctype = 'html'} )"
"Get a list of most recently updated blogs.":
"prefix":"get_last_updated"
"body":"get_last_updated( ${1:\\$deprecated = ''}${2:, \\$start}${3:, \\$quantity = 40} )"
"The date the last comment was modified.":
"prefix":"get_lastcommentmodified"
"body":"get_lastcommentmodified( ${1:\\$timezone = 'server'} )"
"Retrieve the date that the last post was published.":
"prefix":"get_lastpostdate"
"body":"get_lastpostdate( ${1:\\$timezone = 'server'}${2:, \\$post_type = 'any'} )"
"Get the timestamp of the last time any post was modified.":
"prefix":"get_lastpostmodified"
"body":"get_lastpostmodified( ${1:\\$timezone = 'server'}${2:, \\$post_type = 'any'} )"
"Retrieves bookmark data based on ID.":
"prefix":"get_link"
"body":"get_link( ${1:\\$bookmark_id}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves link data based on its ID.":
"prefix":"get_link_to_edit"
"body":"get_link_to_edit( ${1:\\$link} )"
"Gets the name of category by id.":
"prefix":"get_linkcatname"
"body":"get_linkcatname( ${1:\\$id} )"
"Gets an array of link objects associated with category n.":
"prefix":"get_linkobjects"
"body":"get_linkobjects( ${1:\\$category}${2:, \\$orderby = 'name'}${3:, \\$limit} )"
"Gets an array of link objects associated with category $cat_name.":
"prefix":"get_linkobjectsbyname"
"body":"get_linkobjectsbyname( ${1:\\$cat_name = 'noname'}${2:, \\$orderby = 'name'}${3:, \\$limit = -1} )"
"Legacy function that retrieved the value of a link's link_rating field.":
"prefix":"get_linkrating"
"body":"get_linkrating( ${1:\\$link} )"
"Gets the links associated with category by id.":
"prefix":"get_links"
"body":"get_links( ${1:\\$category = -1}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ' '}${5:, \\$show_images = true}${6:, \\$orderby = 'name'}${7:, \\$show_description = true}${8:, \\$show_rating = false}${9:, \\$limit = -1}${10:, \\$show_updated = 1}${11:, \\$echo = true} )"
"Output entire list of links by category.":
"prefix":"get_links_list"
"body":"get_links_list( ${1:\\$order = 'name'} )"
"Gets the links associated with category n and display rating stars/chars.":
"prefix":"get_links_withrating"
"body":"get_links_withrating( ${1:\\$category = -1}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$limit = -1}${9:, \\$show_updated} )"
"Gets the links associated with category $cat_name.":
"prefix":"get_linksbyname"
"body":"get_linksbyname( ${1:\\$cat_name = 'noname'}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$show_rating = false}${9:, \\$limit = -1}${10:, \\$show_updated} )"
"Gets the links associated with category 'cat_name' and display rating stars/chars.":
"prefix":"get_linksbyname_withrating"
"body":"get_linksbyname_withrating( ${1:\\$cat_name = 'noname'}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$between = ''}${5:, \\$show_images = true}${6:, \\$orderby = 'id'}${7:, \\$show_description = true}${8:, \\$limit = -1}${9:, \\$show_updated} )"
"Retrieves the current locale.":
"prefix":"get_locale"
"body":"get_locale()"
"Retrieves the localized stylesheet URI.":
"prefix":"get_locale_stylesheet_uri"
"body":"get_locale_stylesheet_uri()"
"Get the main network ID.":
"prefix":"get_main_network_id"
"body":"get_main_network_id()"
"Check the content blob for an audio, video, object, embed, or iframe tags.":
"prefix":"get_media_embedded_in_content"
"body":"get_media_embedded_in_content( ${1:\\$content}${2:, \\$types = null} )"
"Retrieve HTML form for modifying the image attachment.":
"prefix":"get_media_item"
"body":"get_media_item( ${1:\\$attachment_id}${2:, \\$args = null} )"
"Retrieve HTML for media items of post gallery.":
"prefix":"get_media_items"
"body":"get_media_items( ${1:\\$post_id}${2:, \\$errors} )"
"Get a list of previously defined keys.":
"prefix":"get_meta_keys"
"body":"get_meta_keys()"
"Given a meta query, generates SQL clauses to be appended to a main query.":
"prefix":"get_meta_sql"
"body":"get_meta_sql( ${1:\\$meta_query}${2:, \\$type}${3:, \\$primary_table}${4:, \\$primary_id_column}${5:, \\$context = null} )"
"Retrieve metadata for the specified object.":
"prefix":"get_metadata"
"body":"get_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key = ''}${4:, \\$single = false} )"
"Get meta data by meta ID":
"prefix":"get_metadata_by_mid"
"body":"get_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id} )"
"Retrieves the permalink for the month archives with year.":
"prefix":"get_month_link"
"body":"get_month_link( ${1:\\$year}${2:, \\$month} )"
"Deprecated functionality to retrieve a list of the most active sites.":
"prefix":"get_most_active_blogs"
"body":"get_most_active_blogs( ${1:\\$num = 10}${2:, \\$display = true} )"
"Get a user's most recent post.":
"prefix":"get_most_recent_post_of_user"
"body":"get_most_recent_post_of_user( ${1:\\$user_id} )"
"Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data.":
"prefix":"get_mu_plugins"
"body":"get_mu_plugins()"
"Retrieves all registered navigation menu locations and the menus assigned to them.":
"prefix":"get_nav_menu_locations"
"body":"get_nav_menu_locations()"
"Retrieves network data given a network ID or network object.":
"prefix":"get_network"
"body":"get_network( ${1:\\$network = null} )"
"Retrieve the closest matching network for a domain and path.":
"prefix":"get_network_by_path"
"body":"get_network_by_path( ${1:\\$domain}${2:, \\$path}${3:, \\$segments = null} )"
"Retrieve a network's option value based on the option name.":
"prefix":"get_network_option"
"body":"get_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$default = false} )"
"Retrieves a list of networks.":
"prefix":"get_networks"
"body":"get_networks( ${1:\\$args = array()} )"
"Retrieves the link to the next comments page.":
"prefix":"get_next_comments_link"
"body":"get_next_comments_link( ${1:\\$label = ''}${2:, \\$max_page} )"
"Retrieves the next post that is adjacent to the current post.":
"prefix":"get_next_post"
"body":"get_next_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$taxonomy = 'category'} )"
"Retrieves the next post link that is adjacent to the current post.":
"prefix":"get_next_post_link"
"body":"get_next_post_link( ${1:\\$format = '%link »'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Retrieves the next posts link.":
"prefix":"get_next_posts_link"
"body":"get_next_posts_link( ${1:\\$label = null}${2:, \\$max_page} )"
"Retrieves the next posts page link.":
"prefix":"get_next_posts_page_link"
"body":"get_next_posts_page_link( ${1:\\$max_page} )"
"Gets all users who are not authors.":
"prefix":"get_nonauthor_user_ids"
"body":"get_nonauthor_user_ids()"
"Retrieve the number of database queries during the WordPress execution.":
"prefix":"get_num_queries"
"body":"get_num_queries()"
"Return the names or objects of the taxonomies which are registered for the requested object or object type, such as
a post object or post type name.":
"prefix":"get_object_taxonomies"
"body":"get_object_taxonomies( ${1:\\$object}${2:, \\$output = 'names'} )"
"Retrieves the taxonomy relationship to the term object id.":
"prefix":"get_object_term_cache"
"body":"get_object_term_cache( ${1:\\$id}${2:, \\$taxonomy} )"
"Retrieve object_ids of valid taxonomy and term.":
"prefix":"get_objects_in_term"
"body":"get_objects_in_term( ${1:\\$term_ids}${2:, \\$taxonomies}${3:, \\$args = array()} )"
"Retrieves the oEmbed endpoint URL for a given permalink.":
"prefix":"get_oembed_endpoint_url"
"body":"get_oembed_endpoint_url( ${1:\\$permalink = ''}${2:, \\$format = 'json'} )"
"Retrieves the oEmbed response data for a given post.":
"prefix":"get_oembed_response_data"
"body":"get_oembed_response_data( ${1:\\$post}${2:, \\$width} )"
"Filters the oEmbed response data to return an iframe embed code.":
"prefix":"get_oembed_response_data_rich"
"body":"get_oembed_response_data_rich( ${1:\\$data}${2:, \\$post}${3:, \\$width}${4:, \\$height} )"
"Retrieves an option value based on an option name.":
"prefix":"get_option"
"body":"get_option( ${1:\\$option}${2:, \\$default = false} )"
"Retrieve drafts from other users.":
"prefix":"get_others_drafts"
"body":"get_others_drafts( ${1:\\$user_id} )"
"Retrieve pending review posts from other users.":
"prefix":"get_others_pending"
"body":"get_others_pending( ${1:\\$user_id} )"
"Retrieves editable posts from other users.":
"prefix":"get_others_unpublished_posts"
"body":"get_others_unpublished_posts( ${1:\\$user_id}${2:, \\$type = 'any'} )"
"Retrieves page data given a page ID or page object.":
"prefix":"get_page"
"body":"get_page( ${1:\\$page}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves a page given its path.":
"prefix":"get_page_by_path"
"body":"get_page_by_path( ${1:\\$page_path}${2:, \\$output = OBJECT}${3:, \\$post_type = 'page'} )"
"Retrieve a page given its title.":
"prefix":"get_page_by_title"
"body":"get_page_by_title( ${1:\\$page_title}${2:, \\$output = OBJECT}${3:, \\$post_type = 'page'} )"
"Identify descendants of a given page ID in a list of page objects.":
"prefix":"get_page_children"
"body":"get_page_children( ${1:\\$page_id}${2:, \\$pages} )"
"Order the pages with children under parents in a flat list.":
"prefix":"get_page_hierarchy"
"body":"get_page_hierarchy( ${1:\\$pages}${2:, \\$page_id} )"
"Retrieves the permalink for the current page or page ID.":
"prefix":"get_page_link"
"body":"get_page_link( ${1:\\$post = false}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Calculate what page number a comment will appear on for comment paging.":
"prefix":"get_page_of_comment"
"body":"get_page_of_comment( ${1:\\$comment_ID}${2:, \\$args = array()} )"
"Retrieve all of the WordPress support page statuses.":
"prefix":"get_page_statuses"
"body":"get_page_statuses()"
"Retrieve path of page template in current or parent template.":
"prefix":"get_page_template"
"body":"get_page_template()"
"Get the specific template name for a given post.":
"prefix":"get_page_template_slug"
"body":"get_page_template_slug( ${1:\\$post = null} )"
"Get the Page Templates available in this theme":
"prefix":"get_page_templates"
"body":"get_page_templates( ${1:\\$post = null}${2:, \\$post_type = 'page'} )"
"Build the URI path for a page.":
"prefix":"get_page_uri"
"body":"get_page_uri( ${1:\\$page} )"
"Retrieve path of paged template in current or parent template.":
"prefix":"get_paged_template"
"body":"get_paged_template()"
"Retrieves the link for a page number.":
"prefix":"get_pagenum_link"
"body":"get_pagenum_link( ${1:\\$pagenum = 1}${2:, \\$escape = true} )"
"Retrieve a list of pages (or hierarchical post type items).":
"prefix":"get_pages"
"body":"get_pages( ${1:\\$args = array()} )"
"Get parent post relational link.":
"prefix":"get_parent_post_rel_link"
"body":"get_parent_post_rel_link( ${1:\\$title = '%title'} )"
"Retrieves the path of a file in the parent theme.":
"prefix":"get_parent_theme_file_path"
"body":"get_parent_theme_file_path( ${1:\\$file = ''} )"
"Retrieves the URL of a file in the parent theme.":
"prefix":"get_parent_theme_file_uri"
"body":"get_parent_theme_file_uri( ${1:\\$file = ''} )"
"Creates, stores, then returns a password reset key for user.":
"prefix":"get_password_reset_key"
"body":"get_password_reset_key( ${1:\\$user} )"
"Get the number of pending comments on a post or posts":
"prefix":"get_pending_comments_num"
"body":"get_pending_comments_num( ${1:\\$post_id} )"
"Retrieves the full permalink for the current post or post ID.":
"prefix":"get_permalink"
"body":"get_permalink( ${1:\\$post}${2:, \\$leavename = false} )"
"Parses the plugin contents to retrieve plugin's metadata.":
"prefix":"get_plugin_data"
"body":"get_plugin_data( ${1:\\$plugin_file}${2:, \\$markup = true}${3:, \\$translate = true} )"
"Get a list of a plugin's files.":
"prefix":"get_plugin_files"
"body":"get_plugin_files( ${1:\\$plugin} )"
"get_plugin_page_hook":
"prefix":"get_plugin_page_hook"
"body":"get_plugin_page_hook( ${1:\\$plugin_page}${2:, \\$parent_page} )"
"get_plugin_page_hookname":
"prefix":"get_plugin_page_hookname"
"body":"get_plugin_page_hookname( ${1:\\$plugin_page}${2:, \\$parent_page} )"
"get_plugin_updates":
"prefix":"get_plugin_updates"
"body":"get_plugin_updates()"
"Check the plugins directory and retrieve all plugin files with plugin data.":
"prefix":"get_plugins"
"body":"get_plugins( ${1:\\$plugin_folder = ''} )"
"Retrieves post data given a post ID or post object.":
"prefix":"get_post"
"body":"get_post( ${1:\\$post = null}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieve ancestors of a post.":
"prefix":"get_post_ancestors"
"body":"get_post_ancestors( ${1:\\$post} )"
"Retrieves the classes for the post div as an array.":
"prefix":"get_post_class"
"body":"get_post_class( ${1:\\$class = ''}${2:, \\$post_id = null} )"
"Retrieves the permalink for the post comments feed.":
"prefix":"get_post_comments_feed_link"
"body":"get_post_comments_feed_link( ${1:\\$post_id}${2:, \\$feed = ''} )"
"Retrieve post meta fields, based on post ID.":
"prefix":"get_post_custom"
"body":"get_post_custom( ${1:\\$post_id} )"
"Retrieve meta field names for a post.":
"prefix":"get_post_custom_keys"
"body":"get_post_custom_keys( ${1:\\$post_id} )"
"Retrieve values for a custom post field.":
"prefix":"get_post_custom_values"
"body":"get_post_custom_values( ${1:\\$key = ''}${2:, \\$post_id} )"
"Retrieves the embed code for a specific post.":
"prefix":"get_post_embed_html"
"body":"get_post_embed_html( ${1:\\$width}${2:, \\$height}${3:, \\$post = null} )"
"Retrieves the URL to embed a specific post in an iframe.":
"prefix":"get_post_embed_url"
"body":"get_post_embed_url( ${1:\\$post = null} )"
"Retrieve data from a post field based on Post ID.":
"prefix":"get_post_field"
"body":"get_post_field( ${1:\\$field}${2:, \\$post = null}${3:, \\$context = 'display'} )"
"Retrieve the format slug for a post":
"prefix":"get_post_format"
"body":"get_post_format( ${1:\\$post = null} )"
"Returns a link to a post format index.":
"prefix":"get_post_format_link"
"body":"get_post_format_link( ${1:\\$format} )"
"Retrieves an array of post format slugs.":
"prefix":"get_post_format_slugs"
"body":"get_post_format_slugs()"
"Returns a pretty, translated version of a post format slug":
"prefix":"get_post_format_string"
"body":"get_post_format_string( ${1:\\$slug} )"
"Returns an array of post format slugs to their translated and pretty display versions":
"prefix":"get_post_format_strings"
"body":"get_post_format_strings()"
"Retrieves galleries from the passed post's content.":
"prefix":"get_post_galleries"
"body":"get_post_galleries( ${1:\\$post}${2:, \\$html = true} )"
"Retrieve the image srcs from galleries from a post's content, if present":
"prefix":"get_post_galleries_images"
"body":"get_post_galleries_images( ${1:\\$post} )"
"Check a specified post's content for gallery and, if present, return the first":
"prefix":"get_post_gallery"
"body":"get_post_gallery( ${1:\\$post}${2:, \\$html = true} )"
"Checks a post's content for galleries and return the image srcs for the first found gallery":
"prefix":"get_post_gallery_images"
"body":"get_post_gallery_images( ${1:\\$post} )"
"Retrieve post meta field for a post.":
"prefix":"get_post_meta"
"body":"get_post_meta( ${1:\\$post_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Get post meta data by meta ID.":
"prefix":"get_post_meta_by_id"
"body":"get_post_meta_by_id( ${1:\\$mid} )"
"Retrieve the mime type of an attachment based on the ID.":
"prefix":"get_post_mime_type"
"body":"get_post_mime_type( ${1:\\$ID = ''} )"
"Get default post mime types.":
"prefix":"get_post_mime_types"
"body":"get_post_mime_types()"
"Retrieve the time at which the post was last modifiedre":
"prefix":"get_post_modified_time"
"body":"get_post_modified_time( ${1:\\$d = 'U'}${2:, \\$gmt = false}${3:, \\$post = null}${4:, \\$translate = false} )"
"Retrieves the permalink for a post of a custom post type.":
"prefix":"get_post_permalink"
"body":"get_post_permalink( ${1:\\$id}${2:, \\$leavename = false}${3:, \\$sample = false} )"
"Retrieve HTML content for reply to post link.":
"prefix":"get_post_reply_link"
"body":"get_post_reply_link( ${1:\\$args = array()}${2:, \\$post = null} )"
"Get a list of post statuses.":
"prefix":"get_post_stati"
"body":"get_post_stati( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieve the post status based on the Post ID.":
"prefix":"get_post_status"
"body":"get_post_status( ${1:\\$ID = ''} )"
"Retrieve a post status object by name.":
"prefix":"get_post_status_object"
"body":"get_post_status_object( ${1:\\$post_status} )"
"Retrieve all of the WordPress supported post statuses.":
"prefix":"get_post_statuses"
"body":"get_post_statuses()"
"Retrieve all taxonomies of a post with just the names.":
"prefix":"get_post_taxonomies"
"body":"get_post_taxonomies( ${1:\\$post} )"
"Retrieve post thumbnail ID.":
"prefix":"get_post_thumbnail_id"
"body":"get_post_thumbnail_id( ${1:\\$post = null} )"
"Retrieve the time at which the post was written.":
"prefix":"get_post_time"
"body":"get_post_time( ${1:\\$d = 'U'}${2:, \\$gmt = false}${3:, \\$post = null}${4:, \\$translate = false} )"
"Gets an existing post and format it for editing.":
"prefix":"get_post_to_edit"
"body":"get_post_to_edit( ${1:\\$id} )"
"Retrieves the post type of the current post or of a given post.":
"prefix":"get_post_type"
"body":"get_post_type( ${1:\\$post = null} )"
"Retrieves the permalink for a post type archive feed.":
"prefix":"get_post_type_archive_feed_link"
"body":"get_post_type_archive_feed_link( ${1:\\$post_type}${2:, \\$feed = ''} )"
"Retrieves the permalink for a post type archive.":
"prefix":"get_post_type_archive_link"
"body":"get_post_type_archive_link( ${1:\\$post_type} )"
"Retrieve path of post type archive template in current or parent template.":
"prefix":"get_post_type_archive_template"
"body":"get_post_type_archive_template()"
"Build an object with all post type capabilities out of a post type object":
"prefix":"get_post_type_capabilities"
"body":"get_post_type_capabilities( ${1:\\$args} )"
"Builds an object with all post type labels out of a post type object.":
"prefix":"get_post_type_labels"
"body":"get_post_type_labels( ${1:\\$post_type_object} )"
"Retrieves a post type object by name.":
"prefix":"get_post_type_object"
"body":"get_post_type_object( ${1:\\$post_type} )"
"Get a list of all registered post type objects.":
"prefix":"get_post_types"
"body":"get_post_types( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieves a list of post type names that support a specific feature.":
"prefix":"get_post_types_by_support"
"body":"get_post_types_by_support( ${1:\\$feature}${2:, \\$operator = 'and'} )"
"Retrieves all post data for a given post.":
"prefix":"get_postdata"
"body":"get_postdata( ${1:\\$postid} )"
"Retrieve list of latest posts or posts matching criteria.":
"prefix":"get_posts"
"body":"get_posts( ${1:\\$args = null} )"
"Retrieve the post SQL based on capability, author, and type.":
"prefix":"get_posts_by_author_sql"
"body":"get_posts_by_author_sql( ${1:\\$post_type}${2:, \\$full = true}${3:, \\$post_author = null}${4:, \\$public_only = false} )"
"Retrieves the post pages link navigation for previous and next pages.":
"prefix":"get_posts_nav_link"
"body":"get_posts_nav_link( ${1:\\$args = array()} )"
"Selects the first update version from the update_core option.":
"prefix":"get_preferred_from_update_core"
"body":"get_preferred_from_update_core()"
"Retrieves the URL used for the post preview.":
"prefix":"get_preview_post_link"
"body":"get_preview_post_link( ${1:\\$post = null}${2:, \\$query_args = array()}${3:, \\$preview_link = ''} )"
"Retrieves the link to the previous comments page.":
"prefix":"get_previous_comments_link"
"body":"get_previous_comments_link( ${1:\\$label = ''} )"
"Retrieves the previous post that is adjacent to the current post.":
"prefix":"get_previous_post"
"body":"get_previous_post( ${1:\\$in_same_term = false}${2:, \\$excluded_terms = ''}${3:, \\$taxonomy = 'category'} )"
"Retrieves the previous post link that is adjacent to the current post.":
"prefix":"get_previous_post_link"
"body":"get_previous_post_link( ${1:\\$format = '« %link'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Retrieves the previous posts link.":
"prefix":"get_previous_posts_link"
"body":"get_previous_posts_link( ${1:\\$label = null} )"
"Retrieves the previous posts page link.":
"prefix":"get_previous_posts_page_link"
"body":"get_previous_posts_page_link()"
"Retrieve the private post SQL based on capability.":
"prefix":"get_private_posts_cap_sql"
"body":"get_private_posts_cap_sql( ${1:\\$post_type} )"
"Retrieve user data based on field.":
"prefix":"get_profile"
"body":"get_profile( ${1:\\$field}${2:, \\$user = false} )"
"Retrieve URLs already pinged for a post.":
"prefix":"get_pung"
"body":"get_pung( ${1:\\$post_id} )"
"Retrieve the currently-queried object.":
"prefix":"get_queried_object"
"body":"get_queried_object()"
"Retrieve ID of the current queried object.":
"prefix":"get_queried_object_id"
"body":"get_queried_object_id()"
"Retrieve path to a template":
"prefix":"get_query_template"
"body":"get_query_template( ${1:\\$type}${2:, \\$templates = array()} )"
"Retrieve variable in the WP_Query class.":
"prefix":"get_query_var"
"body":"get_query_var( ${1:\\$var}${2:, \\$default = ''} )"
"Get random header image url from registered images in theme.":
"prefix":"get_random_header_image"
"body":"get_random_header_image()"
"Get the raw theme root relative to the content directory with no filters applied.":
"prefix":"get_raw_theme_root"
"body":"get_raw_theme_root( ${1:\\$stylesheet_or_template}${2:, \\$skip_cache = false} )"
"Get the real filesystem path to a file to edit within the admin.":
"prefix":"get_real_file_to_edit"
"body":"get_real_file_to_edit( ${1:\\$file} )"
"Retrieves a list of registered meta keys for an object type.":
"prefix":"get_registered_meta_keys"
"body":"get_registered_meta_keys( ${1:\\$object_type} )"
"Retrieves registered metadata for a specified object.":
"prefix":"get_registered_metadata"
"body":"get_registered_metadata( ${1:\\$object_type}${2:, \\$object_id}${3:, \\$meta_key = ''} )"
"Retrieves all registered navigation menu locations in a theme.":
"prefix":"get_registered_nav_menus"
"body":"get_registered_nav_menus()"
"Retrieves an array of registered settings.":
"prefix":"get_registered_settings"
"body":"get_registered_settings()"
"Retrieves the URL to a REST endpoint on a site.":
"prefix":"get_rest_url"
"body":"get_rest_url( ${1:\\$blog_id = null}${2:, \\$path = '/'}${3:, \\$scheme = 'rest'} )"
"Retrieve role object.":
"prefix":"get_role"
"body":"get_role( ${1:\\$role} )"
"Display RSS items in HTML list items.":
"prefix":"get_rss"
"body":"get_rss( ${1:\\$url}${2:, \\$num_items = 5} )"
"Get a sample permalink based off of the post name.":
"prefix":"get_sample_permalink"
"body":"get_sample_permalink( ${1:\\$id}${2:, \\$title = null}${3:, \\$name = null} )"
"Returns the HTML of the sample permalink slug editor.":
"prefix":"get_sample_permalink_html"
"body":"get_sample_permalink_html( ${1:\\$id}${2:, \\$new_title = null}${3:, \\$new_slug = null} )"
"Retrieves the screen icon (no longer used in 3.8+).":
"prefix":"get_screen_icon"
"body":"get_screen_icon()"
"Retrieves the permalink for the search results comments feed.":
"prefix":"get_search_comments_feed_link"
"body":"get_search_comments_feed_link( ${1:\\$search_query = ''}${2:, \\$feed = ''} )"
"Retrieves the permalink for the search results feed.":
"prefix":"get_search_feed_link"
"body":"get_search_feed_link( ${1:\\$search_query = ''}${2:, \\$feed = ''} )"
"Display search form.":
"prefix":"get_search_form"
"body":"get_search_form( ${1:\\$echo = true} )"
"Retrieves the permalink for a search.":
"prefix":"get_search_link"
"body":"get_search_link( ${1:\\$query = ''} )"
"Retrieves the contents of the search WordPress query variable.":
"prefix":"get_search_query"
"body":"get_search_query( ${1:\\$escaped = true} )"
"Retrieve path of search template in current or parent template.":
"prefix":"get_search_template"
"body":"get_search_template()"
"Get value based on option.":
"prefix":"get_settings"
"body":"get_settings( ${1:\\$option} )"
"Fetch settings errors registered by add_settings_error()":
"prefix":"get_settings_errors"
"body":"get_settings_errors( ${1:\\$setting = ''}${2:, \\$sanitize = false} )"
"Retrieve the shortcode attributes regex.":
"prefix":"get_shortcode_atts_regex"
"body":"get_shortcode_atts_regex()"
"Retrieve the shortcode regular expression for searching.":
"prefix":"get_shortcode_regex"
"body":"get_shortcode_regex( ${1:\\$tagnames = null} )"
"Retrieves the Press This bookmarklet link.":
"prefix":"get_shortcut_link"
"body":"get_shortcut_link()"
"Load sidebar template.":
"prefix":"get_sidebar"
"body":"get_sidebar( ${1:\\$name = null} )"
"Retrieve path of single template in current or parent template. Applies to single Posts,
single Attachments, and single custom post types.":
"prefix":"get_single_template"
"body":"get_single_template()"
"Retrieves the path of the singular template in current or parent template.":
"prefix":"get_singular_template"
"body":"get_singular_template()"
"Retrieves site data given a site ID or site object.":
"prefix":"get_site"
"body":"get_site( ${1:\\$site = null} )"
"Deprecated functionality for getting themes network-enabled themes.":
"prefix":"get_site_allowed_themes"
"body":"get_site_allowed_themes()"
"Retrieves the closest matching site object by its domain and path.":
"prefix":"get_site_by_path"
"body":"get_site_by_path( ${1:\\$domain}${2:, \\$path}${3:, \\$segments = null} )"
"Returns the Site Icon URL.":
"prefix":"get_site_icon_url"
"body":"get_site_icon_url( ${1:\\$size = 512}${2:, \\$url = ''}${3:, \\$blog_id} )"
"Retrieve an option value for the current network based on name of option.":
"prefix":"get_site_option"
"body":"get_site_option( ${1:\\$option}${2:, \\$default = false}${3:, \\$deprecated = true} )"
"Get the value of a site transient.":
"prefix":"get_site_transient"
"body":"get_site_transient( ${1:\\$transient} )"
"Retrieves the URL for a given site where WordPress application files
(e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.":
"prefix":"get_site_url"
"body":"get_site_url( ${1:\\$blog_id = null}${2:, \\$path = ''}${3:, \\$scheme = null} )"
"Retrieves a list of sites matching requested arguments.":
"prefix":"get_sites"
"body":"get_sites( ${1:\\$args = array()} )"
"Gets the network's site and user counts.":
"prefix":"get_sitestats"
"body":"get_sitestats()"
"Returns the upload quota for the current blog.":
"prefix":"get_space_allowed"
"body":"get_space_allowed()"
"Returns the space used by the current blog.":
"prefix":"get_space_used"
"body":"get_space_used()"
"Retrieve the description for the HTTP status.":
"prefix":"get_status_header_desc"
"body":"get_status_header_desc( ${1:\\$code} )"
"Retrieve name of the current stylesheet.":
"prefix":"get_stylesheet"
"body":"get_stylesheet()"
"Retrieve stylesheet directory path for current theme.":
"prefix":"get_stylesheet_directory"
"body":"get_stylesheet_directory()"
"Retrieve stylesheet directory URI.":
"prefix":"get_stylesheet_directory_uri"
"body":"get_stylesheet_directory_uri()"
"Retrieves the URI of current theme stylesheet.":
"prefix":"get_stylesheet_uri"
"body":"get_stylesheet_uri()"
"Retrieves a list of reserved site on a sub-directory Multisite install.":
"prefix":"get_subdirectory_reserved_names"
"body":"get_subdirectory_reserved_names()"
"Returns a submit button, with provided text and appropriate class":
"prefix":"get_submit_button"
"body":"get_submit_button( ${1:\\$text = ''}${2:, \\$type = 'primary large'}${3:, \\$name = 'submit'}${4:, \\$wrap = true}${5:, \\$other_attributes = ''} )"
"Retrieve a list of super admins.":
"prefix":"get_super_admins"
"body":"get_super_admins()"
"Retrieve post tag by tag ID or tag object.":
"prefix":"get_tag"
"body":"get_tag( ${1:\\$tag}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Retrieves the permalink for a tag feed.":
"prefix":"get_tag_feed_link"
"body":"get_tag_feed_link( ${1:\\$tag_id}${2:, \\$feed = ''} )"
"Retrieve the link to the tag.":
"prefix":"get_tag_link"
"body":"get_tag_link( ${1:\\$tag} )"
"Return RegEx body to liberally match an opening HTML tag.":
"prefix":"get_tag_regex"
"body":"get_tag_regex( ${1:\\$tag} )"
"Retrieve path of tag template in current or parent template.":
"prefix":"get_tag_template"
"body":"get_tag_template()"
"Retrieves all post tags.":
"prefix":"get_tags"
"body":"get_tags( ${1:\\$args = ''} )"
"Get comma-separated list of tags available to edit.":
"prefix":"get_tags_to_edit"
"body":"get_tags_to_edit( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'} )"
"Given a taxonomy query, generates SQL to be appended to a main query.":
"prefix":"get_tax_sql"
"body":"get_tax_sql( ${1:\\$tax_query}${2:, \\$primary_table}${3:, \\$primary_id_column} )"
"Retrieves a list of registered taxonomy names or objects.":
"prefix":"get_taxonomies"
"body":"get_taxonomies( ${1:\\$args = array()}${2:, \\$output = 'names'}${3:, \\$operator = 'and'} )"
"Retrieves all of the taxonomy names that are registered for attachments.":
"prefix":"get_taxonomies_for_attachments"
"body":"get_taxonomies_for_attachments( ${1:\\$output = 'names'} )"
"Retrieves the taxonomy object of $taxonomy.":
"prefix":"get_taxonomy"
"body":"get_taxonomy( ${1:\\$taxonomy} )"
"Builds an object with all taxonomy labels out of a taxonomy object.":
"prefix":"get_taxonomy_labels"
"body":"get_taxonomy_labels( ${1:\\$tax} )"
"Retrieve path of custom taxonomy term template in current or parent template.":
"prefix":"get_taxonomy_template"
"body":"get_taxonomy_template()"
"Determine a writable directory for temporary files.":
"prefix":"get_temp_dir"
"body":"get_temp_dir()"
"Retrieve name of the current theme.":
"prefix":"get_template"
"body":"get_template()"
"Retrieve current theme directory.":
"prefix":"get_template_directory"
"body":"get_template_directory()"
"Retrieve theme directory URI.":
"prefix":"get_template_directory_uri"
"body":"get_template_directory_uri()"
"Loads a template part into a template.":
"prefix":"get_template_part"
"body":"get_template_part( ${1:\\$slug}${2:, \\$name = null} )"
"Get all Term data from database by Term ID.":
"prefix":"get_term"
"body":"get_term( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$output = OBJECT}${4:, \\$filter = 'raw'} )"
"Get all Term data from database by Term field and data.":
"prefix":"get_term_by"
"body":"get_term_by( ${1:\\$field}${2:, \\$value}${3:, \\$taxonomy = ''}${4:, \\$output = OBJECT}${5:, \\$filter = 'raw'} )"
"Merge all term children into a single array of their IDs.":
"prefix":"get_term_children"
"body":"get_term_children( ${1:\\$term_id}${2:, \\$taxonomy} )"
"Retrieves the feed link for a term.":
"prefix":"get_term_feed_link"
"body":"get_term_feed_link( ${1:\\$term_id}${2:, \\$taxonomy = 'category'}${3:, \\$feed = ''} )"
"Get sanitized Term field.":
"prefix":"get_term_field"
"body":"get_term_field( ${1:\\$field}${2:, \\$term}${3:, \\$taxonomy = ''}${4:, \\$context = 'display'} )"
"Generate a permalink for a taxonomy term archive.":
"prefix":"get_term_link"
"body":"get_term_link( ${1:\\$term}${2:, \\$taxonomy = ''} )"
"Retrieves metadata for a term.":
"prefix":"get_term_meta"
"body":"get_term_meta( ${1:\\$term_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Retrieve term parents with separator.":
"prefix":"get_term_parents_list"
"body":"get_term_parents_list( ${1:\\$term_id}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Sanitizes Term for editing.":
"prefix":"get_term_to_edit"
"body":"get_term_to_edit( ${1:\\$id}${2:, \\$taxonomy} )"
"Retrieve the terms in a given taxonomy or list of taxonomies.":
"prefix":"get_terms"
"body":"get_terms( ${1:\\$args = array()}${2:, \\$deprecated = ''} )"
"Get comma-separated list of terms available to edit for the given post ID.":
"prefix":"get_terms_to_edit"
"body":"get_terms_to_edit( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'} )"
"Retrieves the description for an author, post type, or term archive.":
"prefix":"get_the_archive_description"
"body":"get_the_archive_description()"
"Retrieve the archive title based on the queried object.":
"prefix":"get_the_archive_title"
"body":"get_the_archive_title()"
"Retrieve HTML content of attachment image with link.":
"prefix":"get_the_attachment_link"
"body":"get_the_attachment_link( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$max_dims = false}${4:, \\$permalink = false} )"
"Retrieve the author of the current post.":
"prefix":"get_the_author"
"body":"get_the_author( ${1:\\$deprecated = ''} )"
"Retrieve the AIM address of the author of the current post.":
"prefix":"get_the_author_aim"
"body":"get_the_author_aim()"
"Retrieve the description of the author of the current post.":
"prefix":"get_the_author_description"
"body":"get_the_author_description()"
"Retrieve the email of the author of the current post.":
"prefix":"get_the_author_email"
"body":"get_the_author_email()"
"Retrieve the first name of the author of the current post.":
"prefix":"get_the_author_firstname"
"body":"get_the_author_firstname()"
"Retrieve the ICQ number of the author of the current post.":
"prefix":"get_the_author_icq"
"body":"get_the_author_icq()"
"Retrieve the ID of the author of the current post.":
"prefix":"get_the_author_id"
"body":"get_the_author_id()"
"Retrieve the last name of the author of the current post.":
"prefix":"get_the_author_lastname"
"body":"get_the_author_lastname()"
"Retrieve either author's link or author's name.":
"prefix":"get_the_author_link"
"body":"get_the_author_link()"
"Retrieve the login name of the author of the current post.":
"prefix":"get_the_author_login"
"body":"get_the_author_login()"
"Retrieves the requested data of the author of the current post.":
"prefix":"get_the_author_meta"
"body":"get_the_author_meta( ${1:\\$field = ''}${2:, \\$user_id = false} )"
"Retrieve the MSN address of the author of the current post.":
"prefix":"get_the_author_msn"
"body":"get_the_author_msn()"
"Retrieve the nickname of the author of the current post.":
"prefix":"get_the_author_nickname"
"body":"get_the_author_nickname()"
"Retrieve the number of posts by the author of the current post.":
"prefix":"get_the_author_posts"
"body":"get_the_author_posts()"
"Retrieves an HTML link to the author page of the current post's author.":
"prefix":"get_the_author_posts_link"
"body":"get_the_author_posts_link()"
"Retrieve the URL to the home page of the author of the current post.":
"prefix":"get_the_author_url"
"body":"get_the_author_url()"
"Retrieve the Yahoo! IM name of the author of the current post.":
"prefix":"get_the_author_yim"
"body":"get_the_author_yim()"
"Retrieve post categories.":
"prefix":"get_the_category"
"body":"get_the_category( ${1:\\$id = false} )"
"Retrieve category name based on category ID.":
"prefix":"get_the_category_by_id"
"body":"get_the_category_by_id( ${1:\\$cat_ID} )"
"Retrieve category list for a post in either HTML list or custom format.":
"prefix":"get_the_category_list"
"body":"get_the_category_list( ${1:\\$separator = ''}${2:, \\$parents = ''}${3:, \\$post_id = false} )"
"Retrieve all of the post categories, formatted for use in feeds.":
"prefix":"get_the_category_rss"
"body":"get_the_category_rss( ${1:\\$type = null} )"
"Retrieves navigation to next/previous set of comments, when applicable.":
"prefix":"get_the_comments_navigation"
"body":"get_the_comments_navigation( ${1:\\$args = array()} )"
"Retrieves a paginated navigation to next/previous set of comments, when applicable.":
"prefix":"get_the_comments_pagination"
"body":"get_the_comments_pagination( ${1:\\$args = array()} )"
"Retrieve the post content.":
"prefix":"get_the_content"
"body":"get_the_content( ${1:\\$more_link_text = null}${2:, \\$strip_teaser = false} )"
"Retrieve the post content for feeds.":
"prefix":"get_the_content_feed"
"body":"get_the_content_feed( ${1:\\$feed_type = null} )"
"Retrieve the date on which the post was written.":
"prefix":"get_the_date"
"body":"get_the_date( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieves the post excerpt.":
"prefix":"get_the_excerpt"
"body":"get_the_excerpt( ${1:\\$post = null} )"
"Creates the generator XML or Comment for RSS, ATOM, etc.":
"prefix":"get_the_generator"
"body":"get_the_generator( ${1:\\$type = ''} )"
"Retrieve the Post Global Unique Identifier (guid).":
"prefix":"get_the_guid"
"body":"get_the_guid( ${1:\\$post} )"
"Retrieve the ID of the current item in the WordPress Loop.":
"prefix":"get_the_id"
"body":"get_the_id()"
"Retrieve the author who last edited the current post.":
"prefix":"get_the_modified_author"
"body":"get_the_modified_author()"
"Retrieve the date on which the post was last modified.":
"prefix":"get_the_modified_date"
"body":"get_the_modified_date( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve the time at which the post was last modified.":
"prefix":"get_the_modified_time"
"body":"get_the_modified_time( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve protected post password form content.":
"prefix":"get_the_password_form"
"body":"get_the_password_form( ${1:\\$post} )"
"Retrieves the full permalink for the current post or post ID":
"prefix":"get_the_permalink"
"body":"get_the_permalink( ${1:\\$post}${2:, \\$leavename = false} )"
"Retrieves the navigation to next/previous post, when applicable.":
"prefix":"get_the_post_navigation"
"body":"get_the_post_navigation( ${1:\\$args = array()} )"
"Retrieve the post thumbnail.":
"prefix":"get_the_post_thumbnail"
"body":"get_the_post_thumbnail( ${1:\\$post = null}${2:, \\$size = 'post-thumbnail'}${3:, \\$attr = ''} )"
"Returns the post thumbnail caption.":
"prefix":"get_the_post_thumbnail_caption"
"body":"get_the_post_thumbnail_caption( ${1:\\$post = null} )"
"Return the post thumbnail URL.":
"prefix":"get_the_post_thumbnail_url"
"body":"get_the_post_thumbnail_url( ${1:\\$post = null}${2:, \\$size = 'post-thumbnail'} )"
"Returns the navigation to next/previous set of posts, when applicable.":
"prefix":"get_the_posts_navigation"
"body":"get_the_posts_navigation( ${1:\\$args = array()} )"
"Retrieves a paginated navigation to next/previous set of posts, when applicable.":
"prefix":"get_the_posts_pagination"
"body":"get_the_posts_pagination( ${1:\\$args = array()} )"
"Retrieve the tags for a post formatted as a string.":
"prefix":"get_the_tag_list"
"body":"get_the_tag_list( ${1:\\$before = ''}${2:, \\$sep = ''}${3:, \\$after = ''}${4:, \\$id} )"
"Retrieve the tags for a post. get_the_tags":
"prefix":"get_the_tags"
"body":"get_the_tags( ${1:\\$id} )"
"Retrieve all taxonomies associated with a post.":
"prefix":"get_the_taxonomies"
"body":"get_the_taxonomies( ${1:\\$post}${2:, \\$args = array()} )"
"Retrieve a post's terms as a list with specified format.":
"prefix":"get_the_term_list"
"body":"get_the_term_list( ${1:\\$id}${2:, \\$taxonomy}${3:, \\$before = ''}${4:, \\$sep = ''}${5:, \\$after = ''} )"
"Retrieve the terms of the taxonomy that are attached to the post.":
"prefix":"get_the_terms"
"body":"get_the_terms( ${1:\\$post}${2:, \\$taxonomy} )"
"Retrieve the time at which the post was written":
"prefix":"get_the_time"
"body":"get_the_time( ${1:\\$d = ''}${2:, \\$post = null} )"
"Retrieve post title.":
"prefix":"get_the_title"
"body":"get_the_title( ${1:\\$post} )"
"Retrieve the current post title for the feed.":
"prefix":"get_the_title_rss"
"body":"get_the_title_rss()"
"Retrieve theme data.":
"prefix":"get_theme"
"body":"get_theme( ${1:\\$theme} )"
"Retrieve theme data from parsed theme file.":
"prefix":"get_theme_data"
"body":"get_theme_data( ${1:\\$theme_file} )"
"Retrieve list of WordPress theme features (aka theme tags)":
"prefix":"get_theme_feature_list"
"body":"get_theme_feature_list( ${1:\\$api = true} )"
"Retrieves the path of a file in the theme.":
"prefix":"get_theme_file_path"
"body":"get_theme_file_path( ${1:\\$file = ''} )"
"Retrieves the URL of a file in the theme.":
"prefix":"get_theme_file_uri"
"body":"get_theme_file_uri( ${1:\\$file = ''} )"
"Retrieve theme modification value for the current theme.":
"prefix":"get_theme_mod"
"body":"get_theme_mod( ${1:\\$name}${2:, \\$default = false} )"
"Retrieve all theme modifications.":
"prefix":"get_theme_mods"
"body":"get_theme_mods()"
"Retrieve path to themes directory.":
"prefix":"get_theme_root"
"body":"get_theme_root( ${1:\\$stylesheet_or_template = false} )"
"Retrieve URI for themes directory.":
"prefix":"get_theme_root_uri"
"body":"get_theme_root_uri( ${1:\\$stylesheet_or_template = false}${2:, \\$theme_root = false} )"
"Retrieve theme roots.":
"prefix":"get_theme_roots"
"body":"get_theme_roots()"
"Expand a theme's starter content configuration using core-provided data.":
"prefix":"get_theme_starter_content"
"body":"get_theme_starter_content()"
"Gets the theme support arguments passed when registering that support":
"prefix":"get_theme_support"
"body":"get_theme_support( ${1:\\$feature} )"
"Retrieve the update link if there is a theme update available.":
"prefix":"get_theme_update_available"
"body":"get_theme_update_available( ${1:\\$theme} )"
"get_theme_updates":
"prefix":"get_theme_updates"
"body":"get_theme_updates()"
"Retrieve list of themes with theme data in theme directory.":
"prefix":"get_themes"
"body":"get_themes()"
"Retrieve URLs that need to be pinged.":
"prefix":"get_to_ping"
"body":"get_to_ping( ${1:\\$post_id} )"
"Retrieve The current post's trackback URL.":
"prefix":"get_trackback_url"
"body":"get_trackback_url()"
"Get the value of a transient.":
"prefix":"get_transient"
"body":"get_transient( ${1:\\$transient} )"
"Return the Translations instance for a text domain.":
"prefix":"get_translations_for_domain"
"body":"get_translations_for_domain( ${1:\\$domain} )"
"Calculated the new dimensions for a downsampled image.":
"prefix":"get_udims"
"body":"get_udims( ${1:\\$width}${2:, \\$height} )"
"get_upload_iframe_src":
"prefix":"get_upload_iframe_src"
"body":"get_upload_iframe_src( ${1:\\$type = null}${2:, \\$post_id = null}${3:, \\$tab = null} )"
"Determines if there is any upload space left in the current blog's quota":
"prefix":"get_upload_space_available"
"body":"get_upload_space_available()"
"Get the header images uploaded for the current theme.":
"prefix":"get_uploaded_header_images"
"body":"get_uploaded_header_images()"
"Extract and return the first URL from passed content.":
"prefix":"get_url_in_content"
"body":"get_url_in_content( ${1:\\$content} )"
"Retrieve user info by a given field":
"prefix":"get_user_by"
"body":"get_user_by( ${1:\\$field}${2:, \\$value} )"
"Retrieve user info by email.":
"prefix":"get_user_by_email"
"body":"get_user_by_email( ${1:\\$email} )"
"The number of active users in your installation.":
"prefix":"get_user_count"
"body":"get_user_count( ${1:\\$network_id = null} )"
"Deprecated functionality to retrieve user information.":
"prefix":"get_user_details"
"body":"get_user_details( ${1:\\$username} )"
"Get a numeric user ID from either an email address or a login.":
"prefix":"get_user_id_from_string"
"body":"get_user_id_from_string( ${1:\\$string} )"
"Retrieves the locale of a user.":
"prefix":"get_user_locale"
"body":"get_user_locale( ${1:\\$user_id} )"
"Retrieve user meta field for a user.":
"prefix":"get_user_meta"
"body":"get_user_meta( ${1:\\$user_id}${2:, \\$key = ''}${3:, \\$single = false} )"
"Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users":
"prefix":"get_user_metavalues"
"body":"get_user_metavalues( ${1:\\$ids} )"
"Retrieve user option that can be either per Site or per Network.":
"prefix":"get_user_option"
"body":"get_user_option( ${1:\\$option}${2:, \\$user}${3:, \\$deprecated = ''} )"
"Retrieve user interface setting value based on setting name.":
"prefix":"get_user_setting"
"body":"get_user_setting( ${1:\\$name}${2:, \\$default = false} )"
"Retrieve user data and filter it.":
"prefix":"get_user_to_edit"
"body":"get_user_to_edit( ${1:\\$user_id} )"
"Retrieve user info by user ID.":
"prefix":"get_userdata"
"body":"get_userdata( ${1:\\$user_id} )"
"Retrieve user info by login name.":
"prefix":"get_userdatabylogin"
"body":"get_userdatabylogin( ${1:\\$user_login} )"
"Retrieve user metadata.":
"prefix":"get_usermeta"
"body":"get_usermeta( ${1:\\$user_id}${2:, \\$meta_key = ''} )"
"Retrieves the number of posts a user has written.":
"prefix":"get_usernumposts"
"body":"get_usernumposts( ${1:\\$userid} )"
"Retrieve list of users matching criteria.":
"prefix":"get_users"
"body":"get_users( ${1:\\$args = array()} )"
"Retrieve the user's drafts.":
"prefix":"get_users_drafts"
"body":"get_users_drafts( ${1:\\$user_id} )"
"Get users for the site.":
"prefix":"get_users_of_blog"
"body":"get_users_of_blog( ${1:\\$id = ''} )"
"Get the week start and end from the datetime or date string from MySQL.":
"prefix":"get_weekstartend"
"body":"get_weekstartend( ${1:\\$mysqlstring}${2:, \\$start_of_week = ''} )"
"Retrieve the blog title for the feed title.":
"prefix":"get_wp_title_rss"
"body":"get_wp_title_rss( ${1:\\$deprecated = '–'} )"
"Retrieves the permalink for the year archives.":
"prefix":"get_year_link"
"body":"get_year_link( ${1:\\$year} )"
"Maintains a canonical list of terms by syncing terms created for each blog with the global terms table.":
"prefix":"global_terms"
"body":"global_terms( ${1:\\$term_id}${2:, \\$deprecated = ''} )"
"Determine whether global terms are enabled.":
"prefix":"global_terms_enabled"
"body":"global_terms_enabled()"
"Returns whether the server is running Apache with the mod_rewrite module loaded.":
"prefix":"got_mod_rewrite"
"body":"got_mod_rewrite()"
"Returns whether the server supports URL rewriting.":
"prefix":"got_url_rewrite"
"body":"got_url_rewrite()"
"Deprecated functionality to gracefully fail.":
"prefix":"graceful_fail"
"body":"graceful_fail()"
"Grants Super Admin privileges.":
"prefix":"grant_super_admin"
"body":"grant_super_admin( ${1:\\$user_id} )"
"Unused function.":
"prefix":"gzip_compression"
"body":"gzip_compression()"
"Check if any action has been registered for a hook.":
"prefix":"has_action"
"body":"has_action( ${1:\\$tag}${2:, \\$function_to_check = false} )"
"Check if the current post has any of given category.":
"prefix":"has_category"
"body":"has_category( ${1:\\$category = ''}${2:, \\$post = null} )"
"Check whether a custom header is set or not.":
"prefix":"has_custom_header"
"body":"has_custom_header()"
"Determines whether the site has a custom logo.":
"prefix":"has_custom_logo"
"body":"has_custom_logo( ${1:\\$blog_id} )"
"Whether the post has a custom excerpt.":
"prefix":"has_excerpt"
"body":"has_excerpt( ${1:\\$post} )"
"Check if any filter has been registered for a hook.":
"prefix":"has_filter"
"body":"has_filter( ${1:\\$tag}${2:, \\$function_to_check = false} )"
"Check whether a header image is set or not.":
"prefix":"has_header_image"
"body":"has_header_image()"
"Check whether a header video is set or not.":
"prefix":"has_header_video"
"body":"has_header_video()"
"Check if an image size exists.":
"prefix":"has_image_size"
"body":"has_image_size( ${1:\\$name} )"
"Get meta data for the given post ID.":
"prefix":"has_meta"
"body":"has_meta( ${1:\\$postid} )"
"Determines whether a registered nav menu location has a menu assigned to it.":
"prefix":"has_nav_menu"
"body":"has_nav_menu( ${1:\\$location} )"
"Check if a post has any of the given formats, or any format.":
"prefix":"has_post_format"
"body":"has_post_format( ${1:\\$format = array()}${2:, \\$post = null} )"
"Check if post has an image attached.":
"prefix":"has_post_thumbnail"
"body":"has_post_thumbnail( ${1:\\$post = null} )"
"Whether the passed content contains the specified shortcode":
"prefix":"has_shortcode"
"body":"has_shortcode( ${1:\\$content}${2:, \\$tag} )"
"Whether the site has a Site Icon.":
"prefix":"has_site_icon"
"body":"has_site_icon( ${1:\\$blog_id} )"
"Check if the current post has any of given tags.":
"prefix":"has_tag"
"body":"has_tag( ${1:\\$tag = ''}${2:, \\$post = null} )"
"Check if the current post has any of given terms.":
"prefix":"has_term"
"body":"has_term( ${1:\\$term = ''}${2:, \\$taxonomy = ''}${3:, \\$post = null} )"
"Get all meta data, including meta IDs, for the given term ID.":
"prefix":"has_term_meta"
"body":"has_term_meta( ${1:\\$term_id} )"
"Timing attack safe string comparison":
"prefix":"hash_equals"
"body":"hash_equals( ${1:\\$a}${2:, \\$b} )"
"Whether there are comments to loop over.":
"prefix":"have_comments"
"body":"have_comments()"
"Whether current WordPress query has results to loop over.":
"prefix":"have_posts"
"body":"have_posts()"
"Display header image URL.":
"prefix":"header_image"
"body":"header_image()"
"Displays the custom header text color in 3- or 6-digit hexadecimal form (minus the hash symbol).":
"prefix":"header_textcolor"
"body":"header_textcolor()"
"Autosave with heartbeat":
"prefix":"heartbeat_autosave"
"body":"heartbeat_autosave( ${1:\\$response}${2:, \\$data} )"
"Retrieves the URL for the current site where the front end is accessible.":
"prefix":"home_url"
"body":"home_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Display the HTML type based on the blog setting.":
"prefix":"html_type_rss"
"body":"html_type_rss()"
"Convert entities, while preserving already-encoded entities.":
"prefix":"htmlentities2"
"body":"htmlentities2( ${1:\\$myHTML} )"
"Determines the difference between two timestamps.":
"prefix":"human_time_diff"
"body":"human_time_diff( ${1:\\$from}${2:, \\$to = ''} )"
"Generic Iframe footer for use with Thickbox":
"prefix":"iframe_footer"
"body":"iframe_footer()"
"Generic Iframe header for use with Thickbox":
"prefix":"iframe_header"
"body":"iframe_header( ${1:\\$title = ''}${2:, \\$deprecated = false} )"
"Add WordPress rewrite rule to the IIS 7+ configuration file.":
"prefix":"iis7_add_rewrite_rule"
"body":"iis7_add_rewrite_rule( ${1:\\$filename}${2:, \\$rewrite_rule} )"
"Delete WordPress rewrite rule from web.config file if it exists there":
"prefix":"iis7_delete_rewrite_rule"
"body":"iis7_delete_rewrite_rule( ${1:\\$filename} )"
"Check if rewrite rule for WordPress already exists in the IIS 7+ configuration file":
"prefix":"iis7_rewrite_rule_exists"
"body":"iis7_rewrite_rule_exists( ${1:\\$filename} )"
"Updates the IIS web.config file with the current rules if it is writable.":
"prefix":"iis7_save_url_rewrite_rules"
"body":"iis7_save_url_rewrite_rules()"
"Check if IIS 7+ supports pretty permalinks.":
"prefix":"iis7_supports_permalinks"
"body":"iis7_supports_permalinks()"
"Adds image shortcode with caption to editor":
"prefix":"image_add_caption"
"body":"image_add_caption( ${1:\\$html}${2:, \\$id}${3:, \\$caption}${4:, \\$title}${5:, \\$align}${6:, \\$url}${7:, \\$size}${8:, \\$alt = ''} )"
"Retrieve HTML for the image alignment radio buttons with the specified one checked.":
"prefix":"image_align_input_fields"
"body":"image_align_input_fields( ${1:\\$post}${2:, \\$checked = ''} )"
"Retrieves the image attachment fields to edit form fields.":
"prefix":"image_attachment_fields_to_edit"
"body":"image_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Filters input from media_upload_form_handler() and assigns a default
post_title from the file name if none supplied.":
"prefix":"image_attachment_fields_to_save"
"body":"image_attachment_fields_to_save( ${1:\\$post}${2:, \\$attachment} )"
"Scale down the default size of an image.":
"prefix":"image_constrain_size_for_editor"
"body":"image_constrain_size_for_editor( ${1:\\$width}${2:, \\$height}${3:, \\$size = 'medium'}${4:, \\$context = null} )"
"Scale an image to fit a particular size (such as 'thumb' or 'medium').":
"prefix":"image_downsize"
"body":"image_downsize( ${1:\\$id}${2:, \\$size = 'medium'} )"
"Performs group of changes on Editor specified.":
"prefix":"image_edit_apply_changes"
"body":"image_edit_apply_changes( ${1:\\$image}${2:, \\$changes} )"
"Retrieves the image's intermediate size (resized) path, width, and height.":
"prefix":"image_get_intermediate_size"
"body":"image_get_intermediate_size( ${1:\\$post_id}${2:, \\$size = 'thumbnail'} )"
"Retrieve width and height attributes using given width and height values.":
"prefix":"image_hwstring"
"body":"image_hwstring( ${1:\\$width}${2:, \\$height} )"
"Retrieve HTML for the Link URL buttons with the default link type as specified.":
"prefix":"image_link_input_fields"
"body":"image_link_input_fields( ${1:\\$post}${2:, \\$url_type = ''} )"
"Resizes an image to make a thumbnail or intermediate size.":
"prefix":"image_make_intermediate_size"
"body":"image_make_intermediate_size( ${1:\\$file}${2:, \\$width}${3:, \\$height}${4:, \\$crop = false} )"
"Retrieves the media element HTML to send to the editor.":
"prefix":"image_media_send_to_editor"
"body":"image_media_send_to_editor( ${1:\\$html}${2:, \\$attachment_id}${3:, \\$attachment} )"
"Scale down an image to fit a particular size and save a new copy of the image.":
"prefix":"image_resize"
"body":"image_resize( ${1:\\$file}${2:, \\$max_w}${3:, \\$max_h}${4:, \\$crop = false}${5:, \\$suffix = null}${6:, \\$dest_path = null}${7:, \\$jpeg_quality = 90} )"
"Retrieves calculated resize dimensions for use in WP_Image_Editor.":
"prefix":"image_resize_dimensions"
"body":"image_resize_dimensions( ${1:\\$orig_w}${2:, \\$orig_h}${3:, \\$dest_w}${4:, \\$dest_h}${5:, \\$crop = false} )"
"Retrieve HTML for the size radio buttons with the specified one checked.":
"prefix":"image_size_input_fields"
"body":"image_size_input_fields( ${1:\\$post}${2:, \\$check = ''} )"
"Builds the Caption shortcode output.":
"prefix":"img_caption_shortcode"
"body":"img_caption_shortcode( ${1:\\$attr}${2:, \\$content = null} )"
"Check if the current post is within any of the given categories.":
"prefix":"in_category"
"body":"in_category( ${1:\\$category}${2:, \\$post = null} )"
"Whether the caller is in the Loop.":
"prefix":"in_the_loop"
"body":"in_the_loop()"
"Retrieves the URL to the includes directory.":
"prefix":"includes_url"
"body":"includes_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Display relational link for the site index.":
"prefix":"index_rel_link"
"body":"index_rel_link()"
"Store basic site info in the blogs table.":
"prefix":"insert_blog"
"body":"insert_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$site_id} )"
"Inserts an array of strings into a file (.htaccess ), placing it between
BEGIN and END markers.":
"prefix":"insert_with_markers"
"body":"insert_with_markers( ${1:\\$filename}${2:, \\$marker}${3:, \\$insertion} )"
"Install an empty blog.":
"prefix":"install_blog"
"body":"install_blog( ${1:\\$blog_id}${2:, \\$blog_title = ''} )"
"Set blog defaults.":
"prefix":"install_blog_defaults"
"body":"install_blog_defaults( ${1:\\$blog_id}${2:, \\$user_id} )"
"install_dashboard":
"prefix":"install_dashboard"
"body":"install_dashboard()"
"Install global terms.":
"prefix":"install_global_terms"
"body":"install_global_terms()"
"Install Network.":
"prefix":"install_network"
"body":"install_network()"
"Display plugin information in dialog box form.":
"prefix":"install_plugin_information"
"body":"install_plugin_information()"
"Determine the status we can perform on a plugin.":
"prefix":"install_plugin_install_status"
"body":"install_plugin_install_status( ${1:\\$api}${2:, \\$loop = false} )"
"Show a username form for the favorites page":
"prefix":"install_plugins_favorites_form"
"body":"install_plugins_favorites_form()"
"Upload from zip":
"prefix":"install_plugins_upload"
"body":"install_plugins_upload()"
"Retrieve popular WordPress plugin tags.":
"prefix":"install_popular_tags"
"body":"install_popular_tags( ${1:\\$args = array()} )"
"Displays a search form for searching plugins.":
"prefix":"install_search_form"
"body":"install_search_form( ${1:\\$deprecated = true} )"
"Display theme information in dialog box form.":
"prefix":"install_theme_information"
"body":"install_theme_information()"
"Display search form for searching themes.":
"prefix":"install_theme_search_form"
"body":"install_theme_search_form( ${1:\\$type_selector = true} )"
"Display tags filter for themes.":
"prefix":"install_themes_dashboard"
"body":"install_themes_dashboard()"
"Retrieve list of WordPress theme features (aka theme tags).":
"prefix":"install_themes_feature_list"
"body":"install_themes_feature_list()"
"install_themes_upload":
"prefix":"install_themes_upload"
"body":"install_themes_upload()"
"Is the query a 404 (returns no results)?":
"prefix":"is_404"
"body":"is_404()"
"Whether a sidebar is in use.":
"prefix":"is_active_sidebar"
"body":"is_active_sidebar( ${1:\\$index} )"
"Whether widget is displayed on the front end.":
"prefix":"is_active_widget"
"body":"is_active_widget( ${1:\\$callback = false}${2:, \\$widget_id = false}${3:, \\$id_base = false}${4:, \\$skip_inactive = true} )"
"Whether the current request is for an administrative interface page.":
"prefix":"is_admin"
"body":"is_admin()"
"Determine whether the admin bar should be showing.":
"prefix":"is_admin_bar_showing"
"body":"is_admin_bar_showing()"
"Determines if the HTTP origin is an authorized one.":
"prefix":"is_allowed_http_origin"
"body":"is_allowed_http_origin( ${1:\\$origin = null} )"
"Is the query for an existing archive page?":
"prefix":"is_archive"
"body":"is_archive()"
"Check if a particular blog is archived.":
"prefix":"is_archived"
"body":"is_archived( ${1:\\$id} )"
"Is the query for an existing attachment page?":
"prefix":"is_attachment"
"body":"is_attachment( ${1:\\$attachment = ''} )"
"Is the query for an existing author archive page?":
"prefix":"is_author"
"body":"is_author( ${1:\\$author = ''} )"
"Whether the current request is for a site's admininstrative interface.":
"prefix":"is_blog_admin"
"body":"is_blog_admin()"
"Test whether WordPress is already installed.":
"prefix":"is_blog_installed"
"body":"is_blog_installed()"
"Checks if the current user belong to a given site.":
"prefix":"is_blog_user"
"body":"is_blog_user( ${1:\\$blog_id} )"
"Is the query for an existing category archive page?":
"prefix":"is_category"
"body":"is_category( ${1:\\$category = ''} )"
"Whether a child theme is in use.":
"prefix":"is_child_theme"
"body":"is_child_theme()"
"is_client_error":
"prefix":"is_client_error"
"body":"is_client_error()"
"Is the query for a comments feed?":
"prefix":"is_comment_feed"
"body":"is_comment_feed()"
"Whether the current URL is within the comments popup window.":
"prefix":"is_comments_popup"
"body":"is_comments_popup()"
"Whether the site is being previewed in the Customizer.":
"prefix":"is_customize_preview"
"body":"is_customize_preview()"
"Is the query for an existing date archive?":
"prefix":"is_date"
"body":"is_date()"
"Is the query for an existing day archive?":
"prefix":"is_day"
"body":"is_day()"
"Whether the dynamic sidebar is enabled and used by theme.":
"prefix":"is_dynamic_sidebar"
"body":"is_dynamic_sidebar()"
"Verifies that an email is valid.":
"prefix":"is_email"
"body":"is_email( ${1:\\$email}${2:, \\$deprecated = false} )"
"Checks an email address against a list of banned domains.":
"prefix":"is_email_address_unsafe"
"body":"is_email_address_unsafe( ${1:\\$user_email} )"
"Is the query for an embedded post?":
"prefix":"is_embed"
"body":"is_embed()"
"is_error":
"prefix":"is_error"
"body":"is_error()"
"Is the query for a feed?":
"prefix":"is_feed"
"body":"is_feed( ${1:\\$feeds = ''} )"
"Is the query for the front page of the site?":
"prefix":"is_front_page"
"body":"is_front_page()"
"Checks whether the custom header video is eligible to show on the current page.":
"prefix":"is_header_video_active"
"body":"is_header_video_active()"
"Determines if the query is for the blog homepage.":
"prefix":"is_home"
"body":"is_home()"
"is_info":
"prefix":"is_info"
"body":"is_info()"
"Is the server running earlier than 1.5.0 version of lighttpd?":
"prefix":"is_lighttpd_before_150"
"body":"is_lighttpd_before_150()"
"Check if the attachment URI is local one and is really an attachment.":
"prefix":"is_local_attachment"
"body":"is_local_attachment( ${1:\\$url} )"
"Whether switch_to_locale() is in effect.":
"prefix":"is_locale_switched"
"body":"is_locale_switched()"
"Deprecated functionality to determin if the current site is the main site.":
"prefix":"is_main_blog"
"body":"is_main_blog()"
"Determine whether a network is the main network of the Multisite install.":
"prefix":"is_main_network"
"body":"is_main_network( ${1:\\$network_id = null} )"
"Is the query the main query?":
"prefix":"is_main_query"
"body":"is_main_query()"
"Determine whether a site is the main site of the current network.":
"prefix":"is_main_site"
"body":"is_main_site( ${1:\\$site_id = null} )"
"Is the query for an existing month archive?":
"prefix":"is_month"
"body":"is_month()"
"Does this site have more than one author":
"prefix":"is_multi_author"
"body":"is_multi_author()"
"If Multisite is enabled.":
"prefix":"is_multisite"
"body":"is_multisite()"
"Check if the given ID is a navigation menu.":
"prefix":"is_nav_menu"
"body":"is_nav_menu( ${1:\\$menu} )"
"Determines whether the given ID is a nav menu item.":
"prefix":"is_nav_menu_item"
"body":"is_nav_menu_item( ${1:\\$menu_item_id} )"
"Whether the current request is for the network administrative interface.":
"prefix":"is_network_admin"
"body":"is_network_admin()"
"Checks for "Network: true" in the plugin header to see if this should
be activated only as a network wide plugin. The plugin would also work
when Multisite is not enabled.":
"prefix":"is_network_only_plugin"
"body":"is_network_only_plugin( ${1:\\$plugin} )"
"Whether the publish date of the current post in the loop is different from the
publish date of the previous post in the loop.":
"prefix":"is_new_day"
"body":"is_new_day()"
"Determine if the given object type is associated with the given taxonomy.":
"prefix":"is_object_in_taxonomy"
"body":"is_object_in_taxonomy( ${1:\\$object_type}${2:, \\$taxonomy} )"
"Determine if the given object is associated with any of the given terms.":
"prefix":"is_object_in_term"
"body":"is_object_in_term( ${1:\\$object_id}${2:, \\$taxonomy}${3:, \\$terms = null} )"
"Is the query for an existing single page?":
"prefix":"is_page"
"body":"is_page( ${1:\\$page = ''} )"
"Whether currently in a page template.":
"prefix":"is_page_template"
"body":"is_page_template( ${1:\\$template = ''} )"
"Is the query for paged result and not for the first page?":
"prefix":"is_paged"
"body":"is_paged()"
"Check whether a plugin is active.":
"prefix":"is_plugin_active"
"body":"is_plugin_active( ${1:\\$plugin} )"
"Check whether the plugin is active for the entire network.":
"prefix":"is_plugin_active_for_network"
"body":"is_plugin_active_for_network( ${1:\\$plugin} )"
"Check whether the plugin is inactive.":
"prefix":"is_plugin_inactive"
"body":"is_plugin_inactive( ${1:\\$plugin} )"
"Is the current admin page generated by a plugin?":
"prefix":"is_plugin_page"
"body":"is_plugin_page()"
"Is the query for an existing post type archive page?":
"prefix":"is_post_type_archive"
"body":"is_post_type_archive( ${1:\\$post_types = ''} )"
"Whether the post type is hierarchical.":
"prefix":"is_post_type_hierarchical"
"body":"is_post_type_hierarchical( ${1:\\$post_type} )"
"Determines whether a post type is considered "viewable".":
"prefix":"is_post_type_viewable"
"body":"is_post_type_viewable( ${1:\\$post_type} )"
"Is the query for a post or page preview?":
"prefix":"is_preview"
"body":"is_preview()"
"Determine whether a meta key is protected.":
"prefix":"is_protected_meta"
"body":"is_protected_meta( ${1:\\$meta_key}${2:, \\$meta_type = null} )"
"Check if random header image is in use.":
"prefix":"is_random_header_image"
"body":"is_random_header_image( ${1:\\$type = 'any'} )"
"is_redirect":
"prefix":"is_redirect"
"body":"is_redirect()"
"Checks if a sidebar is registered.":
"prefix":"is_registered_sidebar"
"body":"is_registered_sidebar( ${1:\\$sidebar_id} )"
"Is the query for the robots file?":
"prefix":"is_robots"
"body":"is_robots()"
"Checks if current locale is RTL.":
"prefix":"is_rtl"
"body":"is_rtl()"
"Is the query for a search?":
"prefix":"is_search"
"body":"is_search()"
"Check value to find if it was serialized.":
"prefix":"is_serialized"
"body":"is_serialized( ${1:\\$data}${2:, \\$strict = true} )"
"Check whether serialized data is of string type.":
"prefix":"is_serialized_string"
"body":"is_serialized_string( ${1:\\$data} )"
"is_server_error":
"prefix":"is_server_error"
"body":"is_server_error()"
"Is the query for an existing single post?":
"prefix":"is_single"
"body":"is_single( ${1:\\$post = ''} )"
"Is the query for an existing single post of any post type (post, attachment, page,
custom post types)?":
"prefix":"is_singular"
"body":"is_singular( ${1:\\$post_types = ''} )"
"Determine if user is a site admin.":
"prefix":"is_site_admin"
"body":"is_site_admin( ${1:\\$user_login = ''} )"
"Determines if SSL is used.":
"prefix":"is_ssl"
"body":"is_ssl()"
"Check if post is sticky.":
"prefix":"is_sticky"
"body":"is_sticky( ${1:\\$post_id} )"
"Whether a subdomain configuration is enabled.":
"prefix":"is_subdomain_install"
"body":"is_subdomain_install()"
"is_success":
"prefix":"is_success"
"body":"is_success()"
"Determine if user is a site admin":
"prefix":"is_super_admin"
"body":"is_super_admin( ${1:\\$user_id = false} )"
"Is the query for an existing tag archive page?":
"prefix":"is_tag"
"body":"is_tag( ${1:\\$tag = ''} )"
"Is the query for an existing custom taxonomy archive page?":
"prefix":"is_tax"
"body":"is_tax( ${1:\\$taxonomy = ''}${2:, \\$term = ''} )"
"Checks that the taxonomy name exists.":
"prefix":"is_taxonomy"
"body":"is_taxonomy( ${1:\\$taxonomy} )"
"Whether the taxonomy object is hierarchical.":
"prefix":"is_taxonomy_hierarchical"
"body":"is_taxonomy_hierarchical( ${1:\\$taxonomy} )"
"Check if Term exists.":
"prefix":"is_term"
"body":"is_term( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$parent} )"
"Whether there are translations for the text domain.":
"prefix":"is_textdomain_loaded"
"body":"is_textdomain_loaded( ${1:\\$domain} )"
"Is the query for a specific time?":
"prefix":"is_time"
"body":"is_time()"
"Is the query for a trackback endpoint call?":
"prefix":"is_trackback"
"body":"is_trackback()"
"Whether the plugin can be uninstalled.":
"prefix":"is_uninstallable_plugin"
"body":"is_uninstallable_plugin( ${1:\\$plugin} )"
"Determines if there is any upload space left in the current blog's quota.":
"prefix":"is_upload_space_available"
"body":"is_upload_space_available()"
"Whether the current request is for a user admin screen.":
"prefix":"is_user_admin"
"body":"is_user_admin()"
"Checks if the current visitor is a logged in user.":
"prefix":"is_user_logged_in"
"body":"is_user_logged_in()"
"Find out whether a user is a member of a given blog.":
"prefix":"is_user_member_of_blog"
"body":"is_user_member_of_blog( ${1:\\$user_id}${2:, \\$blog_id} )"
"Check whether a usermeta key has to do with the current blog.":
"prefix":"is_user_option_local"
"body":"is_user_option_local( ${1:\\$key}${2:, \\$user_id}${3:, \\$blog_id} )"
"Check to see whether a user is marked as a spammer, based on user login.":
"prefix":"is_user_spammy"
"body":"is_user_spammy( ${1:\\$user = null} )"
"Check whether variable is a WordPress Error.":
"prefix":"is_wp_error"
"body":"is_wp_error( ${1:\\$thing} )"
"Deprecated functionality for determining if the current plugin is network-only.":
"prefix":"is_wpmu_sitewide_plugin"
"body":"is_wpmu_sitewide_plugin()"
"Is the query for an existing year archive?":
"prefix":"is_year"
"body":"is_year()"
"Computes an offset in seconds from an iso8601 timezone.":
"prefix":"iso8601_timezone_to_offset"
"body":"iso8601_timezone_to_offset( ${1:\\$timezone} )"
"Converts an iso8601 date to MySQL DateTime format used by post_date[_gmt].":
"prefix":"iso8601_to_datetime"
"body":"iso8601_to_datetime( ${1:\\$date_string}${2:, \\$timezone = 'user'} )"
"Escape single quotes, specialchar double quotes, and fix line endings.":
"prefix":"js_escape"
"body":"js_escape( ${1:\\$text} )"
"Retrieves the error string of the last json_encode() or json_decode() call.":
"prefix":"json_last_error_msg"
"body":"json_last_error_msg()"
"Sets up most of the Kses filters for input form content.":
"prefix":"kses_init"
"body":"kses_init()"
"Adds all Kses input form content filters.":
"prefix":"kses_init_filters"
"body":"kses_init_filters()"
"Removes all Kses input form content filters.":
"prefix":"kses_remove_filters"
"body":"kses_remove_filters()"
"Displays the language attributes for the html tag.":
"prefix":"language_attributes"
"body":"language_attributes( ${1:\\$doctype = 'html'} )"
"Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described.":
"prefix":"like_escape"
"body":"like_escape( ${1:\\$text} )"
"Display advanced link options form fields.":
"prefix":"link_advanced_meta_box"
"body":"link_advanced_meta_box( ${1:\\$link} )"
"Display link categories form fields.":
"prefix":"link_categories_meta_box"
"body":"link_categories_meta_box( ${1:\\$link} )"
"Print list of pages based on arguments.":
"prefix":"link_pages"
"body":"link_pages( ${1:\\$before = ''}${2:, \\$after = ''}${3:, \\$next_or_number = 'number'}${4:, \\$nextpagelink = 'next page'}${5:, \\$previouspagelink = 'previous page'}${6:, \\$pagelink = '%'}${7:, \\$more_file = ''} )"
"Display link create form fields.":
"prefix":"link_submit_meta_box"
"body":"link_submit_meta_box( ${1:\\$link} )"
"Display form fields for changing link target.":
"prefix":"link_target_meta_box"
"body":"link_target_meta_box( ${1:\\$link} )"
"Display xfn form fields.":
"prefix":"link_xfn_meta_box"
"body":"link_xfn_meta_box( ${1:\\$link} )"
"Add a Base url to relative links in passed content.":
"prefix":"links_add_base_url"
"body":"links_add_base_url( ${1:\\$content}${2:, \\$base}${3:, \\$attrs = array('src', 'href')} )"
"Adds a Target attribute to all links in passed content.":
"prefix":"links_add_target"
"body":"links_add_target( ${1:\\$content}${2:, \\$target = '_blank'}${3:, \\$tags = array('a')} )"
"Show the link to the links popup and the number of links.":
"prefix":"links_popup_script"
"body":"links_popup_script( ${1:\\$text = 'Links'}${2:, \\$width = 400}${3:, \\$height = 400}${4:, \\$file = 'links.all.php'}${5:, \\$count = true} )"
"Lists authors.":
"prefix":"list_authors"
"body":"list_authors( ${1:\\$optioncount = false}${2:, \\$exclude_admin = true}${3:, \\$show_fullname = false}${4:, \\$hide_empty = true}${5:, \\$feed = ''}${6:, \\$feed_image = ''} )"
"Lists categories. list_cats":
"prefix":"list_cats"
"body":"list_cats( ${1:\\$optionall = 1}${2:, \\$all = 'All'}${3:, \\$sort_column = 'ID'}${4:, \\$sort_order = 'asc'}${5:, \\$file = ''}${6:, \\$list = true}${7:, \\$optiondates}${8:, \\$optioncount}${9:, \\$hide_empty = 1}${10:, \\$use_desc_for_title = 1}${11:, \\$children = false}${12:, \\$child_of}${13:, \\$categories}${14:, \\$recurse}${15:, \\$feed = ''}${16:, \\$feed_image = ''}${17:, \\$exclude = ''}${18:, \\$hierarchical = false} )"
"list_core_update":
"prefix":"list_core_update"
"body":"list_core_update( ${1:\\$update} )"
"Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.":
"prefix":"list_files"
"body":"list_files( ${1:\\$folder = ''}${2:, \\$levels = 100} )"
"Outputs a post's public meta data in the Custom Fields meta box.":
"prefix":"list_meta"
"body":"list_meta( ${1:\\$meta} )"
"list_plugin_updates":
"prefix":"list_plugin_updates"
"body":"list_plugin_updates()"
"list_theme_updates":
"prefix":"list_theme_updates"
"body":"list_theme_updates()"
"list_translation_updates":
"prefix":"list_translation_updates"
"body":"list_translation_updates()"
"Load the child themes translated strings.":
"prefix":"load_child_theme_textdomain"
"body":"load_child_theme_textdomain( ${1:\\$domain}${2:, \\$path = false} )"
"Load default translated strings based on locale.":
"prefix":"load_default_textdomain"
"body":"load_default_textdomain( ${1:\\$locale = null} )"
"Load an image resource for editing.":
"prefix":"load_image_to_edit"
"body":"load_image_to_edit( ${1:\\$attachment_id}${2:, \\$mime_type}${3:, \\$size = 'full'} )"
"Load the translated strings for a plugin residing in the mu-plugins directory.":
"prefix":"load_muplugin_textdomain"
"body":"load_muplugin_textdomain( ${1:\\$domain}${2:, \\$mu_plugin_rel_path = ''} )"
"Loads a plugin's translated strings.":
"prefix":"load_plugin_textdomain"
"body":"load_plugin_textdomain( ${1:\\$domain}${2:, \\$deprecated = false}${3:, \\$plugin_rel_path = false} )"
"Require the template file with WordPress environment.":
"prefix":"load_template"
"body":"load_template( ${1:\\$_template_file}${2:, \\$require_once = true} )"
"Load a .mo file into the text domain $domain.":
"prefix":"load_textdomain"
"body":"load_textdomain( ${1:\\$domain}${2:, \\$mofile} )"
"Load the theme's translated strings.":
"prefix":"load_theme_textdomain"
"body":"load_theme_textdomain( ${1:\\$domain}${2:, \\$path = false} )"
"Display localized stylesheet link element.":
"prefix":"locale_stylesheet"
"body":"locale_stylesheet()"
"Retrieve the name of the highest priority template file that exists.":
"prefix":"locate_template"
"body":"locate_template( ${1:\\$template_names}${2:, \\$load = false}${3:, \\$require_once = true} )"
"Outputs the footer for the login page.":
"prefix":"login_footer"
"body":"login_footer( ${1:\\$input_id = ''} )"
"Output the login page header.":
"prefix":"login_header"
"body":"login_header( ${1:\\$title = 'Log In'}${2:, \\$message = ''}${3:, \\$wp_error = ''} )"
"logIO() - Writes logging info to a file.":
"prefix":"logio"
"body":"logio( ${1:\\$io}${2:, \\$msg} )"
"maintenance_nag":
"prefix":"maintenance_nag"
"body":"maintenance_nag()"
"Convert plaintext URI to HTML links.":
"prefix":"make_clickable"
"body":"make_clickable( ${1:\\$text} )"
"Updates the database tables to a new schema.":
"prefix":"make_db_current"
"body":"make_db_current( ${1:\\$tables = 'all'} )"
"Updates the database tables to a new schema, but without displaying results.":
"prefix":"make_db_current_silent"
"body":"make_db_current_silent( ${1:\\$tables = 'all'} )"
"Creates a site theme.":
"prefix":"make_site_theme"
"body":"make_site_theme()"
"Creates a site theme from the default theme.":
"prefix":"make_site_theme_from_default"
"body":"make_site_theme_from_default( ${1:\\$theme_name}${2:, \\$template} )"
"Creates a site theme from an existing theme.":
"prefix":"make_site_theme_from_oldschool"
"body":"make_site_theme_from_oldschool( ${1:\\$theme_name}${2:, \\$template} )"
"Strip HTML and put links at the bottom of stripped content.":
"prefix":"make_url_footnote"
"body":"make_url_footnote( ${1:\\$content} )"
"Maps a function to all non-iterable elements of an array or an object.":
"prefix":"map_deep"
"body":"map_deep( ${1:\\$value}${2:, \\$callback} )"
"Map meta capabilities to primitive capabilities.":
"prefix":"map_meta_cap"
"body":"map_meta_cap( ${1:\\$cap}${2:, \\$user_id}${3:, \\$object_id} )"
"Add column to database table, if column doesn't already exist in table.":
"prefix":"maybe_add_column"
"body":"maybe_add_column( ${1:\\$table_name}${2:, \\$column_name}${3:, \\$create_ddl} )"
"Add a new user to a blog by visiting /newbloguser/username/.":
"prefix":"maybe_add_existing_user_to_blog"
"body":"maybe_add_existing_user_to_blog()"
"If a table only contains utf8 or utf8mb4 columns, convert it to utf8mb4.":
"prefix":"maybe_convert_table_to_utf8mb4"
"body":"maybe_convert_table_to_utf8mb4( ${1:\\$table} )"
"Create database table, if it doesn't already exist.":
"prefix":"maybe_create_table"
"body":"maybe_create_table( ${1:\\$table_name}${2:, \\$create_ddl} )"
"Disables the Automattic widgets plugin, which was merged into core.":
"prefix":"maybe_disable_automattic_widgets"
"body":"maybe_disable_automattic_widgets()"
"Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.":
"prefix":"maybe_disable_link_manager"
"body":"maybe_disable_link_manager()"
"Drop column from database table, if it exists.":
"prefix":"maybe_drop_column"
"body":"maybe_drop_column( ${1:\\$table_name}${2:, \\$column_name}${3:, \\$drop_ddl} )"
"Ensures that any hex color is properly hashed.":
"prefix":"maybe_hash_hex_color"
"body":"maybe_hash_hex_color( ${1:\\$color} )"
"Correct 404 redirects when NOBLOGREDIRECT is defined.":
"prefix":"maybe_redirect_404"
"body":"maybe_redirect_404()"
"Serialize data, if needed.":
"prefix":"maybe_serialize"
"body":"maybe_serialize( ${1:\\$data} )"
"Unserialize value only if it was serialized.":
"prefix":"maybe_unserialize"
"body":"maybe_unserialize( ${1:\\$original} )"
"Compat function to mimic mb_strlen().":
"prefix":"mb_strlen"
"body":"mb_strlen( ${1:\\$str}${2:, \\$encoding = null} )"
"Set the mbstring internal encoding to a binary safe encoding when func_overload
is enabled.":
"prefix":"mbstring_binary_safe_encoding"
"body":"mbstring_binary_safe_encoding( ${1:\\$reset = false} )"
"Adds the media button to the editor":
"prefix":"media_buttons"
"body":"media_buttons( ${1:\\$editor_id = 'content'} )"
"Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload().":
"prefix":"media_handle_sideload"
"body":"media_handle_sideload( ${1:\\$file_array}${2:, \\$post_id}${3:, \\$desc = null}${4:, \\$post_data = array()} )"
"Save a file submitted from a POST request and create an attachment post for it.":
"prefix":"media_handle_upload"
"body":"media_handle_upload( ${1:\\$file_id}${2:, \\$post_id}${3:, \\$post_data = array()}${4:, \\$overrides = array( 'test_form' => false )} )"
"Retrieves the post non-image attachment fields to edito form fields.":
"prefix":"media_post_single_attachment_fields_to_edit"
"body":"media_post_single_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Adds image html to editor":
"prefix":"media_send_to_editor"
"body":"media_send_to_editor( ${1:\\$html} )"
"Downloads an image from the specified URL and attaches it to a post.":
"prefix":"media_sideload_image"
"body":"media_sideload_image( ${1:\\$file}${2:, \\$post_id}${3:, \\$desc = null}${4:, \\$return = 'html'} )"
"Retrieves the single non-image attachment fields to edit form fields.":
"prefix":"media_single_attachment_fields_to_edit"
"body":"media_single_attachment_fields_to_edit( ${1:\\$form_fields}${2:, \\$post} )"
"Handles uploading an audio file.":
"prefix":"media_upload_audio"
"body":"media_upload_audio()"
"Handles uploading a generic file.":
"prefix":"media_upload_file"
"body":"media_upload_file()"
"Displays the multi-file uploader message.":
"prefix":"media_upload_flash_bypass"
"body":"media_upload_flash_bypass()"
"Outputs the legacy media upload form.":
"prefix":"media_upload_form"
"body":"media_upload_form( ${1:\\$errors = null} )"
"Handles form submissions for the legacy media uploader.":
"prefix":"media_upload_form_handler"
"body":"media_upload_form_handler()"
"Retrieves the legacy media uploader form in an iframe.":
"prefix":"media_upload_gallery"
"body":"media_upload_gallery()"
"Adds gallery form to upload iframe":
"prefix":"media_upload_gallery_form"
"body":"media_upload_gallery_form( ${1:\\$errors} )"
"Outputs the legacy media upload header.":
"prefix":"media_upload_header"
"body":"media_upload_header()"
"Displays the browser's built-in uploader message.":
"prefix":"media_upload_html_bypass"
"body":"media_upload_html_bypass()"
"Handles uploading an image.":
"prefix":"media_upload_image"
"body":"media_upload_image()"
"Retrieves the legacy media library form in an iframe.":
"prefix":"media_upload_library"
"body":"media_upload_library()"
"Outputs the legacy media upload form for the media library.":
"prefix":"media_upload_library_form"
"body":"media_upload_library_form( ${1:\\$errors} )"
"Displays the checkbox to scale images.":
"prefix":"media_upload_max_image_resize"
"body":"media_upload_max_image_resize()"
"Defines the default media upload tabs":
"prefix":"media_upload_tabs"
"body":"media_upload_tabs()"
"Used to display a "After a file has been uploaded..." help message.":
"prefix":"media_upload_text_after"
"body":"media_upload_text_after()"
"Outputs the legacy media upload form for a given media type.":
"prefix":"media_upload_type_form"
"body":"media_upload_type_form( ${1:\\$type = 'file'}${2:, \\$errors = null}${3:, \\$id = null} )"
"Outputs the legacy media upload form for external media.":
"prefix":"media_upload_type_url_form"
"body":"media_upload_type_url_form( ${1:\\$type = null}${2:, \\$errors = null}${3:, \\$id = null} )"
"Handles uploading a video file.":
"prefix":"media_upload_video"
"body":"media_upload_video()"
"Get the url to access a particular menu page based on the slug it was registered with.":
"prefix":"menu_page_url"
"body":"menu_page_url( ${1:\\$menu_slug}${2:, \\$echo = true} )"
"Prints the meta box preferences for screen meta.":
"prefix":"meta_box_prefs"
"body":"meta_box_prefs( ${1:\\$screen} )"
"Prints the form in the Custom Fields meta box.":
"prefix":"meta_form"
"body":"meta_form( ${1:\\$post = null} )"
"Determine if a meta key is set for a given object":
"prefix":"metadata_exists"
"body":"metadata_exists( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key} )"
"Whitelists any domain in a multisite installation for safe HTTP requests.":
"prefix":"ms_allowed_http_request_hosts"
"body":"ms_allowed_http_request_hosts( ${1:\\$is_external}${2:, \\$host} )"
"Defines Multisite cookie constants.":
"prefix":"ms_cookie_constants"
"body":"ms_cookie_constants()"
"Deprecated functionality for determining whether a file is deprecated.":
"prefix":"ms_deprecated_blogs_file"
"body":"ms_deprecated_blogs_file()"
"Defines Multisite file constants.":
"prefix":"ms_file_constants"
"body":"ms_file_constants()"
"Determines if switch_to_blog() is in effect":
"prefix":"ms_is_switched"
"body":"ms_is_switched()"
"Identifies the network and site of a requested domain and path and populates the
corresponding network and site global objects as part of the multisite bootstrap process.":
"prefix":"ms_load_current_site_and_network"
"body":"ms_load_current_site_and_network( ${1:\\$domain}${2:, \\$path}${3:, \\$subdomain = false} )"
"Displays a failure message.":
"prefix":"ms_not_installed"
"body":"ms_not_installed( ${1:\\$domain}${2:, \\$path} )"
"Checks status of current blog.":
"prefix":"ms_site_check"
"body":"ms_site_check()"
"Defines Multisite subdomain constants and handles warnings and notices.":
"prefix":"ms_subdomain_constants"
"body":"ms_subdomain_constants()"
"Defines Multisite upload constants.":
"prefix":"ms_upload_constants"
"body":"ms_upload_constants()"
"Generates and displays a drop-down of available languages.":
"prefix":"mu_dropdown_languages"
"body":"mu_dropdown_languages( ${1:\\$lang_files = array()}${2:, \\$current = ''} )"
"WPMU options.":
"prefix":"mu_options"
"body":"mu_options()"
"Displays the out of storage quota message in Multisite.":
"prefix":"multisite_over_quota_message"
"body":"multisite_over_quota_message()"
"Convert given date string into a different format.":
"prefix":"mysql2date"
"body":"mysql2date( ${1:\\$format}${2:, \\$date}${3:, \\$translate = true} )"
"Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601/RFC3339.":
"prefix":"mysql_to_rfc3339"
"body":"mysql_to_rfc3339( ${1:\\$date_string} )"
"Retrieves the URL to the admin area for the network.":
"prefix":"network_admin_url"
"body":"network_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Check for an existing network.":
"prefix":"network_domain_check"
"body":"network_domain_check()"
"Outputs the HTML for a network's "Edit Site" tabular interface.":
"prefix":"network_edit_site_nav"
"body":"network_edit_site_nav( ${1:\\$args = array()} )"
"Retrieves the home URL for the current network.":
"prefix":"network_home_url"
"body":"network_home_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Print JavaScript in the header on the Network Settings screen.":
"prefix":"network_settings_add_js"
"body":"network_settings_add_js()"
"Retrieves the site URL for the current network.":
"prefix":"network_site_url"
"body":"network_site_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Prints step 1 for Network installation process.":
"prefix":"network_step1"
"body":"network_step1( ${1:\\$errors = false} )"
"Prints step 2 for Network installation process.":
"prefix":"network_step2"
"body":"network_step2( ${1:\\$errors = false} )"
"Adds an admin notice alerting the user to check for confirmation email
after email address change.":
"prefix":"new_user_email_admin_notice"
"body":"new_user_email_admin_notice()"
"Notifies the network admin that a new site has been activated.":
"prefix":"newblog_notify_siteadmin"
"body":"newblog_notify_siteadmin( ${1:\\$blog_id}${2:, \\$deprecated = ''} )"
"Notifies the network admin that a new user has been activated.":
"prefix":"newuser_notify_siteadmin"
"body":"newuser_notify_siteadmin( ${1:\\$user_id} )"
"Displays the link to the next comments page.":
"prefix":"next_comments_link"
"body":"next_comments_link( ${1:\\$label = ''}${2:, \\$max_page} )"
"Displays next image link that has the same post parent.":
"prefix":"next_image_link"
"body":"next_image_link( ${1:\\$size = 'thumbnail'}${2:, \\$text = false} )"
"Prints link to the next post.":
"prefix":"next_post"
"body":"next_post( ${1:\\$format = '%'}${2:, \\$next = 'next post: '}${3:, \\$title = 'yes'}${4:, \\$in_same_cat = 'no'}${5:, \\$limitnext = 1}${6:, \\$excluded_categories = ''} )"
"Displays the next post link that is adjacent to the current post.":
"prefix":"next_post_link"
"body":"next_post_link( ${1:\\$format = '%link »'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Displays the relational link for the next post adjacent to the current post.":
"prefix":"next_post_rel_link"
"body":"next_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Displays or retrieves the next posts page link.":
"prefix":"next_posts"
"body":"next_posts( ${1:\\$max_page}${2:, \\$echo = true} )"
"Displays the next posts page link.":
"prefix":"next_posts_link"
"body":"next_posts_link( ${1:\\$label = null}${2:, \\$max_page} )"
"next_widget_id_number":
"prefix":"next_widget_id_number"
"body":"next_widget_id_number( ${1:\\$id_base} )"
"Set the headers to prevent caching for the different browsers.":
"prefix":"nocache_headers"
"body":"nocache_headers()"
"Displays a noindex meta tag if required by the blog configuration.":
"prefix":"noindex"
"body":"noindex()"
"Normalize EOL characters and strip duplicate whitespace.":
"prefix":"normalize_whitespace"
"body":"normalize_whitespace( ${1:\\$str} )"
"Convert float number to format based on the locale.":
"prefix":"number_format_i18n"
"body":"number_format_i18n( ${1:\\$number}${2:, \\$decimals} )"
"Refreshes the value of the options whitelist available via the 'whitelist_options' hook.":
"prefix":"option_update_filter"
"body":"option_update_filter( ${1:\\$options} )"
"Output JavaScript to toggle display of additional settings if avatars are disabled.":
"prefix":"options_discussion_add_js"
"body":"options_discussion_add_js()"
"Display JavaScript on the page options_general_add_js.":
"prefix":"options_general_add_js"
"body":"options_general_add_js()"
"Display JavaScript on the page options_permalink_add_js.":
"prefix":"options_permalink_add_js"
"body":"options_permalink_add_js()"
"Display JavaScript on the page options_reading_add_js.":
"prefix":"options_reading_add_js"
"body":"options_reading_add_js()"
"Render the site charset setting.":
"prefix":"options_reading_blog_charset"
"body":"options_reading_blog_charset()"
"Display page attributes form fields.":
"prefix":"page_attributes_meta_box"
"body":"page_attributes_meta_box( ${1:\\$post} )"
"Print out option HTML elements for the page templates drop-down.":
"prefix":"page_template_dropdown"
"body":"page_template_dropdown( ${1:\\$default = ''}${2:, \\$post_type = 'page'} )"
"Displays or retrieves pagination links for the comments on the current post.":
"prefix":"paginate_comments_links"
"body":"paginate_comments_links( ${1:\\$args = array()} )"
"Retrieve paginated link for archive post pages.":
"prefix":"paginate_links"
"body":"paginate_links( ${1:\\$args = ''} )"
"Print out option HTML elements for the page parents drop-down.":
"prefix":"parent_dropdown"
"body":"parent_dropdown( ${1:\\$default}${2:, \\$parent}${3:, \\$level}${4:, \\$post = null} )"
"Display relational link for parent item":
"prefix":"parent_post_rel_link"
"body":"parent_post_rel_link( ${1:\\$title = '%title'} )"
"parse_w3cdtf":
"prefix":"parse_w3cdtf"
"body":"parse_w3cdtf()"
"Test if a give filesystem path is absolute.":
"prefix":"path_is_absolute"
"body":"path_is_absolute( ${1:\\$path} )"
"Join two filesystem paths together.":
"prefix":"path_join"
"body":"path_join( ${1:\\$base}${2:, \\$path} )"
"pclziputilcopyblock":
"prefix":"pclziputilcopyblock"
"body":"pclziputilcopyblock()"
"pclziputiloptiontext":
"prefix":"pclziputiloptiontext"
"body":"pclziputiloptiontext()"
"pclziputilpathinclusion":
"prefix":"pclziputilpathinclusion"
"body":"pclziputilpathinclusion()"
"pclziputilpathreduction":
"prefix":"pclziputilpathreduction"
"body":"pclziputilpathreduction()"
"pclziputilrename":
"prefix":"pclziputilrename"
"body":"pclziputilrename()"
"pclziputiltranslatewinpath":
"prefix":"pclziputiltranslatewinpath"
"body":"pclziputiltranslatewinpath()"
"Displays the permalink anchor for the current post.":
"prefix":"permalink_anchor"
"body":"permalink_anchor( ${1:\\$mode = 'id'} )"
"Print the permalink of the current post in the loop.":
"prefix":"permalink_link"
"body":"permalink_link()"
"Print the permalink to the RSS feed.":
"prefix":"permalink_single_rss"
"body":"permalink_single_rss( ${1:\\$deprecated = ''} )"
"Pings back the links found in a post.":
"prefix":"pingback"
"body":"pingback( ${1:\\$content}${2:, \\$post_id} )"
"Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI":
"prefix":"pingback_ping_source_uri"
"body":"pingback_ping_source_uri( ${1:\\$source_uri} )"
"Whether the current post is open for pings.":
"prefix":"pings_open"
"body":"pings_open( ${1:\\$post_id = null} )"
"Gets the basename of a plugin.":
"prefix":"plugin_basename"
"body":"plugin_basename( ${1:\\$file} )"
"Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in.":
"prefix":"plugin_dir_path"
"body":"plugin_dir_path( ${1:\\$file} )"
"Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in.":
"prefix":"plugin_dir_url"
"body":"plugin_dir_url( ${1:\\$file} )"
"plugin_sandbox_scrape":
"prefix":"plugin_sandbox_scrape"
"body":"plugin_sandbox_scrape( ${1:\\$plugin} )"
"Retrieves plugin installer pages from the WordPress.org Plugins API.":
"prefix":"plugins_api"
"body":"plugins_api( ${1:\\$action}${2:, \\$args = array()} )"
"Retrieves a URL within the plugins or mu-plugins directory.":
"prefix":"plugins_url"
"body":"plugins_url( ${1:\\$path = ''}${2:, \\$plugin = ''} )"
"Populate network settings.":
"prefix":"populate_network"
"body":"populate_network( ${1:\\$network_id = 1}${2:, \\$domain = ''}${3:, \\$email = ''}${4:, \\$site_name = ''}${5:, \\$path = '/'}${6:, \\$subdomain_install = false} )"
"Create WordPress options and set the default values.":
"prefix":"populate_options"
"body":"populate_options()"
"Execute WordPress role creation for the various WordPress versions.":
"prefix":"populate_roles"
"body":"populate_roles()"
"Create the roles for WordPress 2.0":
"prefix":"populate_roles_160"
"body":"populate_roles_160()"
"Create and modify WordPress roles for WordPress 2.1.":
"prefix":"populate_roles_210"
"body":"populate_roles_210()"
"Create and modify WordPress roles for WordPress 2.3.":
"prefix":"populate_roles_230"
"body":"populate_roles_230()"
"Create and modify WordPress roles for WordPress 2.5.":
"prefix":"populate_roles_250"
"body":"populate_roles_250()"
"Create and modify WordPress roles for WordPress 2.6.":
"prefix":"populate_roles_260"
"body":"populate_roles_260()"
"Create and modify WordPress roles for WordPress 2.7.":
"prefix":"populate_roles_270"
"body":"populate_roles_270()"
"Create and modify WordPress roles for WordPress 2.8.":
"prefix":"populate_roles_280"
"body":"populate_roles_280()"
"Create and modify WordPress roles for WordPress 3.0.":
"prefix":"populate_roles_300"
"body":"populate_roles_300()"
"Adds element attributes to open links in new windows.":
"prefix":"popuplinks"
"body":"popuplinks( ${1:\\$text} )"
"Display form field with list of authors.":
"prefix":"post_author_meta_box"
"body":"post_author_meta_box( ${1:\\$post} )"
"Display post categories form fields.":
"prefix":"post_categories_meta_box"
"body":"post_categories_meta_box( ${1:\\$post}${2:, \\$box} )"
"Display the classes for the post div.":
"prefix":"post_class"
"body":"post_class( ${1:\\$class = ''}${2:, \\$post_id = null} )"
"Display comments for post.":
"prefix":"post_comment_meta_box"
"body":"post_comment_meta_box( ${1:\\$post} )"
"Display comments for post table header":
"prefix":"post_comment_meta_box_thead"
"body":"post_comment_meta_box_thead( ${1:\\$result} )"
"Display comments status form fields.":
"prefix":"post_comment_status_meta_box"
"body":"post_comment_status_meta_box( ${1:\\$post} )"
"Displays the comment feed link for a post.":
"prefix":"post_comments_feed_link"
"body":"post_comments_feed_link( ${1:\\$link_text = ''}${2:, \\$post_id = ''}${3:, \\$feed = ''} )"
"Retrieve post custom meta data field.":
"prefix":"post_custom"
"body":"post_custom( ${1:\\$key = ''} )"
"Display custom fields form fields.":
"prefix":"post_custom_meta_box"
"body":"post_custom_meta_box( ${1:\\$post} )"
"Display post excerpt form fields.":
"prefix":"post_excerpt_meta_box"
"body":"post_excerpt_meta_box( ${1:\\$post} )"
"Determine if a post exists based on title, content, and date":
"prefix":"post_exists"
"body":"post_exists( ${1:\\$title}${2:, \\$content = ''}${3:, \\$date = ''} )"
"Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
as they disregard the autocomplete setting on the editor textarea. That can break the editor
when the user navigates to it with the browser's Back button. See #28037":
"prefix":"post_form_autocomplete_off"
"body":"post_form_autocomplete_off()"
"Display post format form elements.":
"prefix":"post_format_meta_box"
"body":"post_format_meta_box( ${1:\\$post}${2:, \\$box} )"
"Whether post requires password and correct password has been provided.":
"prefix":"post_password_required"
"body":"post_password_required( ${1:\\$post = null} )"
"Retrieve permalink from post ID.":
"prefix":"post_permalink"
"body":"post_permalink( ${1:\\$post_id} )"
"Save draft or manually autosave for showing preview.":
"prefix":"post_preview"
"body":"post_preview()"
"Displays the HTML content for reply to post link.":
"prefix":"post_reply_link"
"body":"post_reply_link( ${1:\\$args = array()}${2:, \\$post = null} )"
"Display list of revisions.":
"prefix":"post_revisions_meta_box"
"body":"post_revisions_meta_box( ${1:\\$post} )"
"Display slug form fields.":
"prefix":"post_slug_meta_box"
"body":"post_slug_meta_box( ${1:\\$post} )"
"Displays post submit form fields.":
"prefix":"post_submit_meta_box"
"body":"post_submit_meta_box( ${1:\\$post}${2:, \\$args = array()} )"
"Display post tags form fields.":
"prefix":"post_tags_meta_box"
"body":"post_tags_meta_box( ${1:\\$post}${2:, \\$box} )"
"Display post thumbnail meta box.":
"prefix":"post_thumbnail_meta_box"
"body":"post_thumbnail_meta_box( ${1:\\$post} )"
"Display trackback links form fields.":
"prefix":"post_trackback_meta_box"
"body":"post_trackback_meta_box( ${1:\\$post} )"
"Display or retrieve title for a post type archive.":
"prefix":"post_type_archive_title"
"body":"post_type_archive_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Check if a post type is registered.":
"prefix":"post_type_exists"
"body":"post_type_exists( ${1:\\$post_type} )"
"Check a post type's support for a given feature.":
"prefix":"post_type_supports"
"body":"post_type_supports( ${1:\\$post_type}${2:, \\$feature} )"
"Returns the list of classes to be used by a meta box.":
"prefix":"postbox_classes"
"body":"postbox_classes( ${1:\\$id}${2:, \\$page} )"
"Displays the post pages link navigation for previous and next pages.":
"prefix":"posts_nav_link"
"body":"posts_nav_link( ${1:\\$sep = ''}${2:, \\$prelabel = ''}${3:, \\$nxtlabel = ''} )"
"Runs before the schema is upgraded.":
"prefix":"pre_schema_upgrade"
"body":"pre_schema_upgrade()"
"Determine the type of a string of data with the data formatted.":
"prefix":"prep_atom_text_construct"
"body":"prep_atom_text_construct( ${1:\\$data} )"
"Wrap attachment in paragraph tag before content.":
"prefix":"prepend_attachment"
"body":"prepend_attachment( ${1:\\$content} )"
"Displays the relational link for the previous post adjacent to the current post.":
"prefix":"prev_post_rel_link"
"body":"prev_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_term = false}${3:, \\$excluded_terms = ''}${4:, \\$taxonomy = 'category'} )"
"Start preview theme output buffer.":
"prefix":"preview_theme"
"body":"preview_theme()"
"Callback function for ob_start() to capture all links in the theme.":
"prefix":"preview_theme_ob_filter"
"body":"preview_theme_ob_filter( ${1:\\$content} )"
"Manipulates preview theme links in order to control and maintain location.":
"prefix":"preview_theme_ob_filter_callback"
"body":"preview_theme_ob_filter_callback( ${1:\\$matches} )"
"Displays the link to the previous comments page.":
"prefix":"previous_comments_link"
"body":"previous_comments_link( ${1:\\$label = ''} )"
"Displays previous image link that has the same post parent.":
"prefix":"previous_image_link"
"body":"previous_image_link( ${1:\\$size = 'thumbnail'}${2:, \\$text = false} )"
"Prints a link to the previous post.":
"prefix":"previous_post"
"body":"previous_post( ${1:\\$format = '%'}${2:, \\$previous = 'previous post: '}${3:, \\$title = 'yes'}${4:, \\$in_same_cat = 'no'}${5:, \\$limitprev = 1}${6:, \\$excluded_categories = ''} )"
"Displays the previous post link that is adjacent to the current post.":
"prefix":"previous_post_link"
"body":"previous_post_link( ${1:\\$format = '« %link'}${2:, \\$link = '%title'}${3:, \\$in_same_term = false}${4:, \\$excluded_terms = ''}${5:, \\$taxonomy = 'category'} )"
"Displays or retrieves the previous posts page link.":
"prefix":"previous_posts"
"body":"previous_posts( ${1:\\$echo = true} )"
"Displays the previous posts page link.":
"prefix":"previous_posts_link"
"body":"previous_posts_link( ${1:\\$label = null} )"
"Prints the styles queue in the HTML head on admin pages.":
"prefix":"print_admin_styles"
"body":"print_admin_styles()"
"Prints column headers for a particular screen.":
"prefix":"print_column_headers"
"body":"print_column_headers( ${1:\\$screen}${2:, \\$with_id = true} )"
"Prints the necessary markup for the embed comments button.":
"prefix":"print_embed_comments_button"
"body":"print_embed_comments_button()"
"Prints the JavaScript in the embed iframe header.":
"prefix":"print_embed_scripts"
"body":"print_embed_scripts()"
"Prints the necessary markup for the embed sharing button.":
"prefix":"print_embed_sharing_button"
"body":"print_embed_sharing_button()"
"Prints the necessary markup for the embed sharing dialog.":
"prefix":"print_embed_sharing_dialog"
"body":"print_embed_sharing_dialog()"
"Prints the CSS in the embed iframe header.":
"prefix":"print_embed_styles"
"body":"print_embed_styles()"
"Print the inline Emoji detection script if it is not already printed.":
"prefix":"print_emoji_detection_script"
"body":"print_emoji_detection_script()"
"Print the important emoji-related styles.":
"prefix":"print_emoji_styles"
"body":"print_emoji_styles()"
"Prints the scripts that were queued for the footer or too late for the HTML head.":
"prefix":"print_footer_scripts"
"body":"print_footer_scripts()"
"Prints the script queue in the HTML head on admin pages.":
"prefix":"print_head_scripts"
"body":"print_head_scripts()"
"Prints the styles that were queued too late for the HTML head.":
"prefix":"print_late_styles"
"body":"print_late_styles()"
"Check whether blog is public before returning sites.":
"prefix":"privacy_ping_filter"
"body":"privacy_ping_filter( ${1:\\$sites} )"
"Sets up The Loop with query parameters.":
"prefix":"query_posts"
"body":"query_posts( ${1:\\$query} )"
"Unless open_basedir is enabled, use /dev/urandom for
random numbers in accordance with best practices":
"prefix":"random_bytes"
"body":"random_bytes( ${1:\\$bytes} )"
"Fetch a random integer between $min and $max inclusive":
"prefix":"random_int"
"body":"random_int( ${1:\\$min}${2:, \\$max} )"
"Cast to an integer if we can, safely.":
"prefix":"randomcompat_intval"
"body":"randomcompat_intval( ${1:\\$number}${2:, \\$fail_open = false} )"
"strlen() implementation that isn't brittle to mbstring.func_overload":
"prefix":"randomcompat_strlen"
"body":"randomcompat_strlen( ${1:\\$binary_string} )"
"substr() implementation that isn't brittle to mbstring.func_overload":
"prefix":"randomcompat_substr"
"body":"randomcompat_substr( ${1:\\$binary_string}${2:, \\$start}${3:, \\$length = null} )"
"Navigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.":
"prefix":"rawurlencode_deep"
"body":"rawurlencode_deep( ${1:\\$value} )"
"Get the size of a directory recursively.":
"prefix":"recurse_dirsize"
"body":"recurse_dirsize( ${1:\\$directory}${2:, \\$exclude = null} )"
"Redirects incoming links to the proper URL based on the site url.":
"prefix":"redirect_canonical"
"body":"redirect_canonical( ${1:\\$requested_url = null}${2:, \\$do_redirect = true} )"
"Attempts to guess the correct URL based on query vars":
"prefix":"redirect_guess_404_permalink"
"body":"redirect_guess_404_permalink()"
"Redirect to previous page.":
"prefix":"redirect_post"
"body":"redirect_post( ${1:\\$post_id = ''} )"
"Ensure that the current site's domain is listed in the allowed redirect host list.":
"prefix":"redirect_this_site"
"body":"redirect_this_site( ${1:\\$deprecated = ''} )"
"Clear the blog details cache.":
"prefix":"refresh_blog_details"
"body":"refresh_blog_details( ${1:\\$blog_id} )"
"Cleans the user cache for a specific user.":
"prefix":"refresh_user_details"
"body":"refresh_user_details( ${1:\\$id} )"
"Set the activation hook for a plugin.":
"prefix":"register_activation_hook"
"body":"register_activation_hook( ${1:\\$file}${2:, \\$function} )"
"Registers the default Admin color schemes":
"prefix":"register_admin_color_schemes"
"body":"register_admin_color_schemes()"
"Register column headers for a particular screen.":
"prefix":"register_column_headers"
"body":"register_column_headers( ${1:\\$screen}${2:, \\$columns} )"
"Set the deactivation hook for a plugin.":
"prefix":"register_deactivation_hook"
"body":"register_deactivation_hook( ${1:\\$file}${2:, \\$function} )"
"Register a selection of default headers to be displayed by the custom header admin UI.":
"prefix":"register_default_headers"
"body":"register_default_headers( ${1:\\$headers} )"
"Register importer for WordPress.":
"prefix":"register_importer"
"body":"register_importer( ${1:\\$id}${2:, \\$name}${3:, \\$description}${4:, \\$callback} )"
"Register default settings available in WordPress.":
"prefix":"register_initial_settings"
"body":"register_initial_settings()"
"Registers a meta key.":
"prefix":"register_meta"
"body":"register_meta( ${1:\\$object_type}${2:, \\$meta_key}${3:, \\$args}${4:, \\$deprecated = null} )"
"Registers a navigation menu location for a theme.":
"prefix":"register_nav_menu"
"body":"register_nav_menu( ${1:\\$location}${2:, \\$description} )"
"Registers navigation menu locations for a theme.":
"prefix":"register_nav_menus"
"body":"register_nav_menus( ${1:\\$locations = array()} )"
"Handles registering a new user.":
"prefix":"register_new_user"
"body":"register_new_user( ${1:\\$user_login}${2:, \\$user_email} )"
"Register a post status. Do not use before init.":
"prefix":"register_post_status"
"body":"register_post_status( ${1:\\$post_status}${2:, \\$args = array()} )"
"Registers a post type.":
"prefix":"register_post_type"
"body":"register_post_type( ${1:\\$post_type}${2:, \\$args = array()} )"
"Registers a new field on an existing WordPress object type.":
"prefix":"register_rest_field"
"body":"register_rest_field( ${1:\\$object_type}${2:, \\$attribute}${3:, \\$args = array()} )"
"Registers a REST API route.":
"prefix":"register_rest_route"
"body":"register_rest_route( ${1:\\$namespace}${2:, \\$route}${3:, \\$args = array()}${4:, \\$override = false} )"
"Register a setting and its data.":
"prefix":"register_setting"
"body":"register_setting( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$args = array()} )"
"Builds the definition for a single sidebar and returns the ID.":
"prefix":"register_sidebar"
"body":"register_sidebar( ${1:\\$args = array()} )"
"Register widget for sidebar with backward compatibility.":
"prefix":"register_sidebar_widget"
"body":"register_sidebar_widget( ${1:\\$name}${2:, \\$output_callback}${3:, \\$classname = ''}${4:, \\$params} )"
"Creates multiple sidebars.":
"prefix":"register_sidebars"
"body":"register_sidebars( ${1:\\$number = 1}${2:, \\$args = array()} )"
"Creates or modifies a taxonomy object.":
"prefix":"register_taxonomy"
"body":"register_taxonomy( ${1:\\$taxonomy}${2:, \\$object_type}${3:, \\$args = array()} )"
"Add an already registered taxonomy to an object type.":
"prefix":"register_taxonomy_for_object_type"
"body":"register_taxonomy_for_object_type( ${1:\\$taxonomy}${2:, \\$object_type} )"
"Register a directory that contains themes.":
"prefix":"register_theme_directory"
"body":"register_theme_directory( ${1:\\$directory} )"
"Set the uninstallation hook for a plugin.":
"prefix":"register_uninstall_hook"
"body":"register_uninstall_hook( ${1:\\$file}${2:, \\$callback} )"
"Register a widget":
"prefix":"register_widget"
"body":"register_widget( ${1:\\$widget_class} )"
"Registers widget control callback for customizing options. register_widget_control":
"prefix":"register_widget_control"
"body":"register_widget_control( ${1:\\$name}${2:, \\$control_callback}${3:, \\$width = ''}${4:, \\$height = ''} )"
"Checks if a meta key is registered.":
"prefix":"registered_meta_key_exists"
"body":"registered_meta_key_exists( ${1:\\$object_type}${2:, \\$meta_key} )"
"Outputs rel=canonical for singular queries.":
"prefix":"rel_canonical"
"body":"rel_canonical()"
"Converts all accent characters to ASCII characters.":
"prefix":"remove_accents"
"body":"remove_accents( ${1:\\$string} )"
"Removes a function from a specified action hook.":
"prefix":"remove_action"
"body":"remove_action( ${1:\\$tag}${2:, \\$function_to_remove}${3:, \\$priority = 10} )"
"Remove all of the hooks from an action.":
"prefix":"remove_all_actions"
"body":"remove_all_actions( ${1:\\$tag}${2:, \\$priority = false} )"
"Remove all of the hooks from a filter.":
"prefix":"remove_all_filters"
"body":"remove_all_filters( ${1:\\$tag}${2:, \\$priority = false} )"
"Clear all shortcodes.":
"prefix":"remove_all_shortcodes"
"body":"remove_all_shortcodes()"
"Remove custom background support.":
"prefix":"remove_custom_background"
"body":"remove_custom_background()"
"Remove image header support.":
"prefix":"remove_custom_image_header"
"body":"remove_custom_image_header()"
"Removes all visual editor stylesheets.":
"prefix":"remove_editor_styles"
"body":"remove_editor_styles()"
"Removes a function from a specified filter hook.":
"prefix":"remove_filter"
"body":"remove_filter( ${1:\\$tag}${2:, \\$function_to_remove}${3:, \\$priority = 10} )"
"Remove a new image size.":
"prefix":"remove_image_size"
"body":"remove_image_size( ${1:\\$name} )"
"Remove a top-level admin menu.":
"prefix":"remove_menu_page"
"body":"remove_menu_page( ${1:\\$menu_slug} )"
"Removes a meta box from one or more screens.":
"prefix":"remove_meta_box"
"body":"remove_meta_box( ${1:\\$id}${2:, \\$screen}${3:, \\$context} )"
"Unregister a setting":
"prefix":"remove_option_update_handler"
"body":"remove_option_update_handler( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$sanitize_callback = ''} )"
"Removes a list of options from the options whitelist.":
"prefix":"remove_option_whitelist"
"body":"remove_option_whitelist( ${1:\\$del_options}${2:, \\$options = ''} )"
"Removes a permalink structure.":
"prefix":"remove_permastruct"
"body":"remove_permastruct( ${1:\\$name} )"
"Remove support for a feature from a post type.":
"prefix":"remove_post_type_support"
"body":"remove_post_type_support( ${1:\\$post_type}${2:, \\$feature} )"
"Removes an item or items from a query string.":
"prefix":"remove_query_arg"
"body":"remove_query_arg( ${1:\\$key}${2:, \\$query = false} )"
"Removes an existing rewrite tag (like %postname%).":
"prefix":"remove_rewrite_tag"
"body":"remove_rewrite_tag( ${1:\\$tag} )"
"Remove role, if it exists.":
"prefix":"remove_role"
"body":"remove_role( ${1:\\$role} )"
"Removes hook for shortcode.":
"prefix":"remove_shortcode"
"body":"remove_shortcode( ${1:\\$tag} )"
"Remove an admin submenu.":
"prefix":"remove_submenu_page"
"body":"remove_submenu_page( ${1:\\$menu_slug}${2:, \\$submenu_slug} )"
"Remove theme modification name from current theme list.":
"prefix":"remove_theme_mod"
"body":"remove_theme_mod( ${1:\\$name} )"
"Remove theme modifications option for current theme.":
"prefix":"remove_theme_mods"
"body":"remove_theme_mods()"
"Allows a theme to de-register its support of a certain feature":
"prefix":"remove_theme_support"
"body":"remove_theme_support( ${1:\\$feature} )"
"Remove a user from a blog.":
"prefix":"remove_user_from_blog"
"body":"remove_user_from_blog( ${1:\\$user_id}${2:, \\$blog_id = ''}${3:, \\$reassign = ''} )"
"Displays a form to the user to request for their FTP/SSH details in order
to connect to the filesystem.":
"prefix":"request_filesystem_credentials"
"body":"request_filesystem_credentials( ${1:\\$form_post}${2:, \\$type = ''}${3:, \\$error = false}${4:, \\$context = ''}${5:, \\$extra_fields = null}${6:, \\$allow_relaxed_file_ownership = false} )"
"Checks a theme's support for a given feature before loading the functions which implement it.":
"prefix":"require_if_theme_supports"
"body":"require_if_theme_supports( ${1:\\$feature}${2:, \\$include} )"
"Load the database class file and instantiate the `$wpdb` global.":
"prefix":"require_wp_db"
"body":"require_wp_db()"
"Reset the mbstring internal encoding to a users previously set encoding.":
"prefix":"reset_mbstring_encoding"
"body":"reset_mbstring_encoding()"
"Handles resetting the user's password.":
"prefix":"reset_password"
"body":"reset_password( ${1:\\$user}${2:, \\$new_pass} )"
"Registers the default REST API filters.":
"prefix":"rest_api_default_filters"
"body":"rest_api_default_filters()"
"Registers rewrite rules for the API.":
"prefix":"rest_api_init"
"body":"rest_api_init()"
"Loads the REST API.":
"prefix":"rest_api_loaded"
"body":"rest_api_loaded()"
"Adds REST rewrite rules.":
"prefix":"rest_api_register_rewrites"
"body":"rest_api_register_rewrites()"
"Returns a contextual HTTP error code for authorization failure.":
"prefix":"rest_authorization_required_code"
"body":"rest_authorization_required_code()"
"Checks for errors when using cookie-based authentication.":
"prefix":"rest_cookie_check_errors"
"body":"rest_cookie_check_errors( ${1:\\$result} )"
"Collects cookie authentication status.":
"prefix":"rest_cookie_collect_status"
"body":"rest_cookie_collect_status()"
"Do a REST request.":
"prefix":"rest_do_request"
"body":"rest_do_request( ${1:\\$request} )"
"Ensures request arguments are a request object (for consistency).":
"prefix":"rest_ensure_request"
"body":"rest_ensure_request( ${1:\\$request} )"
"Ensures a REST response is a response object (for consistency).":
"prefix":"rest_ensure_response"
"body":"rest_ensure_response( ${1:\\$response} )"
"Retrieves the pixel sizes for avatars.":
"prefix":"rest_get_avatar_sizes"
"body":"rest_get_avatar_sizes()"
"Retrieves the avatar urls in various sizes based on a given email address.":
"prefix":"rest_get_avatar_urls"
"body":"rest_get_avatar_urls( ${1:\\$email} )"
"Parses a date into both its local and UTC equivalent, in MySQL datetime format.":
"prefix":"rest_get_date_with_gmt"
"body":"rest_get_date_with_gmt( ${1:\\$date}${2:, \\$is_utc = false} )"
"Retrieves the current REST server instance.":
"prefix":"rest_get_server"
"body":"rest_get_server()"
"Retrieves the URL prefix for any API resource.":
"prefix":"rest_get_url_prefix"
"body":"rest_get_url_prefix()"
"Handles _deprecated_argument() errors.":
"prefix":"rest_handle_deprecated_argument"
"body":"rest_handle_deprecated_argument( ${1:\\$function}${2:, \\$message}${3:, \\$version} )"
"Handles _deprecated_function() errors.":
"prefix":"rest_handle_deprecated_function"
"body":"rest_handle_deprecated_function( ${1:\\$function}${2:, \\$replacement}${3:, \\$version} )"
"Handles OPTIONS requests for the server.":
"prefix":"rest_handle_options_request"
"body":"rest_handle_options_request( ${1:\\$response}${2:, \\$handler}${3:, \\$request} )"
"Determines if a given value is boolean-like.":
"prefix":"rest_is_boolean"
"body":"rest_is_boolean( ${1:\\$maybe_bool} )"
"Determines if an IP address is valid.":
"prefix":"rest_is_ip_address"
"body":"rest_is_ip_address( ${1:\\$ip} )"
"Sends a Link header for the REST API.":
"prefix":"rest_output_link_header"
"body":"rest_output_link_header()"
"Outputs the REST API link tag into page header.":
"prefix":"rest_output_link_wp_head"
"body":"rest_output_link_wp_head()"
"Adds the REST API URL to the WP RSD endpoint.":
"prefix":"rest_output_rsd"
"body":"rest_output_rsd()"
"Parses an RFC3339 time into a Unix timestamp.":
"prefix":"rest_parse_date"
"body":"rest_parse_date( ${1:\\$date}${2:, \\$force_utc = false} )"
"Parse a request argument based on details registered to the route.":
"prefix":"rest_parse_request_arg"
"body":"rest_parse_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Changes a boolean-like value into the proper boolean value.":
"prefix":"rest_sanitize_boolean"
"body":"rest_sanitize_boolean( ${1:\\$value} )"
"Sanitize a request argument based on details registered to the route.":
"prefix":"rest_sanitize_request_arg"
"body":"rest_sanitize_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Sanitize a value based on a schema.":
"prefix":"rest_sanitize_value_from_schema"
"body":"rest_sanitize_value_from_schema( ${1:\\$value}${2:, \\$args} )"
"Sends the "Allow" header to state all methods that can be sent to the current route.":
"prefix":"rest_send_allow_header"
"body":"rest_send_allow_header( ${1:\\$response}${2:, \\$server}${3:, \\$request} )"
"Sends Cross-Origin Resource Sharing headers with API requests.":
"prefix":"rest_send_cors_headers"
"body":"rest_send_cors_headers( ${1:\\$value} )"
"Retrieves the URL to a REST endpoint.":
"prefix":"rest_url"
"body":"rest_url( ${1:\\$path = ''}${2:, \\$scheme = 'json'} )"
"Validate a request argument based on details registered to the route.":
"prefix":"rest_validate_request_arg"
"body":"rest_validate_request_arg( ${1:\\$value}${2:, \\$request}${3:, \\$param} )"
"Validate a value based on a schema.":
"prefix":"rest_validate_value_from_schema"
"body":"rest_validate_value_from_schema( ${1:\\$value}${2:, \\$args}${3:, \\$param = ''} )"
"Restore the current blog, after calling switch_to_blog()":
"prefix":"restore_current_blog"
"body":"restore_current_blog()"
"Restores the translations according to the original locale.":
"prefix":"restore_current_locale"
"body":"restore_current_locale()"
"Restores the translations according to the previous locale.":
"prefix":"restore_previous_locale"
"body":"restore_previous_locale()"
"Handles sending password retrieval email to user.":
"prefix":"retrieve_password"
"body":"retrieve_password()"
"Look for "lost" widgets, this has to run at least on each theme change.":
"prefix":"retrieve_widgets"
"body":"retrieve_widgets( ${1:\\$theme_changed = false} )"
"Revokes Super Admin privileges.":
"prefix":"revoke_super_admin"
"body":"revoke_super_admin( ${1:\\$user_id} )"
"Rewind the loop posts.":
"prefix":"rewind_posts"
"body":"rewind_posts()"
"Determine if TinyMCE is available.":
"prefix":"rich_edit_exists"
"body":"rich_edit_exists()"
"Display the link to the Really Simple Discovery service endpoint.":
"prefix":"rsd_link"
"body":"rsd_link()"
"Displays Site Icon in RSS2.":
"prefix":"rss2_site_icon"
"body":"rss2_site_icon()"
"Display the rss enclosure for the current post.":
"prefix":"rss_enclosure"
"body":"rss_enclosure()"
"Inline CSS filter":
"prefix":"safecss_filter_attr"
"body":"safecss_filter_attr( ${1:\\$css}${2:, \\$deprecated = ''} )"
"Sanitizes all bookmark fields":
"prefix":"sanitize_bookmark"
"body":"sanitize_bookmark( ${1:\\$bookmark}${2:, \\$context = 'display'} )"
"Sanitizes a bookmark field.":
"prefix":"sanitize_bookmark_field"
"body":"sanitize_bookmark_field( ${1:\\$field}${2:, \\$value}${3:, \\$bookmark_id}${4:, \\$context} )"
"Sanitizes category data based on context.":
"prefix":"sanitize_category"
"body":"sanitize_category( ${1:\\$category}${2:, \\$context = 'display'} )"
"Sanitizes data in single category key field.":
"prefix":"sanitize_category_field"
"body":"sanitize_category_field( ${1:\\$field}${2:, \\$value}${3:, \\$cat_id}${4:, \\$context} )"
"Sanitizes the cookies sent to the user already.":
"prefix":"sanitize_comment_cookies"
"body":"sanitize_comment_cookies()"
"Strips out all characters that are not allowable in an email.":
"prefix":"sanitize_email"
"body":"sanitize_email( ${1:\\$email} )"
"Sanitizes a filename, replacing whitespace with dashes.":
"prefix":"sanitize_file_name"
"body":"sanitize_file_name( ${1:\\$filename} )"
"Sanitizes a hex color.":
"prefix":"sanitize_hex_color"
"body":"sanitize_hex_color( ${1:\\$color} )"
"Sanitizes a hex color without a hash. Use sanitize_hex_color() when possible.":
"prefix":"sanitize_hex_color_no_hash"
"body":"sanitize_hex_color_no_hash( ${1:\\$color} )"
"Sanitizes an HTML classname to ensure it only contains valid characters.":
"prefix":"sanitize_html_class"
"body":"sanitize_html_class( ${1:\\$class}${2:, \\$fallback = ''} )"
"Sanitizes a string key.":
"prefix":"sanitize_key"
"body":"sanitize_key( ${1:\\$key} )"
"Sanitize meta value.":
"prefix":"sanitize_meta"
"body":"sanitize_meta( ${1:\\$meta_key}${2:, \\$meta_value}${3:, \\$object_type} )"
"Sanitize a mime type":
"prefix":"sanitize_mime_type"
"body":"sanitize_mime_type( ${1:\\$mime_type} )"
"Sanitises various option values based on the nature of the option.":
"prefix":"sanitize_option"
"body":"sanitize_option( ${1:\\$option}${2:, \\$value} )"
"Sanitize every post field.":
"prefix":"sanitize_post"
"body":"sanitize_post( ${1:\\$post}${2:, \\$context = 'display'} )"
"Sanitize post field based on context.":
"prefix":"sanitize_post_field"
"body":"sanitize_post_field( ${1:\\$field}${2:, \\$value}${3:, \\$post_id}${4:, \\$context = 'display'} )"
"Ensures a string is a valid SQL 'order by' clause.":
"prefix":"sanitize_sql_orderby"
"body":"sanitize_sql_orderby( ${1:\\$orderby} )"
"Sanitize Term all fields.":
"prefix":"sanitize_term"
"body":"sanitize_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$context = 'display'} )"
"Cleanse the field value in the term based on the context.":
"prefix":"sanitize_term_field"
"body":"sanitize_term_field( ${1:\\$field}${2:, \\$value}${3:, \\$term_id}${4:, \\$taxonomy}${5:, \\$context} )"
"Sanitizes a string from user input or from the database.":
"prefix":"sanitize_text_field"
"body":"sanitize_text_field( ${1:\\$str} )"
"Sanitizes a multiline string from user input or from the database.":
"prefix":"sanitize_textarea_field"
"body":"sanitize_textarea_field( ${1:\\$str} )"
"Sanitizes a title, or returns a fallback title.":
"prefix":"sanitize_title"
"body":"sanitize_title( ${1:\\$title}${2:, \\$fallback_title = ''}${3:, \\$context = 'save'} )"
"Sanitizes a title with the 'query' context.":
"prefix":"sanitize_title_for_query"
"body":"sanitize_title_for_query( ${1:\\$title} )"
"Sanitizes a title, replacing whitespace and a few other characters with dashes.":
"prefix":"sanitize_title_with_dashes"
"body":"sanitize_title_with_dashes( ${1:\\$title}${2:, \\$raw_title = ''}${3:, \\$context = 'display'} )"
"Sanitize space or carriage return separated URLs that are used to send trackbacks.":
"prefix":"sanitize_trackback_urls"
"body":"sanitize_trackback_urls( ${1:\\$to_ping} )"
"Performs esc_url() for database or redirect usage.":
"prefix":"sanitize_url"
"body":"sanitize_url( ${1:\\$url}${2:, \\$protocols = null} )"
"Sanitizes a username, stripping out unsafe characters.":
"prefix":"sanitize_user"
"body":"sanitize_user( ${1:\\$username}${2:, \\$strict = false} )"
"Sanitize user field based on context.":
"prefix":"sanitize_user_field"
"body":"sanitize_user_field( ${1:\\$field}${2:, \\$value}${3:, \\$user_id}${4:, \\$context} )"
"Sanitize every user field.":
"prefix":"sanitize_user_object"
"body":"sanitize_user_object( ${1:\\$user}${2:, \\$context = 'display'} )"
"Updates the htaccess file with the current rules if it is writable.":
"prefix":"save_mod_rewrite_rules"
"body":"save_mod_rewrite_rules()"
"Saves the XML document into a file":
"prefix":"savedomdocument"
"body":"savedomdocument( ${1:\\$doc}${2:, \\$filename} )"
"Displays a screen icon.":
"prefix":"screen_icon"
"body":"screen_icon()"
"Returns the screen layout options.":
"prefix":"screen_layout"
"body":"screen_layout()"
"Renders the screen's help.":
"prefix":"screen_meta"
"body":"screen_meta()"
"Returns the screen's per-page options.":
"prefix":"screen_options"
"body":"screen_options()"
"Determine the concatenation and compression settings for scripts and styles.":
"prefix":"script_concat_settings"
"body":"script_concat_settings()"
"Search all registered theme directories for complete and valid themes.":
"prefix":"search_theme_directories"
"body":"search_theme_directories( ${1:\\$force = false} )"
"Checks to see if a string is utf8 encoded.":
"prefix":"seems_utf8"
"body":"seems_utf8( ${1:\\$str} )"
"Outputs the html selected attribute.":
"prefix":"selected"
"body":"selected( ${1:\\$selected}${2:, \\$current = true}${3:, \\$echo = true} )"
"Retrieves the URL to the admin area for either the current site or the network depending on context.":
"prefix":"self_admin_url"
"body":"self_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Display the link for the currently displayed feed in a XSS safe way.":
"prefix":"self_link"
"body":"self_link()"
"Sends an email when an email address change is requested.":
"prefix":"send_confirmation_on_profile_email"
"body":"send_confirmation_on_profile_email()"
"Send a HTTP header to limit rendering of pages to same origin iframes.":
"prefix":"send_frame_options_header"
"body":"send_frame_options_header()"
"Send a HTTP header to disable content type sniffing in browsers which support it.":
"prefix":"send_nosniff_header"
"body":"send_nosniff_header()"
"Send Access-Control-Allow-Origin and related headers if the current request
is from an allowed origin.":
"prefix":"send_origin_headers"
"body":"send_origin_headers()"
"Separates an array of comments into an array keyed by comment_type.":
"prefix":"separate_comments"
"body":"separate_comments( ${1:\\$comments} )"
"Set the current screen object":
"prefix":"set_current_screen"
"body":"set_current_screen( ${1:\\$hook_name = ''} )"
"Changes the current user by ID or name. set_current_user":
"prefix":"set_current_user"
"body":"set_current_user( ${1:\\$id}${2:, \\$name = ''} )"
"Assign a format to a post":
"prefix":"set_post_format"
"body":"set_post_format( ${1:\\$post}${2:, \\$format} )"
"Set a post thumbnail.":
"prefix":"set_post_thumbnail"
"body":"set_post_thumbnail( ${1:\\$post}${2:, \\$thumbnail_id} )"
"Registers an image size for the post thumbnail.":
"prefix":"set_post_thumbnail_size"
"body":"set_post_thumbnail_size( ${1:\\$width}${2:, \\$height}${3:, \\$crop = false} )"
"Update the post type for the post ID.":
"prefix":"set_post_type"
"body":"set_post_type( ${1:\\$post_id}${2:, \\$post_type = 'post'} )"
"Set query variable.":
"prefix":"set_query_var"
"body":"set_query_var( ${1:\\$var}${2:, \\$value} )"
"Saves option for number of rows when listing posts, pages, comments, etc.":
"prefix":"set_screen_options"
"body":"set_screen_options()"
"Set/update the value of a site transient.":
"prefix":"set_site_transient"
"body":"set_site_transient( ${1:\\$transient}${2:, \\$value}${3:, \\$expiration} )"
"Update theme modification value for the current theme.":
"prefix":"set_theme_mod"
"body":"set_theme_mod( ${1:\\$name}${2:, \\$value} )"
"Set/update the value of a transient.":
"prefix":"set_transient"
"body":"set_transient( ${1:\\$transient}${2:, \\$value}${3:, \\$expiration} )"
"Sets the scheme for a URL.":
"prefix":"set_url_scheme"
"body":"set_url_scheme( ${1:\\$url}${2:, \\$scheme = null} )"
"Add or update user interface setting.":
"prefix":"set_user_setting"
"body":"set_user_setting( ${1:\\$name}${2:, \\$value} )"
"Display settings errors registered by add_settings_error().":
"prefix":"settings_errors"
"body":"settings_errors( ${1:\\$setting = ''}${2:, \\$sanitize = false}${3:, \\$hide_on_update = false} )"
"Output nonce, action, and option_page fields for a settings page.":
"prefix":"settings_fields"
"body":"settings_fields( ${1:\\$option_group} )"
"setup_config_display_header":
"prefix":"setup_config_display_header"
"body":"setup_config_display_header()"
"Set up global post data.":
"prefix":"setup_postdata"
"body":"setup_postdata( ${1:\\$post} )"
"Set up global user vars.":
"prefix":"setup_userdata"
"body":"setup_userdata( ${1:\\$for_user_id = ''} )"
"Combine user attributes with known attributes and fill in defaults when needed.":
"prefix":"shortcode_atts"
"body":"shortcode_atts( ${1:\\$pairs}${2:, \\$atts}${3:, \\$shortcode = ''} )"
"Whether a registered shortcode exists named $tag":
"prefix":"shortcode_exists"
"body":"shortcode_exists( ${1:\\$tag} )"
"Retrieve all attributes from the shortcodes tag.":
"prefix":"shortcode_parse_atts"
"body":"shortcode_parse_atts( ${1:\\$text} )"
"Don't auto-p wrap shortcodes that stand alone":
"prefix":"shortcode_unautop"
"body":"shortcode_unautop( ${1:\\$pee} )"
"Sets the display status of the admin bar.":
"prefix":"show_admin_bar"
"body":"show_admin_bar( ${1:\\$show} )"
"Generates and displays the Signup and Create Site forms":
"prefix":"show_blog_form"
"body":"show_blog_form( ${1:\\$blogname = ''}${2:, \\$blog_title = ''}${3:, \\$errors = ''} )"
"Displays the given administration message.":
"prefix":"show_message"
"body":"show_message( ${1:\\$message} )"
"Display user registration form":
"prefix":"show_user_form"
"body":"show_user_form( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$errors = ''} )"
"Runs just before PHP shuts down execution.":
"prefix":"shutdown_action_hook"
"body":"shutdown_action_hook()"
"Allow returning users to sign up for another site":
"prefix":"signup_another_blog"
"body":"signup_another_blog( ${1:\\$blogname = ''}${2:, \\$blog_title = ''}${3:, \\$errors = ''} )"
"Setup the new site signup":
"prefix":"signup_blog"
"body":"signup_blog( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$blogname = ''}${4:, \\$blog_title = ''}${5:, \\$errors = ''} )"
"Retrieves languages available during the site/user signup process.":
"prefix":"signup_get_available_languages"
"body":"signup_get_available_languages()"
"Process the signup nonce created in signup_nonce_fields().":
"prefix":"signup_nonce_check"
"body":"signup_nonce_check( ${1:\\$result} )"
"Add a nonce field to the signup page.":
"prefix":"signup_nonce_fields"
"body":"signup_nonce_fields()"
"Setup the new user signup process":
"prefix":"signup_user"
"body":"signup_user( ${1:\\$user_name = ''}${2:, \\$user_email = ''}${3:, \\$errors = ''} )"
"Display or retrieve page title for category archive.":
"prefix":"single_cat_title"
"body":"single_cat_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for post archive based on date.":
"prefix":"single_month_title"
"body":"single_month_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for post.":
"prefix":"single_post_title"
"body":"single_post_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for tag post archive.":
"prefix":"single_tag_title"
"body":"single_tag_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Display or retrieve page title for taxonomy term archive.":
"prefix":"single_term_title"
"body":"single_term_title( ${1:\\$prefix = ''}${2:, \\$display = true} )"
"Displays an admin notice to upgrade all sites after a core upgrade.":
"prefix":"site_admin_notice"
"body":"site_admin_notice()"
"Displays the Site Icon URL.":
"prefix":"site_icon_url"
"body":"site_icon_url( ${1:\\$size = 512}${2:, \\$url = ''}${3:, \\$blog_id} )"
"Retrieves the URL for the current site where WordPress application files
(e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.":
"prefix":"site_url"
"body":"site_url( ${1:\\$path = ''}${2:, \\$scheme = null} )"
"Convert number of bytes largest unit bytes will fit into.":
"prefix":"size_format"
"body":"size_format( ${1:\\$bytes}${2:, \\$decimals} )"
"Convert smiley code to the icon graphic file equivalent.":
"prefix":"smilies_init"
"body":"smilies_init()"
"sort_menu":
"prefix":"sort_menu"
"body":"sort_menu( ${1:\\$a}${2:, \\$b} )"
"Sends a request to run cron through HTTP request that doesn't halt page loading.":
"prefix":"spawn_cron"
"body":"spawn_cron( ${1:\\$gmt_time} )"
"Retrieves the registered autoloader functions.":
"prefix":"spl_autoload_functions"
"body":"spl_autoload_functions()"
"Registers a function to be autoloaded.":
"prefix":"spl_autoload_register"
"body":"spl_autoload_register( ${1:\\$autoload_function}${2:, \\$throw = true}${3:, \\$prepend = false} )"
"Unregisters an autoloader function.":
"prefix":"spl_autoload_unregister"
"body":"spl_autoload_unregister( ${1:\\$function} )"
"Display relational link for the first post.":
"prefix":"start_post_rel_link"
"body":"start_post_rel_link( ${1:\\$title = '%title'}${2:, \\$in_same_cat = false}${3:, \\$excluded_categories = ''} )"
"Sets up the WordPress Loop.":
"prefix":"start_wp"
"body":"start_wp()"
"XML callback function for the start of a new XML tag.":
"prefix":"startelement"
"body":"startelement( ${1:\\$parser}${2:, \\$tagName}${3:, \\$attrs} )"
"Set HTTP status header.":
"prefix":"status_header"
"body":"status_header( ${1:\\$code}${2:, \\$description = ''} )"
"Make a post sticky.":
"prefix":"stick_post"
"body":"stick_post( ${1:\\$post_id} )"
"Display "sticky" CSS class, if a post is sticky.":
"prefix":"sticky_class"
"body":"sticky_class( ${1:\\$post_id = null} )"
"Streams image in post to browser, along with enqueued changes
in $_REQUEST['history']":
"prefix":"stream_preview_image"
"body":"stream_preview_image( ${1:\\$post_id} )"
"Strips the #fragment from a URL, if one is present.":
"prefix":"strip_fragment_from_url"
"body":"strip_fragment_from_url( ${1:\\$url} )"
"Strips a shortcode tag based on RegEx matches against post content.":
"prefix":"strip_shortcode_tag"
"body":"strip_shortcode_tag( ${1:\\$m} )"
"Remove all shortcode tags from the given content.":
"prefix":"strip_shortcodes"
"body":"strip_shortcodes( ${1:\\$content} )"
"Navigates through an array, object, or scalar, and removes slashes from the values.":
"prefix":"stripslashes_deep"
"body":"stripslashes_deep( ${1:\\$value} )"
"Callback function for `stripslashes_deep()` which strips slashes from strings.":
"prefix":"stripslashes_from_strings_only"
"body":"stripslashes_from_strings_only( ${1:\\$value} )"
"Echoes a submit button, with provided text and appropriate class(es).":
"prefix":"submit_button"
"body":"submit_button( ${1:\\$text = null}${2:, \\$type = 'primary'}${3:, \\$name = 'submit'}${4:, \\$wrap = true}${5:, \\$other_attributes = null} )"
"Switches the theme.":
"prefix":"switch_theme"
"body":"switch_theme( ${1:\\$stylesheet} )"
"Switch the current blog.":
"prefix":"switch_to_blog"
"body":"switch_to_blog( ${1:\\$new_blog}${2:, \\$deprecated = null} )"
"Switches the translations according to the given locale.":
"prefix":"switch_to_locale"
"body":"switch_to_locale( ${1:\\$locale} )"
"Synchronize category and post tag slugs when global terms are enabled.":
"prefix":"sync_category_tag_slugs"
"body":"sync_category_tag_slugs( ${1:\\$term}${2:, \\$taxonomy} )"
"Retrieve tag description.":
"prefix":"tag_description"
"body":"tag_description( ${1:\\$tag} )"
"Escape an HTML tag name.":
"prefix":"tag_escape"
"body":"tag_escape( ${1:\\$tag_name} )"
"Check whether a post tag with a given name exists.":
"prefix":"tag_exists"
"body":"tag_exists( ${1:\\$tag_name} )"
"Checks that the taxonomy name exists. taxonomy_exists":
"prefix":"taxonomy_exists"
"body":"taxonomy_exists( ${1:\\$taxonomy} )"
"Retrieve term description.":
"prefix":"term_description"
"body":"term_description( ${1:\\$term}${2:, \\$taxonomy = 'post_tag'} )"
"Check if Term exists term_exists.":
"prefix":"term_exists"
"body":"term_exists( ${1:\\$term}${2:, \\$taxonomy = ''}${3:, \\$parent = null} )"
"Check if a term is an ancestor of another term.":
"prefix":"term_is_ancestor_of"
"body":"term_is_ancestor_of( ${1:\\$term1}${2:, \\$term2}${3:, \\rel$taxonomy} )"
"Display category, tag, term, or author description.":
"prefix":"the_archive_description"
"body":"the_archive_description( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Display the archive title based on the queried object.":
"prefix":"the_archive_title"
"body":"the_archive_title( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Display an attachment page link using an image or icon.":
"prefix":"the_attachment_link"
"body":"the_attachment_link( ${1:\\$id}${2:, \\$fullsize = false}${3:, \\$deprecated = false}${4:, \\$permalink = false} )"
"This was once used to display attachment links. Now it is deprecated and stubbed.":
"prefix":"the_attachment_links"
"body":"the_attachment_links( ${1:\\$id = false} )"
"Display the name of the author of the current post.":
"prefix":"the_author"
"body":"the_author( ${1:\\$deprecated = ''}${2:, \\$deprecated_echo = true} )"
"Display the AIM address of the author of the current post.":
"prefix":"the_author_aim"
"body":"the_author_aim()"
"Display the description of the author of the current post.":
"prefix":"the_author_description"
"body":"the_author_description()"
"Display the email of the author of the current post.":
"prefix":"the_author_email"
"body":"the_author_email()"
"Display the first name of the author of the current post.":
"prefix":"the_author_firstname"
"body":"the_author_firstname()"
"Display the ICQ number of the author of the current post.":
"prefix":"the_author_icq"
"body":"the_author_icq()"
"Display the ID of the author of the current post.":
"prefix":"the_author_id"
"body":"the_author_id()"
"Display the last name of the author of the current post.":
"prefix":"the_author_lastname"
"body":"the_author_lastname()"
"Display either author's link or author's name.":
"prefix":"the_author_link"
"body":"the_author_link()"
"Display the login name of the author of the current post.":
"prefix":"the_author_login"
"body":"the_author_login()"
"Outputs the field from the user's DB object. Defaults to current post's author.":
"prefix":"the_author_meta"
"body":"the_author_meta( ${1:\\$field = ''}${2:, \\$user_id = false} )"
"Display the MSN address of the author of the current post.":
"prefix":"the_author_msn"
"body":"the_author_msn()"
"Display the nickname of the author of the current post.":
"prefix":"the_author_nickname"
"body":"the_author_nickname()"
"Display the number of posts by the author of the current post.":
"prefix":"the_author_posts"
"body":"the_author_posts()"
"Displays an HTML link to the author page of the current post's author.":
"prefix":"the_author_posts_link"
"body":"the_author_posts_link( ${1:\\$deprecated = ''} )"
"Display the URL to the home page of the author of the current post.":
"prefix":"the_author_url"
"body":"the_author_url()"
"Display the Yahoo! IM name of the author of the current post.":
"prefix":"the_author_yim"
"body":"the_author_yim()"
"Display category list for a post in either HTML list or custom format.":
"prefix":"the_category"
"body":"the_category( ${1:\\$separator = ''}${2:, \\$parents = ''}${3:, \\$post_id = false} )"
"Prints a category with optional text before and after.":
"prefix":"the_category_head"
"body":"the_category_head( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Returns or prints a category ID.":
"prefix":"the_category_id"
"body":"the_category_id( ${1:\\$echo = true} )"
"Display the post categories in the feed.":
"prefix":"the_category_rss"
"body":"the_category_rss( ${1:\\$type = null} )"
"Iterate comment index in the comment loop.":
"prefix":"the_comment"
"body":"the_comment()"
"Displays navigation to next/previous set of comments, when applicable.":
"prefix":"the_comments_navigation"
"body":"the_comments_navigation( ${1:\\$args = array()} )"
"Displays a paginated navigation to next/previous set of comments, when applicable.":
"prefix":"the_comments_pagination"
"body":"the_comments_pagination( ${1:\\$args = array()} )"
"Display the post content.":
"prefix":"the_content"
"body":"the_content( ${1:\\$more_link_text = null}${2:, \\$strip_teaser = false} )"
"Display the post content for feeds.":
"prefix":"the_content_feed"
"body":"the_content_feed( ${1:\\$feed_type = null} )"
"Display the post content for the feed.":
"prefix":"the_content_rss"
"body":"the_content_rss( ${1:\\$more_link_text = '(more...)'}${2:, \\$stripteaser}${3:, \\$more_file = ''}${4:, \\$cut}${5:, \\$encode_html} )"
"Print the markup for a custom header.":
"prefix":"the_custom_header_markup"
"body":"the_custom_header_markup()"
"Displays a custom logo, linked to home.":
"prefix":"the_custom_logo"
"body":"the_custom_logo( ${1:\\$blog_id} )"
"Display or Retrieve the date the current post was written (once per date)":
"prefix":"the_date"
"body":"the_date( ${1:\\$d = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$echo = true} )"
"Outputs the date in iso8601 format for xml files.":
"prefix":"the_date_xml"
"body":"the_date_xml()"
"Displays an editor: TinyMCE, HTML, or both.":
"prefix":"the_editor"
"body":"the_editor( ${1:\\$content}${2:, \\$id = 'content'}${3:, \\$prev_id = 'title'}${4:, \\$media_buttons = true}${5:, \\$tab_index = 2}${6:, \\$extended = true} )"
"Prints the necessary markup for the site title in an embed template.":
"prefix":"the_embed_site_title"
"body":"the_embed_site_title()"
"Display the post excerpt.":
"prefix":"the_excerpt"
"body":"the_excerpt()"
"Displays the post excerpt for the embed template.":
"prefix":"the_excerpt_embed"
"body":"the_excerpt_embed()"
"Display the post excerpt for the feed.":
"prefix":"the_excerpt_rss"
"body":"the_excerpt_rss()"
"Displays the permalink for the feed type.":
"prefix":"the_feed_link"
"body":"the_feed_link( ${1:\\$anchor}${2:, \\$feed = ''} )"
"Display the generator XML or Comment for RSS, ATOM, etc.":
"prefix":"the_generator"
"body":"the_generator( ${1:\\$type} )"
"Display the Post Global Unique Identifier (guid).":
"prefix":"the_guid"
"body":"the_guid( ${1:\\$post} )"
"Display the image markup for a custom header image.":
"prefix":"the_header_image_tag"
"body":"the_header_image_tag( ${1:\\$attr = array()} )"
"Display header video URL.":
"prefix":"the_header_video_url"
"body":"the_header_video_url()"
"Display the ID of the current item in the WordPress Loop.":
"prefix":"the_id"
"body":"the_id()"
"Outputs the legacy media upload tabs UI.":
"prefix":"the_media_upload_tabs"
"body":"the_media_upload_tabs()"
"Display list of post custom fields.":
"prefix":"the_meta"
"body":"the_meta()"
"Display the name of the author who last edited the current post,
if the author's ID is available.":
"prefix":"the_modified_author"
"body":"the_modified_author()"
"Display the date on which the post was last modified.":
"prefix":"the_modified_date"
"body":"the_modified_date( ${1:\\$d = ''}${2:, \\$before = ''}${3:, \\$after = ''}${4:, \\$echo = true} )"
"Display the time at which the post was last modified.":
"prefix":"the_modified_time"
"body":"the_modified_time( ${1:\\$d = ''} )"
"Displays the permalink for the current post.":
"prefix":"the_permalink"
"body":"the_permalink( ${1:\\$post} )"
"Display the permalink to the post for use in feeds.":
"prefix":"the_permalink_rss"
"body":"the_permalink_rss()"
"Iterate the post index in the loop.":
"prefix":"the_post"
"body":"the_post()"
"Displays the navigation to next/previous post, when applicable.":
"prefix":"the_post_navigation"
"body":"the_post_navigation( ${1:\\$args = array()} )"
"Displays the post password.":
"prefix":"the_post_password"
"body":"the_post_password()"
"Display the post thumbnail.":
"prefix":"the_post_thumbnail"
"body":"the_post_thumbnail( ${1:\\$size = 'post-thumbnail'}${2:, \\$attr = ''} )"
"Displays the post thumbnail caption.":
"prefix":"the_post_thumbnail_caption"
"body":"the_post_thumbnail_caption( ${1:\\$post = null} )"
"Display the post thumbnail URL.":
"prefix":"the_post_thumbnail_url"
"body":"the_post_thumbnail_url( ${1:\\$size = 'post-thumbnail'} )"
"Displays the navigation to next/previous set of posts, when applicable.":
"prefix":"the_posts_navigation"
"body":"the_posts_navigation( ${1:\\$args = array()} )"
"Displays a paginated navigation to next/previous set of posts, when applicable.":
"prefix":"the_posts_pagination"
"body":"the_posts_pagination( ${1:\\$args = array()} )"
"Displays the contents of the search query variable.":
"prefix":"the_search_query"
"body":"the_search_query()"
"Displays the shortlink for a post.":
"prefix":"the_shortlink"
"body":"the_shortlink( ${1:\\$text = ''}${2:, \\$title = ''}${3:, \\$before = ''}${4:, \\$after = ''} )"
"Retrieve the tags for a post. the_tags":
"prefix":"the_tags"
"body":"the_tags( ${1:\\$before = null}${2:, \\$sep = ', '}${3:, \\$after = ''} )"
"Display the taxonomies of a post with available options.":
"prefix":"the_taxonomies"
"body":"the_taxonomies( ${1:\\$args = array()} )"
"Display the terms in a list.":
"prefix":"the_terms"
"body":"the_terms( ${1:\\$id}${2:, \\$taxonomy}${3:, \\$before = ''}${4:, \\$sep = ', '}${5:, \\$after = ''} )"
"Display the time at which the post was written.":
"prefix":"the_time"
"body":"the_time( ${1:\\$d = ''} )"
"Display or retrieve the current post title with optional markup.":
"prefix":"the_title"
"body":"the_title( ${1:\\$before = ''}${2:, \\$after = ''}${3:, \\$echo = true} )"
"Sanitize the current title when retrieving or displaying.":
"prefix":"the_title_attribute"
"body":"the_title_attribute( ${1:\\$args = ''} )"
"Display the post title in the feed.":
"prefix":"the_title_rss"
"body":"the_title_rss()"
"Display the weekday on which the post was written. the_weekdayre":
"prefix":"the_weekday"
"body":"the_weekday()"
"Display the weekday on which the post was written.":
"prefix":"the_weekday_date"
"body":"the_weekday_date( ${1:\\$before = ''}${2:, \\$after = ''} )"
"Output an arbitrary widget as a template tag.":
"prefix":"the_widget"
"body":"the_widget( ${1:\\$widget}${2:, \\$instance = array()}${3:, \\$args = array()} )"
"Check if there is an update for a theme available.":
"prefix":"theme_update_available"
"body":"theme_update_available( ${1:\\$theme} )"
"Retrieves theme installer pages from the WordPress.org Themes API.":
"prefix":"themes_api"
"body":"themes_api( ${1:\\$action}${2:, \\$args = array()} )"
"Start the WordPress micro-timer.":
"prefix":"timer_start"
"body":"timer_start()"
"Retrieve or display the time from the page start to when function is called.":
"prefix":"timer_stop"
"body":"timer_stop( ${1:\\$display}${2:, \\$precision = 3} )"
"tinymce_include":
"prefix":"tinymce_include"
"body":"tinymce_include()"
"Print out HTML form date elements for editing post or comment publish date.":
"prefix":"touch_time"
"body":"touch_time( ${1:\\$edit = 1}${2:, \\$for_post = 1}${3:, \\$tab_index}${4:, \\$multi} )"
"Send a Trackback.":
"prefix":"trackback"
"body":"trackback( ${1:\\$trackback_url}${2:, \\$title}${3:, \\$excerpt}${4:, \\$ID} )"
"Generate and display the RDF for the trackback information of current post.":
"prefix":"trackback_rdf"
"body":"trackback_rdf( ${1:\\$deprecated = ''} )"
"Response to a trackback.":
"prefix":"trackback_response"
"body":"trackback_response( ${1:\\$error}${2:, \\$error_message = ''} )"
"Display the current post's trackback URL.":
"prefix":"trackback_url"
"body":"trackback_url( ${1:\\$deprecated_echo = true} )"
"Do trackbacks for a list of URLs.":
"prefix":"trackback_url_list"
"body":"trackback_url_list( ${1:\\$tb_list}${2:, \\$post_id} )"
"Appends a trailing slash.":
"prefix":"trailingslashit"
"body":"trailingslashit( ${1:\\$string} )"
"Retrieve the translation of $text. translate":
"prefix":"translate"
"body":"translate( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Translate user level to user role name.":
"prefix":"translate_level_to_role"
"body":"translate_level_to_role( ${1:\\$level} )"
"Translates and retrieves the singular or plural form of a string that's been registered
with _n_noop() or _nx_noop().":
"prefix":"translate_nooped_plural"
"body":"translate_nooped_plural( ${1:\\$nooped_plural}${2:, \\$count}${3:, \\$domain = 'default'} )"
"Convert one smiley code to the icon graphic file equivalent.":
"prefix":"translate_smiley"
"body":"translate_smiley( ${1:\\$matches} )"
"Translates role name.":
"prefix":"translate_user_role"
"body":"translate_user_role( ${1:\\$name} )"
"Translates $text like translate(), but assumes that the text
contains a context after its last vertical bar.":
"prefix":"translate_with_context"
"body":"translate_with_context( ${1:\\$text}${2:, \\$domain = 'default'} )"
"Retrieve the translation of $text in the context defined in $context.":
"prefix":"translate_with_gettext_context"
"body":"translate_with_gettext_context( ${1:\\$text}${2:, \\$context}${3:, \\$domain = 'default'} )"
"Retrieve translations from WordPress Translation API.":
"prefix":"translations_api"
"body":"translations_api( ${1:\\$type}${2:, \\$args = null} )"
"Handles retrieving the insert-from-URL form for an audio file.":
"prefix":"type_url_form_audio"
"body":"type_url_form_audio()"
"Handles retrieving the insert-from-URL form for a generic file.":
"prefix":"type_url_form_file"
"body":"type_url_form_file()"
"Handles retrieving the insert-from-URL form for an image.":
"prefix":"type_url_form_image"
"body":"type_url_form_image()"
"Handles retrieving the insert-from-URL form for a video file.":
"prefix":"type_url_form_video"
"body":"type_url_form_video()"
"undismiss_core_update":
"prefix":"undismiss_core_update"
"body":"undismiss_core_update( ${1:\\$version}${2:, \\$locale} )"
"Remove placeholders added by do_shortcodes_in_html_tags().":
"prefix":"unescape_invalid_shortcodes"
"body":"unescape_invalid_shortcodes( ${1:\\$content} )"
"Uninstall a single plugin.":
"prefix":"uninstall_plugin"
"body":"uninstall_plugin( ${1:\\$plugin} )"
"Unload translations for a text domain.":
"prefix":"unload_textdomain"
"body":"unload_textdomain( ${1:\\$domain} )"
"Unregister default headers.":
"prefix":"unregister_default_headers"
"body":"unregister_default_headers( ${1:\\$header} )"
"Unregisters a meta key from the list of registered keys.":
"prefix":"unregister_meta_key"
"body":"unregister_meta_key( ${1:\\$object_type}${2:, \\$meta_key} )"
"Unregisters a navigation menu location for a theme.":
"prefix":"unregister_nav_menu"
"body":"unregister_nav_menu( ${1:\\$location} )"
"Unregisters a post type.":
"prefix":"unregister_post_type"
"body":"unregister_post_type( ${1:\\$post_type} )"
"Unregister a setting.":
"prefix":"unregister_setting"
"body":"unregister_setting( ${1:\\$option_group}${2:, \\$option_name}${3:, \\$deprecated = ''} )"
"Removes a sidebar from the list.":
"prefix":"unregister_sidebar"
"body":"unregister_sidebar( ${1:\\$sidebar_id} )"
"Serves as an alias of wp_unregister_sidebar_widget().":
"prefix":"unregister_sidebar_widget"
"body":"unregister_sidebar_widget( ${1:\\$id} )"
"Unregisters a taxonomy.":
"prefix":"unregister_taxonomy"
"body":"unregister_taxonomy( ${1:\\$taxonomy} )"
"Remove an already registered taxonomy from an object type.":
"prefix":"unregister_taxonomy_for_object_type"
"body":"unregister_taxonomy_for_object_type( ${1:\\$taxonomy}${2:, \\$object_type} )"
"Unregisters a widget.":
"prefix":"unregister_widget"
"body":"unregister_widget( ${1:\\$widget_class} )"
"Alias of wp_unregister_widget_control().":
"prefix":"unregister_widget_control"
"body":"unregister_widget_control( ${1:\\$id} )"
"Un-stick a post.":
"prefix":"unstick_post"
"body":"unstick_post( ${1:\\$post_id} )"
"Removes trailing forward slashes and backslashes if they exist.":
"prefix":"untrailingslashit"
"body":"untrailingslashit( ${1:\\$string} )"
"Unzips a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction.":
"prefix":"unzip_file"
"body":"unzip_file( ${1:\\$file}${2:, \\$to} )"
"Update the 'archived' status of a particular blog.":
"prefix":"update_archived"
"body":"update_archived( ${1:\\$id}${2:, \\$archived} )"
"Update attachment file path based on attachment ID.":
"prefix":"update_attached_file"
"body":"update_attached_file( ${1:\\$attachment_id}${2:, \\$file} )"
"Update the details for a blog. Updates the blogs table for a given blog id.":
"prefix":"update_blog_details"
"body":"update_blog_details( ${1:\\$blog_id}${2:, \\$details = array()} )"
"Update an option for a particular blog.":
"prefix":"update_blog_option"
"body":"update_blog_option( ${1:\\$id}${2:, \\$option}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update this blog's 'public' setting in the global blogs table.":
"prefix":"update_blog_public"
"body":"update_blog_public( ${1:\\$old_value}${2:, \\$value} )"
"Update a blog details field.":
"prefix":"update_blog_status"
"body":"update_blog_status( ${1:\\$blog_id}${2:, \\$pref}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update the categories cache.":
"prefix":"update_category_cache"
"body":"update_category_cache()"
"Updates the comment cache of given comments.":
"prefix":"update_comment_cache"
"body":"update_comment_cache( ${1:\\$comments}${2:, \\$update_meta_cache = true} )"
"Update comment meta field based on comment ID.":
"prefix":"update_comment_meta"
"body":"update_comment_meta( ${1:\\$comment_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Upgrades the core of WordPress.":
"prefix":"update_core"
"body":"update_core( ${1:\\$from}${2:, \\$to} )"
"Adds the gallery tab back to the tabs array if post has image attachments":
"prefix":"update_gallery_tab"
"body":"update_gallery_tab( ${1:\\$tabs} )"
"Flushes rewrite rules if siteurl, home or page_on_front changed.":
"prefix":"update_home_siteurl"
"body":"update_home_siteurl( ${1:\\$old_value}${2:, \\$value} )"
"Update post meta data by meta ID.":
"prefix":"update_meta"
"body":"update_meta( ${1:\\$meta_id}${2:, \\$meta_key}${3:, \\$meta_value} )"
"Update the metadata cache for the specified objects.":
"prefix":"update_meta_cache"
"body":"update_meta_cache( ${1:\\$meta_type}${2:, \\$object_ids} )"
"Update metadata for the specified object. If no value already exists for the specified object
ID and metadata key, the metadata will be added.":
"prefix":"update_metadata"
"body":"update_metadata( ${1:\\$meta_type}${2:, \\$object_id}${3:, \\$meta_key}${4:, \\$meta_value}${5:, \\$prev_value = ''} )"
"Update meta data by meta ID":
"prefix":"update_metadata_by_mid"
"body":"update_metadata_by_mid( ${1:\\$meta_type}${2:, \\$meta_id}${3:, \\$meta_value}${4:, \\$meta_key = false} )"
"update_nag":
"prefix":"update_nag"
"body":"update_nag()"
"Updates the network cache of given networks.":
"prefix":"update_network_cache"
"body":"update_network_cache( ${1:\\$networks} )"
"Update the value of a network option that was already added.":
"prefix":"update_network_option"
"body":"update_network_option( ${1:\\$network_id}${2:, \\$option}${3:, \\$value} )"
"Updates the cache for the given term object ID(s).":
"prefix":"update_object_term_cache"
"body":"update_object_term_cache( ${1:\\$object_ids}${2:, \\$object_type} )"
"Update the value of an option that was already added.":
"prefix":"update_option"
"body":"update_option( ${1:\\$option}${2:, \\$value}${3:, \\$autoload = null} )"
"Sends an email when a site administrator email address is changed.":
"prefix":"update_option_new_admin_email"
"body":"update_option_new_admin_email( ${1:\\$old_value}${2:, \\$value} )"
"Alias of update_post_cache().":
"prefix":"update_page_cache"
"body":"update_page_cache( ${1:\\$pages} )"
"Updates posts in cache.":
"prefix":"update_post_cache"
"body":"update_post_cache( ${1:\\$posts} )"
"Call major cache updating functions for list of Post objects.":
"prefix":"update_post_caches"
"body":"update_post_caches( ${1:\\$posts}${2:, \\$post_type = 'post'}${3:, \\$update_term_cache = true}${4:, \\$update_meta_cache = true} )"
"Update post meta field based on post ID.":
"prefix":"update_post_meta"
"body":"update_post_meta( ${1:\\$post_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Update cache for thumbnails in the current loop.":
"prefix":"update_post_thumbnail_cache"
"body":"update_post_thumbnail_cache( ${1:\\$wp_query = null} )"
"Updates metadata cache for list of post IDs.":
"prefix":"update_postmeta_cache"
"body":"update_postmeta_cache( ${1:\\$post_ids} )"
"Update a blog's post count.":
"prefix":"update_posts_count"
"body":"update_posts_count( ${1:\\$deprecated = ''} )"
"Update the "recently-edited" file for the plugin or theme editor.":
"prefix":"update_recently_edited"
"body":"update_recently_edited( ${1:\\$file} )"
"update_right_now_message":
"prefix":"update_right_now_message"
"body":"update_right_now_message()"
"Updates sites in cache.":
"prefix":"update_site_cache"
"body":"update_site_cache( ${1:\\$sites} )"
"Update the value of an option that was already added for the current network.":
"prefix":"update_site_option"
"body":"update_site_option( ${1:\\$option}${2:, \\$value} )"
"Updates Terms to Taxonomy in cache.":
"prefix":"update_term_cache"
"body":"update_term_cache( ${1:\\$terms}${2:, \\$taxonomy = ''} )"
"Updates term metadata.":
"prefix":"update_term_meta"
"body":"update_term_meta( ${1:\\$term_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Updates metadata cache for list of term IDs.":
"prefix":"update_termmeta_cache"
"body":"update_termmeta_cache( ${1:\\$term_ids} )"
"Update all user caches":
"prefix":"update_user_caches"
"body":"update_user_caches( ${1:\\$user} )"
"Update user meta field based on user ID.":
"prefix":"update_user_meta"
"body":"update_user_meta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value}${4:, \\$prev_value = ''} )"
"Update user option with global blog capability.":
"prefix":"update_user_option"
"body":"update_user_option( ${1:\\$user_id}${2:, \\$option_name}${3:, \\$newvalue}${4:, \\$global = false} )"
"Update the status of a user in the database.":
"prefix":"update_user_status"
"body":"update_user_status( ${1:\\$id}${2:, \\$pref}${3:, \\$value}${4:, \\$deprecated = null} )"
"Update metadata of user.":
"prefix":"update_usermeta"
"body":"update_usermeta( ${1:\\$user_id}${2:, \\$meta_key}${3:, \\$meta_value} )"
"Execute changes made in WordPress 1.0.":
"prefix":"upgrade_100"
"body":"upgrade_100()"
"Execute changes made in WordPress 1.0.1.":
"prefix":"upgrade_101"
"body":"upgrade_101()"
"Execute changes made in WordPress 1.2.":
"prefix":"upgrade_110"
"body":"upgrade_110()"
"Execute changes made in WordPress 1.5.":
"prefix":"upgrade_130"
"body":"upgrade_130()"
"Execute changes made in WordPress 2.0.":
"prefix":"upgrade_160"
"body":"upgrade_160()"
"Execute changes made in WordPress 2.1.":
"prefix":"upgrade_210"
"body":"upgrade_210()"
"Execute changes made in WordPress 2.3.":
"prefix":"upgrade_230"
"body":"upgrade_230()"
"Remove old categories, link2cat, and post2cat database tables.":
"prefix":"upgrade_230_old_tables"
"body":"upgrade_230_old_tables()"
"Remove old options from the database.":
"prefix":"upgrade_230_options_table"
"body":"upgrade_230_options_table()"
"Execute changes made in WordPress 2.5.0.":
"prefix":"upgrade_250"
"body":"upgrade_250()"
"Execute changes made in WordPress 2.5.2.":
"prefix":"upgrade_252"
"body":"upgrade_252()"
"Execute changes made in WordPress 2.6.":
"prefix":"upgrade_260"
"body":"upgrade_260()"
"Execute changes made in WordPress 2.7.":
"prefix":"upgrade_270"
"body":"upgrade_270()"
"Execute changes made in WordPress 2.8.":
"prefix":"upgrade_280"
"body":"upgrade_280()"
"Execute changes made in WordPress 2.9.":
"prefix":"upgrade_290"
"body":"upgrade_290()"
"Execute changes made in WordPress 3.0.":
"prefix":"upgrade_300"
"body":"upgrade_300()"
"Execute changes made in WordPress 3.3.":
"prefix":"upgrade_330"
"body":"upgrade_330()"
"Execute changes made in WordPress 3.4.":
"prefix":"upgrade_340"
"body":"upgrade_340()"
"Execute changes made in WordPress 3.5.":
"prefix":"upgrade_350"
"body":"upgrade_350()"
"Execute changes made in WordPress 3.7.":
"prefix":"upgrade_370"
"body":"upgrade_370()"
"Execute changes made in WordPress 3.7.2.":
"prefix":"upgrade_372"
"body":"upgrade_372()"
"Execute changes made in WordPress 3.8.0.":
"prefix":"upgrade_380"
"body":"upgrade_380()"
"Execute changes made in WordPress 4.0.0.":
"prefix":"upgrade_400"
"body":"upgrade_400()"
"Execute changes made in WordPress 4.2.0.":
"prefix":"upgrade_420"
"body":"upgrade_420()"
"Executes changes made in WordPress 4.3.0.":
"prefix":"upgrade_430"
"body":"upgrade_430()"
"Executes comments changes made in WordPress 4.3.0.":
"prefix":"upgrade_430_fix_comments"
"body":"upgrade_430_fix_comments()"
"Executes changes made in WordPress 4.3.1.":
"prefix":"upgrade_431"
"body":"upgrade_431()"
"Executes changes made in WordPress 4.4.0.":
"prefix":"upgrade_440"
"body":"upgrade_440()"
"Executes changes made in WordPress 4.5.0.":
"prefix":"upgrade_450"
"body":"upgrade_450()"
"Executes changes made in WordPress 4.6.0.":
"prefix":"upgrade_460"
"body":"upgrade_460()"
"Functions to be called in install and upgrade scripts.":
"prefix":"upgrade_all"
"body":"upgrade_all()"
"Executes network-level upgrade routines.":
"prefix":"upgrade_network"
"body":"upgrade_network()"
"Upgrade old slugs made in version 2.2.":
"prefix":"upgrade_old_slugs"
"body":"upgrade_old_slugs()"
"Check whether an upload is too big.":
"prefix":"upload_is_file_too_big"
"body":"upload_is_file_too_big( ${1:\\$upload} )"
"Check whether a site has used its allotted upload space.":
"prefix":"upload_is_user_over_quota"
"body":"upload_is_user_over_quota( ${1:\\$echo = true} )"
"Filters the maximum upload file size allowed, in bytes.":
"prefix":"upload_size_limit_filter"
"body":"upload_size_limit_filter( ${1:\\$size} )"
"Displays the site upload space quota setting form on the Edit Site Settings screen.":
"prefix":"upload_space_setting"
"body":"upload_space_setting( ${1:\\$id} )"
"Determines if the URL can be accessed over SSL.":
"prefix":"url_is_accessable_via_ssl"
"body":"url_is_accessable_via_ssl( ${1:\\$url} )"
"Shorten a URL, to be used as link text.":
"prefix":"url_shorten"
"body":"url_shorten( ${1:\\$url}${2:, \\$length = 35} )"
"Examine a URL and try to determine the post ID it represents.":
"prefix":"url_to_postid"
"body":"url_to_postid( ${1:\\$url} )"
"Navigates through an array, object, or scalar, and decodes URL-encoded values":
"prefix":"urldecode_deep"
"body":"urldecode_deep( ${1:\\$value} )"
"Navigates through an array, object, or scalar, and encodes the values to be used in a URL.":
"prefix":"urlencode_deep"
"body":"urlencode_deep( ${1:\\$value} )"
"Determine whether to use CodePress.":
"prefix":"use_codepress"
"body":"use_codepress()"
"Optional SSL preference that can be turned on by hooking to the 'personal_options' action.":
"prefix":"use_ssl_preference"
"body":"use_ssl_preference( ${1:\\$user} )"
"Retrieves the URL to the admin area for the current user.":
"prefix":"user_admin_url"
"body":"user_admin_url( ${1:\\$path = ''}${2:, \\$scheme = 'admin'} )"
"Whether a particular user has capability or role.":
"prefix":"user_can"
"body":"user_can( ${1:\\$user}${2:, \\$capability} )"
"user_can_access_admin_page":
"prefix":"user_can_access_admin_page"
"body":"user_can_access_admin_page()"
"Whether user can create a post. user_can_create_draft":
"prefix":"user_can_create_draft"
"body":"user_can_create_draft( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Whether user can create a post. user_can_create_post":
"prefix":"user_can_create_post"
"body":"user_can_create_post( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Whether user can delete a post. user_can_delete_post":
"prefix":"user_can_delete_post"
"body":"user_can_delete_post( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_delete_post_comments":
"prefix":"user_can_delete_post_comments"
"body":"user_can_delete_post_comments( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can edit a post.":
"prefix":"user_can_edit_post"
"body":"user_can_edit_post( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_edit_post_comments":
"prefix":"user_can_edit_post_comments"
"body":"user_can_edit_post_comments( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Whether user can delete a post. user_can_edit_post_date":
"prefix":"user_can_edit_post_date"
"body":"user_can_edit_post_date( ${1:\\$user_id}${2:, \\$post_id}${3:, \\$blog_id = 1} )"
"Can user can edit other user.":
"prefix":"user_can_edit_user"
"body":"user_can_edit_user( ${1:\\$user_id}${2:, \\$other_user} )"
"Whether the user can access the visual editor.":
"prefix":"user_can_richedit"
"body":"user_can_richedit()"
"Whether user can set new posts' dates.":
"prefix":"user_can_set_post_date"
"body":"user_can_set_post_date( ${1:\\$user_id}${2:, \\$blog_id = 1}${3:, \\$category_id = 'None'} )"
"Check that the user login name and password is correct.":
"prefix":"user_pass_ok"
"body":"user_pass_ok( ${1:\\$user_login}${2:, \\$user_pass} )"
"Retrieves a trailing-slashed string if the site is set for adding trailing slashes.":
"prefix":"user_trailingslashit"
"body":"user_trailingslashit( ${1:\\$string}${2:, \\$type_of_url = ''} )"
"Checks whether the given username exists.":
"prefix":"username_exists"
"body":"username_exists( ${1:\\$username} )"
"Check whether users can self-register, based on Network settings.":
"prefix":"users_can_register_signup_filter"
"body":"users_can_register_signup_filter()"
"Encode the Unicode values to be used in the URI.":
"prefix":"utf8_uri_encode"
"body":"utf8_uri_encode( ${1:\\$utf8_string}${2:, \\$length} )"
"Helper function to determine if a Unicode value is valid.":
"prefix":"valid_unicode"
"body":"valid_unicode( ${1:\\$i} )"
"Validate active plugins":
"prefix":"validate_active_plugins"
"body":"validate_active_plugins()"
"Validate a new site signup.":
"prefix":"validate_another_blog_signup"
"body":"validate_another_blog_signup()"
"Validate the new site signup":
"prefix":"validate_blog_form"
"body":"validate_blog_form()"
"Validate new site signup":
"prefix":"validate_blog_signup"
"body":"validate_blog_signup()"
"Checks that current theme files 'index.php' and 'style.css' exists.":
"prefix":"validate_current_theme"
"body":"validate_current_theme()"
"Deprecated functionality to validate an email address.":
"prefix":"validate_email"
"body":"validate_email( ${1:\\$email}${2:, \\$check_domain = true} )"
"File validates against allowed set of defined rules.":
"prefix":"validate_file"
"body":"validate_file( ${1:\\$file}${2:, \\$allowed_files = ''} )"
"Make sure that the file that was requested to edit, is allowed to be edited":
"prefix":"validate_file_to_edit"
"body":"validate_file_to_edit( ${1:\\$file}${2:, \\$allowed_files = ''} )"
"Validate the plugin path.":
"prefix":"validate_plugin"
"body":"validate_plugin( ${1:\\$plugin} )"
"Validate user signup name and email":
"prefix":"validate_user_form"
"body":"validate_user_form()"
"Validate the new user signup":
"prefix":"validate_user_signup"
"body":"validate_user_signup()"
"Checks whether a username is valid.":
"prefix":"validate_username"
"body":"validate_username( ${1:\\$username} )"
"Calculates and compares the MD5 of a file to its expected value.":
"prefix":"verify_file_md5"
"body":"verify_file_md5( ${1:\\$filename}${2:, \\$expected_md5} )"
"Retrieve HTML dropdown (select) content for category list.":
"prefix":"walk_category_dropdown_tree"
"body":"walk_category_dropdown_tree()"
"Retrieve HTML list content for category list.":
"prefix":"walk_category_tree"
"body":"walk_category_tree()"
"Retrieve the HTML list content for nav menu items.":
"prefix":"walk_nav_menu_tree"
"body":"walk_nav_menu_tree( ${1:\\$items}${2:, \\$depth}${3:, \\$r} )"
"Retrieve HTML dropdown (select) content for page list.":
"prefix":"walk_page_dropdown_tree"
"body":"walk_page_dropdown_tree()"
"Retrieve HTML list content for page list.":
"prefix":"walk_page_tree"
"body":"walk_page_tree( ${1:\\$pages}${2:, \\$depth}${3:, \\$current_page}${4:, \\$r} )"
"Send a pingback.":
"prefix":"weblog_ping"
"body":"weblog_ping( ${1:\\$server = ''}${2:, \\$path = ''} )"
"Ensure that the welcome message is not empty. Currently unused.":
"prefix":"welcome_user_msg_filter"
"body":"welcome_user_msg_filter( ${1:\\$text} )"
"Workaround for Windows bug in is_writable() function":
"prefix":"win_is_writable"
"body":"win_is_writable( ${1:\\$path} )"
"Display the link to the Windows Live Writer manifest file.":
"prefix":"wlwmanifest_link"
"body":"wlwmanifest_link()"
"Set up the WordPress query.":
"prefix":"wp"
"body":"wp( ${1:\\$query_vars = ''} )"
"Adds a new dashboard widget.":
"prefix":"wp_add_dashboard_widget"
"body":"wp_add_dashboard_widget( ${1:\\$widget_id}${2:, \\$widget_name}${3:, \\$callback}${4:, \\$control_callback = null}${5:, \\$callback_args = null} )"
"Parse ID3v2, ID3v1, and getID3 comments to extract usable data":
"prefix":"wp_add_id3_tag_data"
"body":"wp_add_id3_tag_data( ${1:\\$metadata}${2:, \\$data} )"
"Adds extra code to a registered script.":
"prefix":"wp_add_inline_script"
"body":"wp_add_inline_script( ${1:\\$handle}${2:, \\$data}${3:, \\$position = 'after'} )"
"Add extra CSS styles to a registered stylesheet.":
"prefix":"wp_add_inline_style"
"body":"wp_add_inline_style( ${1:\\$handle}${2:, \\$data} )"
"Add term(s) associated with a given object.":
"prefix":"wp_add_object_terms"
"body":"wp_add_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy} )"
"Add tags to a post.":
"prefix":"wp_add_post_tags"
"body":"wp_add_post_tags( ${1:\\$post_id}${2:, \\$tags = ''} )"
"Adds a trashed suffix for a given post.":
"prefix":"wp_add_trashed_suffix_to_post_name_for_post"
"body":"wp_add_trashed_suffix_to_post_name_for_post( ${1:\\$post} )"
"Adds a suffix if any trashed posts have a given slug.":
"prefix":"wp_add_trashed_suffix_to_post_name_for_trashed_posts"
"body":"wp_add_trashed_suffix_to_post_name_for_trashed_posts( ${1:\\$post_name}${2:, \\$post_ID} )"
"Add secondary menus.":
"prefix":"wp_admin_bar_add_secondary_groups"
"body":"wp_admin_bar_add_secondary_groups( ${1:\\$wp_admin_bar} )"
"Add appearance submenu items to the "Site Name" menu.":
"prefix":"wp_admin_bar_appearance_menu"
"body":"wp_admin_bar_appearance_menu( ${1:\\$wp_admin_bar} )"
"Add edit comments link with awaiting moderation count bubble.":
"prefix":"wp_admin_bar_comments_menu"
"body":"wp_admin_bar_comments_menu( ${1:\\$wp_admin_bar} )"
"Adds the "Customize" link to the Toolbar.":
"prefix":"wp_admin_bar_customize_menu"
"body":"wp_admin_bar_customize_menu( ${1:\\$wp_admin_bar} )"
"Add the "Dashboard"/"Visit Site" menu.":
"prefix":"wp_admin_bar_dashboard_view_site_menu"
"body":"wp_admin_bar_dashboard_view_site_menu( ${1:\\$wp_admin_bar} )"
"Provide an edit link for posts and terms.":
"prefix":"wp_admin_bar_edit_menu"
"body":"wp_admin_bar_edit_menu( ${1:\\$wp_admin_bar} )"
"Style and scripts for the admin bar.":
"prefix":"wp_admin_bar_header"
"body":"wp_admin_bar_header()"
"Add the "My Account" item.":
"prefix":"wp_admin_bar_my_account_item"
"body":"wp_admin_bar_my_account_item( ${1:\\$wp_admin_bar} )"
"Add the "My Account" submenu items.":
"prefix":"wp_admin_bar_my_account_menu"
"body":"wp_admin_bar_my_account_menu( ${1:\\$wp_admin_bar} )"
"Add the "My Sites/[Site Name]" menu and all submenus.":
"prefix":"wp_admin_bar_my_sites_menu"
"body":"wp_admin_bar_my_sites_menu( ${1:\\$wp_admin_bar} )"
"Add "Add New" menu.":
"prefix":"wp_admin_bar_new_content_menu"
"body":"wp_admin_bar_new_content_menu( ${1:\\$wp_admin_bar} )"
"Renders the admin bar to the page based on the $wp_admin_bar->menu member var.":
"prefix":"wp_admin_bar_render"
"body":"wp_admin_bar_render()"
"Add search form.":
"prefix":"wp_admin_bar_search_menu"
"body":"wp_admin_bar_search_menu( ${1:\\$wp_admin_bar} )"
"Provide a shortlink.":
"prefix":"wp_admin_bar_shortlink_menu"
"body":"wp_admin_bar_shortlink_menu( ${1:\\$wp_admin_bar} )"
"Add the sidebar toggle button.":
"prefix":"wp_admin_bar_sidebar_toggle"
"body":"wp_admin_bar_sidebar_toggle( ${1:\\$wp_admin_bar} )"
"Add the "Site Name" menu.":
"prefix":"wp_admin_bar_site_menu"
"body":"wp_admin_bar_site_menu( ${1:\\$wp_admin_bar} )"
"Provide an update link if theme/plugin/core updates are available.":
"prefix":"wp_admin_bar_updates_menu"
"body":"wp_admin_bar_updates_menu( ${1:\\$wp_admin_bar} )"
"Add the WordPress logo menu.":
"prefix":"wp_admin_bar_wp_menu"
"body":"wp_admin_bar_wp_menu( ${1:\\$wp_admin_bar} )"
"Remove single-use URL parameters and create canonical link based on new URL.":
"prefix":"wp_admin_canonical_url"
"body":"wp_admin_canonical_url()"
"Enqueues or directly prints a stylesheet link to the specified CSS file.":
"prefix":"wp_admin_css"
"body":"wp_admin_css( ${1:\\$file = 'wp-admin'}${2:, \\$force_echo = false} )"
"Registers an admin colour scheme css file.":
"prefix":"wp_admin_css_color"
"body":"wp_admin_css_color( ${1:\\$key}${2:, \\$name}${3:, \\$url}${4:, \\$colors = array()}${5:, \\$icons = array()} )"
"Displays the URL of a WordPress admin CSS file.":
"prefix":"wp_admin_css_uri"
"body":"wp_admin_css_uri( ${1:\\$file = 'wp-admin'} )"
"Ajax handler for adding a link category.":
"prefix":"wp_ajax_add_link_category"
"body":"wp_ajax_add_link_category( ${1:\\$action} )"
"Ajax handler for adding a menu item.":
"prefix":"wp_ajax_add_menu_item"
"body":"wp_ajax_add_menu_item()"
"Ajax handler for adding meta.":
"prefix":"wp_ajax_add_meta"
"body":"wp_ajax_add_meta()"
"Ajax handler to add a tag.":
"prefix":"wp_ajax_add_tag"
"body":"wp_ajax_add_tag()"
"Ajax handler for adding a user.":
"prefix":"wp_ajax_add_user"
"body":"wp_ajax_add_user( ${1:\\$action} )"
"Ajax handler for tag search.":
"prefix":"wp_ajax_ajax_tag_search"
"body":"wp_ajax_ajax_tag_search()"
"Ajax handler for user autocomplete.":
"prefix":"wp_ajax_autocomplete_user"
"body":"wp_ajax_autocomplete_user()"
"Ajax handler for closed post boxes.":
"prefix":"wp_ajax_closed_postboxes"
"body":"wp_ajax_closed_postboxes()"
"Ajax handler for cropping an image.":
"prefix":"wp_ajax_crop_image"
"body":"wp_ajax_crop_image()"
"Ajax handler for dashboard widgets.":
"prefix":"wp_ajax_dashboard_widgets"
"body":"wp_ajax_dashboard_widgets()"
"Ajax handler for date formatting.":
"prefix":"wp_ajax_date_format"
"body":"wp_ajax_date_format()"
"Ajax handler for deleting a comment.":
"prefix":"wp_ajax_delete_comment"
"body":"wp_ajax_delete_comment()"
"Ajax handler for removing inactive widgets.":
"prefix":"wp_ajax_delete_inactive_widgets"
"body":"wp_ajax_delete_inactive_widgets()"
"Ajax handler for deleting a link.":
"prefix":"wp_ajax_delete_link"
"body":"wp_ajax_delete_link()"
"Ajax handler for deleting meta.":
"prefix":"wp_ajax_delete_meta"
"body":"wp_ajax_delete_meta()"
"wp_ajax_delete_page":
"prefix":"wp_ajax_delete_page"
"body":"wp_ajax_delete_page( ${1:\\$action} )"
"Ajax handler for deleting a plugin.":
"prefix":"wp_ajax_delete_plugin"
"body":"wp_ajax_delete_plugin()"
"Ajax handler for deleting a post.":
"prefix":"wp_ajax_delete_post"
"body":"wp_ajax_delete_post( ${1:\\$action} )"
"Ajax handler for deleting a tag.":
"prefix":"wp_ajax_delete_tag"
"body":"wp_ajax_delete_tag()"
"Ajax handler for deleting a theme.":
"prefix":"wp_ajax_delete_theme"
"body":"wp_ajax_delete_theme()"
"Ajax handler for destroying multiple open sessions for a user.":
"prefix":"wp_ajax_destroy_sessions"
"body":"wp_ajax_destroy_sessions()"
"Ajax handler to dim a comment.":
"prefix":"wp_ajax_dim_comment"
"body":"wp_ajax_dim_comment()"
"Ajax handler for dismissing a WordPress pointer.":
"prefix":"wp_ajax_dismiss_wp_pointer"
"body":"wp_ajax_dismiss_wp_pointer()"
"Ajax handler for editing a comment.":
"prefix":"wp_ajax_edit_comment"
"body":"wp_ajax_edit_comment()"
"Ajax handler for fetching a list table.":
"prefix":"wp_ajax_fetch_list"
"body":"wp_ajax_fetch_list()"
"Ajax handler for querying posts for the Find Posts modal.":
"prefix":"wp_ajax_find_posts"
"body":"wp_ajax_find_posts()"
"Ajax handler for generating a password.":
"prefix":"wp_ajax_generate_password"
"body":"wp_ajax_generate_password()"
"Ajax handler for getting an attachment.":
"prefix":"wp_ajax_get_attachment"
"body":"wp_ajax_get_attachment()"
"Ajax handler for getting comments.":
"prefix":"wp_ajax_get_comments"
"body":"wp_ajax_get_comments( ${1:\\$action} )"
"Handles AJAX requests for community events":
"prefix":"wp_ajax_get_community_events"
"body":"wp_ajax_get_community_events()"
"Ajax handler to retrieve a permalink.":
"prefix":"wp_ajax_get_permalink"
"body":"wp_ajax_get_permalink()"
"Ajax handler for retrieving HTML for the featured image.":
"prefix":"wp_ajax_get_post_thumbnail_html"
"body":"wp_ajax_get_post_thumbnail_html()"
"Ajax handler for getting revision diffs.":
"prefix":"wp_ajax_get_revision_diffs"
"body":"wp_ajax_get_revision_diffs()"
"Ajax handler for getting a tagcloud.":
"prefix":"wp_ajax_get_tagcloud"
"body":"wp_ajax_get_tagcloud()"
"Ajax handler for the Heartbeat API.":
"prefix":"wp_ajax_heartbeat"
"body":"wp_ajax_heartbeat()"
"Ajax handler for hidden columns.":
"prefix":"wp_ajax_hidden_columns"
"body":"wp_ajax_hidden_columns()"
"Ajax handler for image editing.":
"prefix":"wp_ajax_image_editor"
"body":"wp_ajax_image_editor()"
"Ajax handler for image editor previews.":
"prefix":"wp_ajax_imgedit_preview"
"body":"wp_ajax_imgedit_preview()"
"Ajax handler for Quick Edit saving a post from a list table.":
"prefix":"wp_ajax_inline_save"
"body":"wp_ajax_inline_save()"
"Ajax handler for quick edit saving for a term.":
"prefix":"wp_ajax_inline_save_tax"
"body":"wp_ajax_inline_save_tax()"
"Ajax handler for installing a plugin.":
"prefix":"wp_ajax_install_plugin"
"body":"wp_ajax_install_plugin()"
"Ajax handler for installing a theme.":
"prefix":"wp_ajax_install_theme"
"body":"wp_ajax_install_theme()"
"Ajax handler for Customizer preview logged-in status.":
"prefix":"wp_ajax_logged_in"
"body":"wp_ajax_logged_in()"
"Ajax handler for retrieving menu meta boxes.":
"prefix":"wp_ajax_menu_get_metabox"
"body":"wp_ajax_menu_get_metabox()"
"Ajax handler for menu locations save.":
"prefix":"wp_ajax_menu_locations_save"
"body":"wp_ajax_menu_locations_save()"
"Ajax handler for menu quick searching.":
"prefix":"wp_ajax_menu_quick_search"
"body":"wp_ajax_menu_quick_search()"
"Ajax handler for saving the meta box order.":
"prefix":"wp_ajax_meta_box_order"
"body":"wp_ajax_meta_box_order()"
"Ajax handler for the Heartbeat API in
the no-privilege context.":
"prefix":"wp_ajax_nopriv_heartbeat"
"body":"wp_ajax_nopriv_heartbeat()"
"Ajax handler for oEmbed caching.":
"prefix":"wp_ajax_oembed_cache"
"body":"wp_ajax_oembed_cache()"
"Apply [embed] Ajax handlers to a string.":
"prefix":"wp_ajax_parse_embed"
"body":"wp_ajax_parse_embed()"
"wp_ajax_parse_media_shortcode":
"prefix":"wp_ajax_parse_media_shortcode"
"body":"wp_ajax_parse_media_shortcode()"
"Ajax handler for creating new category from Press This.":
"prefix":"wp_ajax_press_this_add_category"
"body":"wp_ajax_press_this_add_category()"
"Ajax handler for saving a post from Press This.":
"prefix":"wp_ajax_press_this_save_post"
"body":"wp_ajax_press_this_save_post()"
"Ajax handler for querying attachments.":
"prefix":"wp_ajax_query_attachments"
"body":"wp_ajax_query_attachments()"
"Ajax handler for getting themes from themes_api().":
"prefix":"wp_ajax_query_themes"
"body":"wp_ajax_query_themes()"
"Ajax handler for replying to a comment.":
"prefix":"wp_ajax_replyto_comment"
"body":"wp_ajax_replyto_comment( ${1:\\$action} )"
"Ajax handler to retrieve a sample permalink.":
"prefix":"wp_ajax_sample_permalink"
"body":"wp_ajax_sample_permalink()"
"Ajax handler for updating attachment attributes.":
"prefix":"wp_ajax_save_attachment"
"body":"wp_ajax_save_attachment()"
"Ajax handler for saving backward compatible attachment attributes.":
"prefix":"wp_ajax_save_attachment_compat"
"body":"wp_ajax_save_attachment_compat()"
"Ajax handler for saving the attachment order.":
"prefix":"wp_ajax_save_attachment_order"
"body":"wp_ajax_save_attachment_order()"
"Ajax handler for auto-saving the selected color scheme for
a user's own profile.":
"prefix":"wp_ajax_save_user_color_scheme"
"body":"wp_ajax_save_user_color_scheme()"
"Ajax handler for saving a widget.":
"prefix":"wp_ajax_save_widget"
"body":"wp_ajax_save_widget()"
"Ajax handler for saving the user's WordPress.org username.":
"prefix":"wp_ajax_save_wporg_username"
"body":"wp_ajax_save_wporg_username()"
"Ajax handler for searching plugins to install.":
"prefix":"wp_ajax_search_install_plugins"
"body":"wp_ajax_search_install_plugins()"
"Ajax handler for searching plugins.":
"prefix":"wp_ajax_search_plugins"
"body":"wp_ajax_search_plugins()"
"Ajax handler for sending an attachment to the editor.":
"prefix":"wp_ajax_send_attachment_to_editor"
"body":"wp_ajax_send_attachment_to_editor()"
"Ajax handler for sending a link to the editor.":
"prefix":"wp_ajax_send_link_to_editor"
"body":"wp_ajax_send_link_to_editor()"
"Ajax handler for setting the featured image for an attachment.":
"prefix":"wp_ajax_set_attachment_thumbnail"
"body":"wp_ajax_set_attachment_thumbnail()"
"Ajax handler for setting the featured image.":
"prefix":"wp_ajax_set_post_thumbnail"
"body":"wp_ajax_set_post_thumbnail()"
"Ajax handler for time formatting.":
"prefix":"wp_ajax_time_format"
"body":"wp_ajax_time_format()"
"Ajax handler for sending a post to the trash.":
"prefix":"wp_ajax_trash_post"
"body":"wp_ajax_trash_post( ${1:\\$action} )"
"Ajax handler to restore a post from the trash.":
"prefix":"wp_ajax_untrash_post"
"body":"wp_ajax_untrash_post( ${1:\\$action} )"
"Ajax handler for updating a plugin.":
"prefix":"wp_ajax_update_plugin"
"body":"wp_ajax_update_plugin()"
"Ajax handler for updating a theme.":
"prefix":"wp_ajax_update_theme"
"body":"wp_ajax_update_theme()"
"Ajax handler for updating whether to display the welcome panel.":
"prefix":"wp_ajax_update_welcome_panel"
"body":"wp_ajax_update_welcome_panel()"
"Ajax handler for updating a widget.":
"prefix":"wp_ajax_update_widget"
"body":"wp_ajax_update_widget()"
"Ajax handler for uploading attachments":
"prefix":"wp_ajax_upload_attachment"
"body":"wp_ajax_upload_attachment()"
"Ajax handler for saving the widgets order.":
"prefix":"wp_ajax_widgets_order"
"body":"wp_ajax_widgets_order()"
"Ajax handler for compression testing.":
"prefix":"wp_ajax_wp_compression_test"
"body":"wp_ajax_wp_compression_test()"
"Ajax handler for saving posts from the fullscreen editor.":
"prefix":"wp_ajax_wp_fullscreen_save_post"
"body":"wp_ajax_wp_fullscreen_save_post()"
"Ajax handler for internal linking.":
"prefix":"wp_ajax_wp_link_ajax"
"body":"wp_ajax_wp_link_ajax()"
"Ajax handler for removing a post lock.":
"prefix":"wp_ajax_wp_remove_post_lock"
"body":"wp_ajax_wp_remove_post_lock()"
"Validates whether this comment is allowed to be made.":
"prefix":"wp_allow_comment"
"body":"wp_allow_comment( ${1:\\$commentdata}${2:, \\$avoid_die = false} )"
"Retrieve a list of protocols to allow in HTML attributes.":
"prefix":"wp_allowed_protocols"
"body":"wp_allowed_protocols()"
"Extract a slice of an array, given a list of keys.":
"prefix":"wp_array_slice_assoc"
"body":"wp_array_slice_assoc( ${1:\\$array}${2:, \\$keys} )"
"Verifies an attachment is of a given type.":
"prefix":"wp_attachment_is"
"body":"wp_attachment_is( ${1:\\$type}${2:, \\$post = null} )"
"Checks if the attachment is an image.":
"prefix":"wp_attachment_is_image"
"body":"wp_attachment_is_image( ${1:\\$post = null} )"
"Builds the Audio shortcode output.":
"prefix":"wp_audio_shortcode"
"body":"wp_audio_shortcode( ${1:\\$attr}${2:, \\$content = ''} )"
"Check whether a user is still logged in, for the heartbeat.":
"prefix":"wp_auth_check"
"body":"wp_auth_check( ${1:\\$response} )"
"Output the HTML that shows the wp-login dialog when the user is no longer logged in.":
"prefix":"wp_auth_check_html"
"body":"wp_auth_check_html()"
"Load the auth check for monitoring whether the user is still logged in.":
"prefix":"wp_auth_check_load"
"body":"wp_auth_check_load()"
"Authenticate a user, confirming the login credentials are valid.":
"prefix":"wp_authenticate"
"body":"wp_authenticate( ${1:\\$username}${2:, \\$password} )"
"Authenticate the user using the WordPress auth cookie.":
"prefix":"wp_authenticate_cookie"
"body":"wp_authenticate_cookie( ${1:\\$user}${2:, \\$username}${3:, \\$password} )"
"Authenticates a user using the email and password.":
"prefix":"wp_authenticate_email_password"
"body":"wp_authenticate_email_password( ${1:\\$user}${2:, \\$email}${3:, \\$password} )"
"For Multisite blogs, check if the authenticated user has been marked as a
spammer, or if the user's primary blog has been marked as spam.":
"prefix":"wp_authenticate_spam_check"
"body":"wp_authenticate_spam_check( ${1:\\$user} )"
"Authenticate a user, confirming the username and password are valid.":
"prefix":"wp_authenticate_username_password"
"body":"wp_authenticate_username_password( ${1:\\$user}${2:, \\$username}${3:, \\$password} )"
"Save a post submitted with XHR":
"prefix":"wp_autosave"
"body":"wp_autosave( ${1:\\$post_data} )"
"i18n friendly version of basename()":
"prefix":"wp_basename"
"body":"wp_basename( ${1:\\$path}${2:, \\$suffix = ''} )"
"Does comment contain blacklisted characters or words.":
"prefix":"wp_blacklist_check"
"body":"wp_blacklist_check( ${1:\\$author}${2:, \\$email}${3:, \\$url}${4:, \\$comment}${5:, \\$user_ip}${6:, \\$user_agent} )"
"Adds data to the cache, if the cache key doesn't already exist.":
"prefix":"wp_cache_add"
"body":"wp_cache_add( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Adds a group or set of groups to the list of global groups.":
"prefix":"wp_cache_add_global_groups"
"body":"wp_cache_add_global_groups( ${1:\\$groups} )"
"Adds a group or set of groups to the list of non-persistent groups.":
"prefix":"wp_cache_add_non_persistent_groups"
"body":"wp_cache_add_non_persistent_groups( ${1:\\$groups} )"
"Closes the cache.":
"prefix":"wp_cache_close"
"body":"wp_cache_close()"
"Decrements numeric cache item's value.":
"prefix":"wp_cache_decr"
"body":"wp_cache_decr( ${1:\\$key}${2:, \\$offset = 1}${3:, \\$group = ''} )"
"Removes the cache contents matching key and group.":
"prefix":"wp_cache_delete"
"body":"wp_cache_delete( ${1:\\$key}${2:, \\$group = ''} )"
"Removes all cache items.":
"prefix":"wp_cache_flush"
"body":"wp_cache_flush()"
"Retrieves the cache contents from the cache by key and group.":
"prefix":"wp_cache_get"
"body":"wp_cache_get( ${1:\\$key}${2:, \\$group = ''}${3:, \\$force = false}${4:, \\$found = null} )"
"Get last changed date for the specified cache group.":
"prefix":"wp_cache_get_last_changed"
"body":"wp_cache_get_last_changed( ${1:\\$group} )"
"Increment numeric cache item's value":
"prefix":"wp_cache_incr"
"body":"wp_cache_incr( ${1:\\$key}${2:, \\$offset = 1}${3:, \\$group = ''} )"
"Sets up Object Cache Global and assigns it.":
"prefix":"wp_cache_init"
"body":"wp_cache_init()"
"Replaces the contents of the cache with new data.":
"prefix":"wp_cache_replace"
"body":"wp_cache_replace( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Reset internal cache keys and structures.":
"prefix":"wp_cache_reset"
"body":"wp_cache_reset()"
"Saves the data to the cache.":
"prefix":"wp_cache_set"
"body":"wp_cache_set( ${1:\\$key}${2:, \\$data}${3:, \\$group = ''}${4:, \\$expire} )"
"Switches the internal blog ID.":
"prefix":"wp_cache_switch_to_blog"
"body":"wp_cache_switch_to_blog( ${1:\\$blog_id} )"
"Creates a 'sizes' attribute value for an image.":
"prefix":"wp_calculate_image_sizes"
"body":"wp_calculate_image_sizes( ${1:\\$size}${2:, \\$image_src = null}${3:, \\$image_meta = null}${4:, \\$attachment_id} )"
"A helper function to calculate the image sources to include in a 'srcset' attribute.":
"prefix":"wp_calculate_image_srcset"
"body":"wp_calculate_image_srcset( ${1:\\$size_array}${2:, \\$image_src}${3:, \\$image_meta}${4:, \\$attachment_id} )"
"Check if WordPress has access to the filesystem without asking for
credentials.":
"prefix":"wp_can_install_language_pack"
"body":"wp_can_install_language_pack()"
"Output a textarea element for inputting an attachment caption.":
"prefix":"wp_caption_input_textarea"
"body":"wp_caption_input_textarea( ${1:\\$edit_post} )"
"Output an unordered list of checkbox input elements labeled with category names.":
"prefix":"wp_category_checklist"
"body":"wp_category_checklist( ${1:\\$post_id}${2:, \\$descendants_and_self}${3:, \\$selected_cats = false}${4:, \\$popular_cats = false}${5:, \\$walker = null}${6:, \\$checked_ontop = true} )"
"Check if the user needs a browser update":
"prefix":"wp_check_browser_version"
"body":"wp_check_browser_version()"
"Compares the lengths of comment data against the maximum character limits.":
"prefix":"wp_check_comment_data_max_lengths"
"body":"wp_check_comment_data_max_lengths( ${1:\\$comment_data} )"
"Checks whether comment flooding is occurring.":
"prefix":"wp_check_comment_flood"
"body":"wp_check_comment_flood( ${1:\\$is_flood}${2:, \\$ip}${3:, \\$email}${4:, \\$date}${5:, \\$avoid_die = false} )"
"Retrieve the file type from the file name.":
"prefix":"wp_check_filetype"
"body":"wp_check_filetype( ${1:\\$filename}${2:, \\$mimes = null} )"
"Attempt to determine the real file type of a file.":
"prefix":"wp_check_filetype_and_ext"
"body":"wp_check_filetype_and_ext( ${1:\\$file}${2:, \\$filename}${3:, \\$mimes = null} )"
"Check for changed slugs for published post objects and save the old slug.":
"prefix":"wp_check_for_changed_slugs"
"body":"wp_check_for_changed_slugs( ${1:\\$post_id}${2:, \\$post}${3:, \\$post_before} )"
"Checks for invalid UTF8 in a string.":
"prefix":"wp_check_invalid_utf8"
"body":"wp_check_invalid_utf8( ${1:\\$string}${2:, \\$strip = false} )"
"Checks that a JSONP callback is a valid JavaScript callback.":
"prefix":"wp_check_jsonp_callback"
"body":"wp_check_jsonp_callback( ${1:\\$callback} )"
"Check lock status for posts displayed on the Posts screen":
"prefix":"wp_check_locked_posts"
"body":"wp_check_locked_posts( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Checks the version of the installed MySQL binary.":
"prefix":"wp_check_mysql_version"
"body":"wp_check_mysql_version()"
"Checks the plaintext password against the encrypted Password.":
"prefix":"wp_check_password"
"body":"wp_check_password( ${1:\\$password}${2:, \\$hash}${3:, \\$user_id = ''} )"
"Check for the required PHP version, and the MySQL extension or
a database drop-in.":
"prefix":"wp_check_php_mysql_versions"
"body":"wp_check_php_mysql_versions()"
"Check the given subset of the post hierarchy for hierarchy loops.":
"prefix":"wp_check_post_hierarchy_for_loops"
"body":"wp_check_post_hierarchy_for_loops( ${1:\\$post_parent}${2:, \\$post_ID} )"
"Check to see if the post is currently being edited by another user.":
"prefix":"wp_check_post_lock"
"body":"wp_check_post_lock( ${1:\\$post_id} )"
"Checks the given subset of the term hierarchy for hierarchy loops.":
"prefix":"wp_check_term_hierarchy_for_loops"
"body":"wp_check_term_hierarchy_for_loops( ${1:\\$parent}${2:, \\$term_id}${3:, \\$taxonomy} )"
"Test if the supplied date is valid for the Gregorian calendar.":
"prefix":"wp_checkdate"
"body":"wp_checkdate( ${1:\\$month}${2:, \\$day}${3:, \\$year}${4:, \\$source_date} )"
"Clears the Plugins cache used by get_plugins() and by default, the Plugin Update cache.":
"prefix":"wp_clean_plugins_cache"
"body":"wp_clean_plugins_cache( ${1:\\$clear_update_cache = true} )"
"Clears the cache held by get_theme_roots() and WP_Theme.":
"prefix":"wp_clean_themes_cache"
"body":"wp_clean_themes_cache( ${1:\\$clear_update_cache = true} )"
"Clear existing update caches for plugins, themes, and core.":
"prefix":"wp_clean_update_cache"
"body":"wp_clean_update_cache()"
"Removes all of the cookies associated with authentication.":
"prefix":"wp_clear_auth_cookie"
"body":"wp_clear_auth_cookie()"
"Unschedules all events attached to the hook with the specified arguments.":
"prefix":"wp_clear_scheduled_hook"
"body":"wp_clear_scheduled_hook( ${1:\\$hook}${2:, \\$args = array()} )"
"Clears the authentication cookie, logging the user out. This function is deprecated.":
"prefix":"wp_clearcookie"
"body":"wp_clearcookie()"
"Copy an object.":
"prefix":"wp_clone"
"body":"wp_clone( ${1:\\$object} )"
"wp_color_scheme_settings":
"prefix":"wp_color_scheme_settings"
"body":"wp_color_scheme_settings()"
"Display form token for unfiltered comments.":
"prefix":"wp_comment_form_unfiltered_html_nonce"
"body":"wp_comment_form_unfiltered_html_nonce()"
"Outputs the in-line comment reply-to form in the Comments list table.":
"prefix":"wp_comment_reply"
"body":"wp_comment_reply( ${1:\\$position = 1}${2:, \\$checkbox = false}${3:, \\$mode = 'single'}${4:, \\$table_row = true} )"
"Output 'undo move to trash' text for comments":
"prefix":"wp_comment_trashnotice"
"body":"wp_comment_trashnotice()"
"Calculates the new dimensions for a down-sampled image.":
"prefix":"wp_constrain_dimensions"
"body":"wp_constrain_dimensions( ${1:\\$current_width}${2:, \\$current_height}${3:, \\$max_width}${4:, \\$max_height} )"
"Converts an integer byte value to a shorthand byte value.":
"prefix":"wp_convert_bytes_to_hr"
"body":"wp_convert_bytes_to_hr( ${1:\\$bytes} )"
"Converts a shorthand byte value to an integer byte value.":
"prefix":"wp_convert_hr_to_bytes"
"body":"wp_convert_hr_to_bytes( ${1:\\$value} )"
"Convert the widget settings from single to multi-widget format.":
"prefix":"wp_convert_widget_settings"
"body":"wp_convert_widget_settings( ${1:\\$base_name}${2:, \\$option_name}${3:, \\$settings} )"
"Defines cookie related WordPress constants wp_cookie_constants":
"prefix":"wp_cookie_constants"
"body":"wp_cookie_constants()"
"Count number of attachments for the mime type(s).":
"prefix":"wp_count_attachments"
"body":"wp_count_attachments( ${1:\\$mime_type = ''} )"
"Retrieve total comments for blog or single post.":
"prefix":"wp_count_comments"
"body":"wp_count_comments( ${1:\\$post_id} )"
"Count number of posts of a post type and if user has permissions to view.":
"prefix":"wp_count_posts"
"body":"wp_count_posts( ${1:\\$type = 'post'}${2:, \\$perm = ''} )"
"Count how many terms are in Taxonomy.":
"prefix":"wp_count_terms"
"body":"wp_count_terms( ${1:\\$taxonomy}${2:, \\$args = array()} )"
"Create categories for the given post.":
"prefix":"wp_create_categories"
"body":"wp_create_categories( ${1:\\$categories}${2:, \\$post_id = ''} )"
"Add a new category to the database if it does not already exist.":
"prefix":"wp_create_category"
"body":"wp_create_category( ${1:\\$cat_name}${2:, \\$parent} )"
"Creates a navigation menu.":
"prefix":"wp_create_nav_menu"
"body":"wp_create_nav_menu( ${1:\\$menu_name} )"
"Creates a cryptographic token tied to a specific action, user, user session,
and window of time.":
"prefix":"wp_create_nonce"
"body":"wp_create_nonce( ${1:\\$action = -1} )"
"Creates autosave data for the specified post from $_POST data.":
"prefix":"wp_create_post_autosave"
"body":"wp_create_post_autosave( ${1:\\$post_data} )"
"Add a new tag to the database if it does not already exist.":
"prefix":"wp_create_tag"
"body":"wp_create_tag( ${1:\\$tag_name} )"
"Add a new term to the database if it does not already exist.":
"prefix":"wp_create_term"
"body":"wp_create_term( ${1:\\$tag_name}${2:, \\$taxonomy = 'post_tag'} )"
"This was once used to create a thumbnail from an Image given a maximum side size.":
"prefix":"wp_create_thumbnail"
"body":"wp_create_thumbnail( ${1:\\$file}${2:, \\$max_side}${3:, \\$deprecated = ''} )"
"A simpler way of inserting a user into the database.":
"prefix":"wp_create_user"
"body":"wp_create_user( ${1:\\$username}${2:, \\$password}${3:, \\$email = ''} )"
"Retrieve the contributor credits.":
"prefix":"wp_credits"
"body":"wp_credits()"
"Run scheduled callbacks or spawn cron for all scheduled events.":
"prefix":"wp_cron"
"body":"wp_cron()"
"Crop an Image to a given size.":
"prefix":"wp_crop_image"
"body":"wp_crop_image( ${1:\\$src}${2:, \\$src_x}${3:, \\$src_y}${4:, \\$src_w}${5:, \\$src_h}${6:, \\$dst_w}${7:, \\$dst_h}${8:, \\$src_abs = false}${9:, \\$dst_file = false} )"
"Render the Custom CSS style element.":
"prefix":"wp_custom_css_cb"
"body":"wp_custom_css_cb()"
"Prints a script to check whether or not the Customizer is supported,
and apply either the no-customize-support or customize-support class
to the body.":
"prefix":"wp_customize_support_script"
"body":"wp_customize_support_script()"
"Returns a URL to load the Customizer.":
"prefix":"wp_customize_url"
"body":"wp_customize_url( ${1:\\$stylesheet = null} )"
"Displays the dashboard.":
"prefix":"wp_dashboard"
"body":"wp_dashboard()"
"wp_dashboard_browser_nag":
"prefix":"wp_dashboard_browser_nag"
"body":"wp_dashboard_browser_nag()"
"Checks to see if all of the feed url in $check_urls are cached.":
"prefix":"wp_dashboard_cached_rss_widget"
"body":"wp_dashboard_cached_rss_widget( ${1:\\$widget_id}${2:, \\$callback}${3:, \\$check_urls = array()} )"
"Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).":
"prefix":"wp_dashboard_empty"
"body":"wp_dashboard_empty()"
"Renders the Events and News dashboard widget.":
"prefix":"wp_dashboard_events_news"
"body":"wp_dashboard_events_news()"
"Deprecated dashboard widget controls. wp_dashboard_incoming_links":
"prefix":"wp_dashboard_incoming_links"
"body":"wp_dashboard_incoming_links()"
"Deprecated dashboard incoming links control.":
"prefix":"wp_dashboard_incoming_links_control"
"body":"wp_dashboard_incoming_links_control()"
"Deprecated dashboard widget controls. wp_dashboard_incoming_links_output":
"prefix":"wp_dashboard_incoming_links_output"
"body":"wp_dashboard_incoming_links_output()"
"Deprecated dashboard plugins control.":
"prefix":"wp_dashboard_plugins"
"body":"wp_dashboard_plugins()"
"Display plugins text for the WordPress news widget.":
"prefix":"wp_dashboard_plugins_output"
"body":"wp_dashboard_plugins_output( ${1:\\$rss}${2:, \\$args = array()} )"
"WordPress News dashboard widget.":
"prefix":"wp_dashboard_primary"
"body":"wp_dashboard_primary()"
"Deprecated dashboard primary control.":
"prefix":"wp_dashboard_primary_control"
"body":"wp_dashboard_primary_control()"
"Display the WordPress news feeds.":
"prefix":"wp_dashboard_primary_output"
"body":"wp_dashboard_primary_output( ${1:\\$widget_id}${2:, \\$feeds} )"
"The Quick Draft widget display and creation of drafts.":
"prefix":"wp_dashboard_quick_press"
"body":"wp_dashboard_quick_press( ${1:\\$error_msg = false} )"
"Output the QuickPress dashboard widget.":
"prefix":"wp_dashboard_quick_press_output"
"body":"wp_dashboard_quick_press_output()"
"Display file upload quota on dashboard.":
"prefix":"wp_dashboard_quota"
"body":"wp_dashboard_quota()"
"Show Comments section.":
"prefix":"wp_dashboard_recent_comments"
"body":"wp_dashboard_recent_comments( ${1:\\$total_items = 5} )"
"Deprecated dashboard recent comments control.":
"prefix":"wp_dashboard_recent_comments_control"
"body":"wp_dashboard_recent_comments_control()"
"Show recent drafts of the user on the dashboard.":
"prefix":"wp_dashboard_recent_drafts"
"body":"wp_dashboard_recent_drafts( ${1:\\$drafts = false} )"
"Generates Publishing Soon and Recently Published sections.":
"prefix":"wp_dashboard_recent_posts"
"body":"wp_dashboard_recent_posts( ${1:\\$args} )"
"Dashboard widget that displays some basic stats about the site.":
"prefix":"wp_dashboard_right_now"
"body":"wp_dashboard_right_now()"
"The RSS dashboard widget control.":
"prefix":"wp_dashboard_rss_control"
"body":"wp_dashboard_rss_control( ${1:\\$widget_id}${2:, \\$form_inputs = array()} )"
"Display generic dashboard RSS widget feed.":
"prefix":"wp_dashboard_rss_output"
"body":"wp_dashboard_rss_output( ${1:\\$widget_id} )"
"Deprecated dashboard secondary section.":
"prefix":"wp_dashboard_secondary"
"body":"wp_dashboard_secondary()"
"Deprecated dashboard secondary control.":
"prefix":"wp_dashboard_secondary_control"
"body":"wp_dashboard_secondary_control()"
"Deprecated dashboard secondary output.":
"prefix":"wp_dashboard_secondary_output"
"body":"wp_dashboard_secondary_output()"
"Registers dashboard widgets.":
"prefix":"wp_dashboard_setup"
"body":"wp_dashboard_setup()"
"Callback function for Activity widget.":
"prefix":"wp_dashboard_site_activity"
"body":"wp_dashboard_site_activity()"
"Calls widget control callback.":
"prefix":"wp_dashboard_trigger_widget_control"
"body":"wp_dashboard_trigger_widget_control( ${1:\\$widget_control_id = false} )"
"Return a comma-separated string of functions that have been called to get
to the current point in code.":
"prefix":"wp_debug_backtrace_summary"
"body":"wp_debug_backtrace_summary( ${1:\\$ignore_class = null}${2:, \\$skip_frames}${3:, \\$pretty = true} )"
"Set PHP error reporting based on WordPress debug settings.":
"prefix":"wp_debug_mode"
"body":"wp_debug_mode()"
"Find out which editor should be displayed by default.":
"prefix":"wp_default_editor"
"body":"wp_default_editor()"
"Register all WordPress scripts.":
"prefix":"wp_default_scripts"
"body":"wp_default_scripts( ${1:\\$scripts} )"
"Assign default styles to $styles object.":
"prefix":"wp_default_styles"
"body":"wp_default_styles( ${1:\\$styles} )"
"Whether to defer comment counting.":
"prefix":"wp_defer_comment_counting"
"body":"wp_defer_comment_counting( ${1:\\$defer = null} )"
"Enable or disable term counting.":
"prefix":"wp_defer_term_counting"
"body":"wp_defer_term_counting( ${1:\\$defer = null} )"
"Trash or delete an attachment.":
"prefix":"wp_delete_attachment"
"body":"wp_delete_attachment( ${1:\\$post_id}${2:, \\$force_delete = false} )"
"Delete auto-drafts for new posts that are > 7 days old.":
"prefix":"wp_delete_auto_drafts"
"body":"wp_delete_auto_drafts()"
"Deletes one existing category.":
"prefix":"wp_delete_category"
"body":"wp_delete_category( ${1:\\$cat_ID} )"
"Trashes or deletes a comment.":
"prefix":"wp_delete_comment"
"body":"wp_delete_comment( ${1:\\$comment_id}${2:, \\$force_delete = false} )"
"Delete a file":
"prefix":"wp_delete_file"
"body":"wp_delete_file( ${1:\\$file} )"
"Deletes a specified link from the database.":
"prefix":"wp_delete_link"
"body":"wp_delete_link( ${1:\\$link_id} )"
"Delete a Navigation Menu.":
"prefix":"wp_delete_nav_menu"
"body":"wp_delete_nav_menu( ${1:\\$menu} )"
"Will unlink the object from the taxonomy or taxonomies.":
"prefix":"wp_delete_object_term_relationships"
"body":"wp_delete_object_term_relationships( ${1:\\$object_id}${2:, \\$taxonomies} )"
"Trash or delete a post or page.":
"prefix":"wp_delete_post"
"body":"wp_delete_post( ${1:\\$postid}${2:, \\$force_delete = false} )"
"Deletes a revision.":
"prefix":"wp_delete_post_revision"
"body":"wp_delete_post_revision( ${1:\\$revision_id} )"
"Removes a term from the database.":
"prefix":"wp_delete_term"
"body":"wp_delete_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Remove user and optionally reassign posts and links to another user.":
"prefix":"wp_delete_user"
"body":"wp_delete_user( ${1:\\$id}${2:, \\$reassign = null} )"
"Retrieves a list of unique hosts of all enqueued scripts and styles.":
"prefix":"wp_dependencies_unique_hosts"
"body":"wp_dependencies_unique_hosts()"
"Remove a previously enqueued script.":
"prefix":"wp_dequeue_script"
"body":"wp_dequeue_script( ${1:\\$handle} )"
"Remove a previously enqueued CSS stylesheet.":
"prefix":"wp_dequeue_style"
"body":"wp_dequeue_style( ${1:\\$handle} )"
"Remove a registered script.":
"prefix":"wp_deregister_script"
"body":"wp_deregister_script( ${1:\\$handle} )"
"Remove a registered stylesheet.":
"prefix":"wp_deregister_style"
"body":"wp_deregister_style( ${1:\\$handle} )"
"Remove all session tokens for the current user from the database.":
"prefix":"wp_destroy_all_sessions"
"body":"wp_destroy_all_sessions()"
"Remove the current session token from the database.":
"prefix":"wp_destroy_current_session"
"body":"wp_destroy_current_session()"
"Remove all but the current session token for the current user for the database.":
"prefix":"wp_destroy_other_sessions"
"body":"wp_destroy_other_sessions()"
"Kill WordPress execution and display HTML message with error message.":
"prefix":"wp_die"
"body":"wp_die( ${1:\\$message = ''}${2:, \\$title = ''}${3:, \\$args = array()} )"
"wp_doc_link_parse":
"prefix":"wp_doc_link_parse"
"body":"wp_doc_link_parse( ${1:\\$content} )"
"Determines whether the current request is a WordPress Ajax request.":
"prefix":"wp_doing_ajax"
"body":"wp_doing_ajax()"
"Determines whether the current request is a WordPress cron request.":
"prefix":"wp_doing_cron"
"body":"wp_doing_cron()"
"Download a language pack.":
"prefix":"wp_download_language_pack"
"body":"wp_download_language_pack( ${1:\\$download} )"
"Display or retrieve the HTML dropdown list of categories.":
"prefix":"wp_dropdown_categories"
"body":"wp_dropdown_categories( ${1:\\$args = ''} )"
"Legacy function used for generating a categories drop-down control.":
"prefix":"wp_dropdown_cats"
"body":"wp_dropdown_cats( ${1:\\$currentcat}${2:, \\$currentparent}${3:, \\$parent}${4:, \\$level}${5:, \\$categories} )"
"Language selector.":
"prefix":"wp_dropdown_languages"
"body":"wp_dropdown_languages( ${1:\\$args = array()} )"
"Retrieve or display list of pages as a dropdown (select list).":
"prefix":"wp_dropdown_pages"
"body":"wp_dropdown_pages( ${1:\\$args = ''} )"
"Print out option html elements for role selectors.":
"prefix":"wp_dropdown_roles"
"body":"wp_dropdown_roles( ${1:\\$selected = ''} )"
"Create dropdown HTML content of users.":
"prefix":"wp_dropdown_users"
"body":"wp_dropdown_users( ${1:\\$args = ''} )"
"Executes a query for attachments. An array of WP_Query arguments
can be passed in, which will override the arguments set by this function.":
"prefix":"wp_edit_attachments_query"
"body":"wp_edit_attachments_query( ${1:\\$q = false} )"
"Get the query variables for the current attachments request.":
"prefix":"wp_edit_attachments_query_vars"
"body":"wp_edit_attachments_query_vars( ${1:\\$q = false} )"
"Run the wp query to fetch the posts for listing on the edit posts page":
"prefix":"wp_edit_posts_query"
"body":"wp_edit_posts_query( ${1:\\$q = false} )"
"Renders an editor.":
"prefix":"wp_editor"
"body":"wp_editor( ${1:\\$content}${2:, \\$editor_id}${3:, \\$settings = array()} )"
"Creates default array of embed parameters.":
"prefix":"wp_embed_defaults"
"body":"wp_embed_defaults( ${1:\\$url = ''} )"
"Filters the post excerpt for the embed template.":
"prefix":"wp_embed_excerpt_attachment"
"body":"wp_embed_excerpt_attachment( ${1:\\$content} )"
"Filters the string in the 'more' link displayed after a trimmed excerpt.":
"prefix":"wp_embed_excerpt_more"
"body":"wp_embed_excerpt_more( ${1:\\$more_string} )"
"Audio embed handler callback.":
"prefix":"wp_embed_handler_audio"
"body":"wp_embed_handler_audio( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"The Google Video embed handler callback.":
"prefix":"wp_embed_handler_googlevideo"
"body":"wp_embed_handler_googlevideo()"
"Video embed handler callback.":
"prefix":"wp_embed_handler_video"
"body":"wp_embed_handler_video( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"YouTube iframe embed handler callback.":
"prefix":"wp_embed_handler_youtube"
"body":"wp_embed_handler_youtube( ${1:\\$matches}${2:, \\$attr}${3:, \\$url}${4:, \\$rawattr} )"
"Registers an embed handler.":
"prefix":"wp_embed_register_handler"
"body":"wp_embed_register_handler( ${1:\\$id}${2:, \\$regex}${3:, \\$callback}${4:, \\$priority = 10} )"
"Unregisters a previously-registered embed handler.":
"prefix":"wp_embed_unregister_handler"
"body":"wp_embed_unregister_handler( ${1:\\$id}${2:, \\$priority = 10} )"
"Convert any 4 byte emoji in a string to their equivalent HTML entity.":
"prefix":"wp_encode_emoji"
"body":"wp_encode_emoji( ${1:\\$content} )"
"Outputs the editor scripts, stylesheets, and default settings.":
"prefix":"wp_enqueue_editor"
"body":"wp_enqueue_editor()"
"Enqueues all scripts, styles, settings, and templates necessary to use
all media JS APIs.":
"prefix":"wp_enqueue_media"
"body":"wp_enqueue_media( ${1:\\$args = array()} )"
"Enqueue a script.":
"prefix":"wp_enqueue_script"
"body":"wp_enqueue_script( ${1:\\$handle}${2:, \\$src = ''}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$in_footer = false} )"
"Wrapper for do_action('wp_enqueue_scripts')":
"prefix":"wp_enqueue_scripts"
"body":"wp_enqueue_scripts()"
"Enqueue a CSS stylesheet.":
"prefix":"wp_enqueue_style"
"body":"wp_enqueue_style( ${1:\\$handle}${2:, \\$src = ''}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$media = 'all'} )"
"Convert the exif date format to a unix timestamp.":
"prefix":"wp_exif_date2ts"
"body":"wp_exif_date2ts( ${1:\\$str} )"
"Convert a fraction string to a decimal.":
"prefix":"wp_exif_frac2dec"
"body":"wp_exif_frac2dec( ${1:\\$str} )"
"Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.":
"prefix":"wp_expand_dimensions"
"body":"wp_expand_dimensions( ${1:\\$example_width}${2:, \\$example_height}${3:, \\$max_width}${4:, \\$max_height} )"
"Retrieve nonce action "Are you sure" message.":
"prefix":"wp_explain_nonce"
"body":"wp_explain_nonce( ${1:\\$action} )"
"Retrieve the file type based on the extension name.":
"prefix":"wp_ext2type"
"body":"wp_ext2type( ${1:\\$ext} )"
"Use RegEx to extract URLs from arbitrary content.":
"prefix":"wp_extract_urls"
"body":"wp_extract_urls( ${1:\\$content} )"
"Don't load all of WordPress when handling a favicon.ico request.":
"prefix":"wp_favicon_request"
"body":"wp_favicon_request()"
"Initialises and connects the WordPress Filesystem Abstraction classes.":
"prefix":"wp_filesystem"
"body":"wp_filesystem( ${1:\\$args = false}${2:, \\$context = false}${3:, \\$allow_relaxed_file_ownership = false} )"
"Filters and sanitizes comment data.":
"prefix":"wp_filter_comment"
"body":"wp_filter_comment( ${1:\\$commentdata} )"
"Sanitize content with allowed HTML Kses rules.":
"prefix":"wp_filter_kses"
"body":"wp_filter_kses( ${1:\\$data} )"
"Strips all of the HTML in the content.":
"prefix":"wp_filter_nohtml_kses"
"body":"wp_filter_nohtml_kses( ${1:\\$data} )"
"Filters a list of objects, based on a set of key => value arguments. wp_filter_object_list":
"prefix":"wp_filter_object_list"
"body":"wp_filter_object_list( ${1:\\$list}${2:, \\$args = array()}${3:, \\$operator = 'and'}${4:, \\$field = false} )"
"Filters the given oEmbed HTML.":
"prefix":"wp_filter_oembed_result"
"body":"wp_filter_oembed_result( ${1:\\$result}${2:, \\$data}${3:, \\$url} )"
"Sanitize content for allowed HTML tags for post content. wp_filter_post_kses":
"prefix":"wp_filter_post_kses"
"body":"wp_filter_post_kses( ${1:\\$data} )"
"Filters the oEmbed result before any HTTP requests are made.":
"prefix":"wp_filter_pre_oembed_result"
"body":"wp_filter_pre_oembed_result( ${1:\\$result}${2:, \\$url}${3:, \\$args} )"
"Find hierarchy loops using a callback function that maps object IDs to parent IDs.":
"prefix":"wp_find_hierarchy_loop"
"body":"wp_find_hierarchy_loop( ${1:\\$callback}${2:, \\$start}${3:, \\$start_parent}${4:, \\$callback_args = array()} )"
"Use the "The Tortoise and the Hare" algorithm to detect loops.":
"prefix":"wp_find_hierarchy_loop_tortoise_hare"
"body":"wp_find_hierarchy_loop_tortoise_hare( ${1:\\$callback}${2:, \\$start}${3:, \\$override = array()}${4:, \\$callback_args = array()}${5:, \\$_return_loop = false} )"
"Fix `$_SERVER` variables for various setups.":
"prefix":"wp_fix_server_vars"
"body":"wp_fix_server_vars()"
"Fire the wp_footer action.":
"prefix":"wp_footer"
"body":"wp_footer()"
"Defines functionality related WordPress constants":
"prefix":"wp_functionality_constants"
"body":"wp_functionality_constants()"
"Generate post thumbnail attachment meta data.":
"prefix":"wp_generate_attachment_metadata"
"body":"wp_generate_attachment_metadata( ${1:\\$attachment_id}${2:, \\$file} )"
"Generate authentication cookie contents.":
"prefix":"wp_generate_auth_cookie"
"body":"wp_generate_auth_cookie( ${1:\\$user_id}${2:, \\$expiration}${3:, \\$scheme = 'auth'}${4:, \\$token = ''} )"
"Generates a random password drawn from the defined set of characters.":
"prefix":"wp_generate_password"
"body":"wp_generate_password( ${1:\\$length = 12}${2:, \\$special_chars = true}${3:, \\$extra_special_chars = false} )"
"Generates a tag cloud (heatmap) from provided data.":
"prefix":"wp_generate_tag_cloud"
"body":"wp_generate_tag_cloud( ${1:\\$tags}${2:, \\$args = ''} )"
"Generate a random UUID (version 4).":
"prefix":"wp_generate_uuid4"
"body":"wp_generate_uuid4()"
"Displays the XHTML generator that is generated on the wp_head hook.":
"prefix":"wp_generator"
"body":"wp_generator()"
"Retrieve an array of active and valid plugin files.":
"prefix":"wp_get_active_and_valid_plugins"
"body":"wp_get_active_and_valid_plugins()"
"Returns array of network plugin files to be included in global scope.":
"prefix":"wp_get_active_network_plugins"
"body":"wp_get_active_network_plugins()"
"Retrieve additional image sizes.":
"prefix":"wp_get_additional_image_sizes"
"body":"wp_get_additional_image_sizes()"
"Retrieve a list of sessions for the current user.":
"prefix":"wp_get_all_sessions"
"body":"wp_get_all_sessions()"
"Display archive links based on type and format.":
"prefix":"wp_get_archives"
"body":"wp_get_archives( ${1:\\$args = ''} )"
"Get the menu items associated with a particular object.":
"prefix":"wp_get_associated_nav_menu_items"
"body":"wp_get_associated_nav_menu_items( ${1:\\$object_id}${2:, \\$object_type = 'post_type'}${3:, \\$taxonomy = ''} )"
"Retrieves the caption for an attachment.":
"prefix":"wp_get_attachment_caption"
"body":"wp_get_attachment_caption( ${1:\\$post_id} )"
"Returns useful keys to use to lookup data from an attachment's stored metadata.":
"prefix":"wp_get_attachment_id3_keys"
"body":"wp_get_attachment_id3_keys( ${1:\\$attachment}${2:, \\$context = 'display'} )"
"Get an HTML img element representing an image attachment":
"prefix":"wp_get_attachment_image"
"body":"wp_get_attachment_image( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false}${4:, \\$attr = ''} )"
"Retrieves the value for an image attachment's 'sizes' attribute.":
"prefix":"wp_get_attachment_image_sizes"
"body":"wp_get_attachment_image_sizes( ${1:\\$attachment_id}${2:, \\$size = 'medium'}${3:, \\$image_meta = null} )"
"Retrieve an image to represent an attachment.":
"prefix":"wp_get_attachment_image_src"
"body":"wp_get_attachment_image_src( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false} )"
"Retrieves the value for an image attachment's 'srcset' attribute.":
"prefix":"wp_get_attachment_image_srcset"
"body":"wp_get_attachment_image_srcset( ${1:\\$attachment_id}${2:, \\$size = 'medium'}${3:, \\$image_meta = null} )"
"Get the URL of an image attachment.":
"prefix":"wp_get_attachment_image_url"
"body":"wp_get_attachment_image_url( ${1:\\$attachment_id}${2:, \\$size = 'thumbnail'}${3:, \\$icon = false} )"
"Retrieve an attachment page link using an image or icon, if possible.":
"prefix":"wp_get_attachment_link"
"body":"wp_get_attachment_link( ${1:\\$id}${2:, \\$size = 'thumbnail'}${3:, \\$permalink = false}${4:, \\$icon = false}${5:, \\$text = false}${6:, \\$attr = ''} )"
"Retrieve attachment meta field for attachment ID.":
"prefix":"wp_get_attachment_metadata"
"body":"wp_get_attachment_metadata( ${1:\\$post_id}${2:, \\$unfiltered = false} )"
"Retrieve thumbnail for an attachment.":
"prefix":"wp_get_attachment_thumb_file"
"body":"wp_get_attachment_thumb_file( ${1:\\$post_id} )"
"Retrieve URL for an attachment thumbnail.":
"prefix":"wp_get_attachment_thumb_url"
"body":"wp_get_attachment_thumb_url( ${1:\\$post_id} )"
"Retrieve the URL for an attachment.":
"prefix":"wp_get_attachment_url"
"body":"wp_get_attachment_url( ${1:\\$post_id} )"
"Returns a filtered list of WP-supported audio formats.":
"prefix":"wp_get_audio_extensions"
"body":"wp_get_audio_extensions()"
"Get available translations from the WordPress.org API.":
"prefix":"wp_get_available_translations"
"body":"wp_get_available_translations()"
"Returns the canonical URL for a post.":
"prefix":"wp_get_canonical_url"
"body":"wp_get_canonical_url( ${1:\\$post = null} )"
"Retrieves the maximum character lengths for the comment form fields.":
"prefix":"wp_get_comment_fields_max_lengths"
"body":"wp_get_comment_fields_max_lengths()"
"The status of a comment by ID.":
"prefix":"wp_get_comment_status"
"body":"wp_get_comment_status( ${1:\\$comment_id} )"
"Gets the user cookie login. This function is deprecated.":
"prefix":"wp_get_cookie_login"
"body":"wp_get_cookie_login()"
"Get current commenter's name, email, and URL.":
"prefix":"wp_get_current_commenter"
"body":"wp_get_current_commenter()"
"Retrieve the current user object.":
"prefix":"wp_get_current_user"
"body":"wp_get_current_user()"
"Fetch the saved Custom CSS content for rendering.":
"prefix":"wp_get_custom_css"
"body":"wp_get_custom_css( ${1:\\$stylesheet = ''} )"
"Fetch the `custom_css` post for a given theme.":
"prefix":"wp_get_custom_css_post"
"body":"wp_get_custom_css_post( ${1:\\$stylesheet = ''} )"
"Retrieve the SQL for creating database tables.":
"prefix":"wp_get_db_schema"
"body":"wp_get_db_schema( ${1:\\$scope = 'all'}${2:, \\$blog_id = null} )"
"Returns document title for the current page.":
"prefix":"wp_get_document_title"
"body":"wp_get_document_title()"
"Retrieves the list of common file extensions and their types.":
"prefix":"wp_get_ext_types"
"body":"wp_get_ext_types()"
"Perform a HTTP HEAD or GET request.":
"prefix":"wp_get_http"
"body":"wp_get_http( ${1:\\$url}${2:, \\$file_path = false}${3:, \\$red = 1} )"
"Retrieve HTTP Headers from URL.":
"prefix":"wp_get_http_headers"
"body":"wp_get_http_headers( ${1:\\$url}${2:, \\$deprecated = false} )"
"Returns a WP_Image_Editor instance and loads file into it.":
"prefix":"wp_get_image_editor"
"body":"wp_get_image_editor( ${1:\\$path}${2:, \\$args = array()} )"
"Returns the real mime type of an image file.":
"prefix":"wp_get_image_mime"
"body":"wp_get_image_mime( ${1:\\$file} )"
"Get installed translations.":
"prefix":"wp_get_installed_translations"
"body":"wp_get_installed_translations( ${1:\\$type} )"
"Retrieves the link categories associated with the link specified.":
"prefix":"wp_get_link_cats"
"body":"wp_get_link_cats( ${1:\\$link_id} )"
"Gets the links associated with category.":
"prefix":"wp_get_links"
"body":"wp_get_links( ${1:\\$args = ''} )"
"Gets the links associated with the named category.":
"prefix":"wp_get_linksbyname"
"body":"wp_get_linksbyname( ${1:\\$category}${2:, \\$args = ''} )"
"Retrieve list of mime types and file extensions.":
"prefix":"wp_get_mime_types"
"body":"wp_get_mime_types()"
"Retrieve an array of must-use plugin files.":
"prefix":"wp_get_mu_plugins"
"body":"wp_get_mu_plugins()"
"Retrieves all menu items of a navigation menu.":
"prefix":"wp_get_nav_menu_items"
"body":"wp_get_nav_menu_items( ${1:\\$menu}${2:, \\$args = array()} )"
"Returns a navigation menu object.":
"prefix":"wp_get_nav_menu_object"
"body":"wp_get_nav_menu_object( ${1:\\$menu} )"
"Returns the menu formatted to edit.":
"prefix":"wp_get_nav_menu_to_edit"
"body":"wp_get_nav_menu_to_edit( ${1:\\$menu_id} )"
"Returns all navigation menu objects.":
"prefix":"wp_get_nav_menus"
"body":"wp_get_nav_menus( ${1:\\$args = array()} )"
"Retrieve an object containing information about the requested network.":
"prefix":"wp_get_network"
"body":"wp_get_network( ${1:\\$network} )"
"Get the header information to prevent caching.":
"prefix":"wp_get_nocache_headers"
"body":"wp_get_nocache_headers()"
"Retrieves the terms associated with the given object(s), in the supplied taxonomies.":
"prefix":"wp_get_object_terms"
"body":"wp_get_object_terms( ${1:\\$object_ids}${2:, \\$taxonomies}${3:, \\$args = array()} )"
"Retrieve original referer that was posted, if it exists.":
"prefix":"wp_get_original_referer"
"body":"wp_get_original_referer()"
"Gets the text suggesting how to create strong passwords.":
"prefix":"wp_get_password_hint"
"body":"wp_get_password_hint()"
"Extract headers from a PO file.":
"prefix":"wp_get_pomo_file_data"
"body":"wp_get_pomo_file_data( ${1:\\$po_file} )"
"Returns a list from WordPress.org of popular importer plugins.":
"prefix":"wp_get_popular_importers"
"body":"wp_get_popular_importers()"
"Retrieve the autosaved data of the specified post.":
"prefix":"wp_get_post_autosave"
"body":"wp_get_post_autosave( ${1:\\$post_id}${2:, \\$user_id} )"
"Retrieve the list of categories for a post.":
"prefix":"wp_get_post_categories"
"body":"wp_get_post_categories( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieves a list of post categories.":
"prefix":"wp_get_post_cats"
"body":"wp_get_post_cats( ${1:\\$blogid = '1'}${2:, \\$post_ID} )"
"Return the post's parent's post_ID":
"prefix":"wp_get_post_parent_id"
"body":"wp_get_post_parent_id( ${1:\\$post_ID} )"
"Gets a post revision.":
"prefix":"wp_get_post_revision"
"body":"wp_get_post_revision( ${1:\\$post}${2:, \\$output = OBJECT}${3:, \\$filter = 'raw'} )"
"Returns all revisions of specified post.":
"prefix":"wp_get_post_revisions"
"body":"wp_get_post_revisions( ${1:\\$post_id}${2:, \\$args = null} )"
"Retrieve the tags for a post. wp_get_post_tags":
"prefix":"wp_get_post_tags"
"body":"wp_get_post_tags( ${1:\\$post_id}${2:, \\$args = array()} )"
"Retrieve the terms for a post.":
"prefix":"wp_get_post_terms"
"body":"wp_get_post_terms( ${1:\\$post_id}${2:, \\$taxonomy = 'post_tag'}${3:, \\$args = array()} )"
"Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.":
"prefix":"wp_get_raw_referer"
"body":"wp_get_raw_referer()"
"Retrieve a number of recent posts.":
"prefix":"wp_get_recent_posts"
"body":"wp_get_recent_posts( ${1:\\$args = array()}${2:, \\$output = ARRAY_A} )"
"Retrieve referer from '_wp_http_referer' or HTTP referer.":
"prefix":"wp_get_referer"
"body":"wp_get_referer()"
"Get the revision UI diff.":
"prefix":"wp_get_revision_ui_diff"
"body":"wp_get_revision_ui_diff( ${1:\\$post}${2:, \\$compare_from}${3:, \\$compare_to} )"
"Retrieve the recurrence schedule for an event.":
"prefix":"wp_get_schedule"
"body":"wp_get_schedule( ${1:\\$hook}${2:, \\$args = array()} )"
"Retrieve supported event recurrence schedules.":
"prefix":"wp_get_schedules"
"body":"wp_get_schedules()"
"Return the HTTP protocol sent by the server.":
"prefix":"wp_get_server_protocol"
"body":"wp_get_server_protocol()"
"Retrieve the current session token from the logged_in cookie.":
"prefix":"wp_get_session_token"
"body":"wp_get_session_token()"
"Returns a shortlink for a post, page, attachment, or site.":
"prefix":"wp_get_shortlink"
"body":"wp_get_shortlink( ${1:\\$id}${2:, \\$context = 'post'}${3:, \\$allow_slugs = true} )"
"Retrieve full list of sidebars and their widget instance IDs.":
"prefix":"wp_get_sidebars_widgets"
"body":"wp_get_sidebars_widgets( ${1:\\$deprecated = true} )"
"Retrieve a single post, based on post ID.":
"prefix":"wp_get_single_post"
"body":"wp_get_single_post( ${1:\\$postid}${2:, \\$mode = OBJECT} )"
"Return an array of sites for a network or networks.":
"prefix":"wp_get_sites"
"body":"wp_get_sites( ${1:\\$args = array()} )"
"Get the new term ID corresponding to a previously split term.":
"prefix":"wp_get_split_term"
"body":"wp_get_split_term( ${1:\\$old_term_id}${2:, \\$taxonomy} )"
"Get data about terms that previously shared a single term_id, but have since been split.":
"prefix":"wp_get_split_terms"
"body":"wp_get_split_terms( ${1:\\$old_term_id} )"
"Returns the term's parent's term_ID.":
"prefix":"wp_get_term_taxonomy_parent_id"
"body":"wp_get_term_taxonomy_parent_id( ${1:\\$term_id}${2:, \\$taxonomy} )"
"Gets a WP_Theme object for a theme.":
"prefix":"wp_get_theme"
"body":"wp_get_theme( ${1:\\$stylesheet = null}${2:, \\$theme_root = null} )"
"Returns an array of WP_Theme objects based on the arguments.":
"prefix":"wp_get_themes"
"body":"wp_get_themes( ${1:\\$args = array()} )"
"Retrieves a list of all language updates available.":
"prefix":"wp_get_translation_updates"
"body":"wp_get_translation_updates()"
"Collect counts and UI strings for available updates":
"prefix":"wp_get_update_data"
"body":"wp_get_update_data()"
"Retrieves uploads directory information.":
"prefix":"wp_get_upload_dir"
"body":"wp_get_upload_dir()"
"Set up the user contact methods.":
"prefix":"wp_get_user_contact_methods"
"body":"wp_get_user_contact_methods( ${1:\\$user = null} )"
"Get the user IDs of all users with no role on this site.":
"prefix":"wp_get_users_with_no_role"
"body":"wp_get_users_with_no_role()"
"Returns a filtered list of WP-supported video formats.":
"prefix":"wp_get_video_extensions"
"body":"wp_get_video_extensions()"
"Retrieve default registered sidebars list.":
"prefix":"wp_get_widget_defaults"
"body":"wp_get_widget_defaults()"
"Guess the URL for the site.":
"prefix":"wp_guess_url"
"body":"wp_guess_url()"
"Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form.":
"prefix":"wp_handle_comment_submission"
"body":"wp_handle_comment_submission( ${1:\\$comment_data} )"
"Wrapper for _wp_handle_upload(). wp_handle_sideload":
"prefix":"wp_handle_sideload"
"body":"wp_handle_sideload( ${1:\\$file}${2:, \\$overrides = false}${3:, \\$time = null} )"
"Wrapper for _wp_handle_upload(). wp_handle_upload":
"prefix":"wp_handle_upload"
"body":"wp_handle_upload( ${1:\\$file}${2:, \\$overrides = false}${3:, \\$time = null} )"
"Get hash of given string.":
"prefix":"wp_hash"
"body":"wp_hash( ${1:\\$data}${2:, \\$scheme = 'auth'} )"
"Create a hash (encrypt) of a plain text password.":
"prefix":"wp_hash_password"
"body":"wp_hash_password( ${1:\\$password} )"
"Fire the wp_head action.":
"prefix":"wp_head"
"body":"wp_head()"
"Disable suspension of Heartbeat on the Add/Edit Post screens.":
"prefix":"wp_heartbeat_set_suspension"
"body":"wp_heartbeat_set_suspension( ${1:\\$settings} )"
"Default settings for heartbeat":
"prefix":"wp_heartbeat_settings"
"body":"wp_heartbeat_settings( ${1:\\$settings} )"
"Safely extracts not more than the first $count characters from html string.":
"prefix":"wp_html_excerpt"
"body":"wp_html_excerpt( ${1:\\$str}${2:, \\$count}${3:, \\$more = null} )"
"Separate HTML elements and comments from the text.":
"prefix":"wp_html_split"
"body":"wp_html_split( ${1:\\$input} )"
"Formats text for the HTML editor.":
"prefix":"wp_htmledit_pre"
"body":"wp_htmledit_pre( ${1:\\$output} )"
"Determines if there is an HTTP Transport that can process this request.":
"prefix":"wp_http_supports"
"body":"wp_http_supports( ${1:\\$capabilities = array()}${2:, \\$url = null} )"
"Validate a URL for safe use in the HTTP API.":
"prefix":"wp_http_validate_url"
"body":"wp_http_validate_url( ${1:\\$url} )"
"Adds the iframe to display content for the media upload page":
"prefix":"wp_iframe"
"body":"wp_iframe( ${1:\\$content_func} )"
"Adds 'srcset' and 'sizes' attributes to an existing 'img' element.":
"prefix":"wp_image_add_srcset_and_sizes"
"body":"wp_image_add_srcset_and_sizes( ${1:\\$image}${2:, \\$image_meta}${3:, \\$attachment_id} )"
"Loads the WP image-editing interface.":
"prefix":"wp_image_editor"
"body":"wp_image_editor( ${1:\\$post_id}${2:, \\$msg = false} )"
"Tests whether there is an editor that supports a given mime type or methods.":
"prefix":"wp_image_editor_supports"
"body":"wp_image_editor_supports( ${1:\\$args = array()} )"
"Helper function to test if aspect ratios for two images match.":
"prefix":"wp_image_matches_ratio"
"body":"wp_image_matches_ratio( ${1:\\$source_width}${2:, \\$source_height}${3:, \\$target_width}${4:, \\$target_height} )"
"Create new GD image resource with transparency support":
"prefix":"wp_imagecreatetruecolor"
"body":"wp_imagecreatetruecolor( ${1:\\$width}${2:, \\$height} )"
"Cleanup importer.":
"prefix":"wp_import_cleanup"
"body":"wp_import_cleanup( ${1:\\$id} )"
"Handle importer uploading and add attachment.":
"prefix":"wp_import_handle_upload"
"body":"wp_import_handle_upload()"
"Outputs the form used by the importers to accept the data to be imported":
"prefix":"wp_import_upload_form"
"body":"wp_import_upload_form( ${1:\\$action} )"
"Defines initial WordPress constants":
"prefix":"wp_initial_constants"
"body":"wp_initial_constants()"
"Limit the amount of meta boxes to pages, posts, links, and categories for first time users.":
"prefix":"wp_initial_nav_menu_meta_boxes"
"body":"wp_initial_nav_menu_meta_boxes()"
"Insert an attachment.":
"prefix":"wp_insert_attachment"
"body":"wp_insert_attachment( ${1:\\$args}${2:, \\$file = false}${3:, \\$parent}${4:, \\$wp_error = false} )"
"Updates an existing Category or creates a new Category.":
"prefix":"wp_insert_category"
"body":"wp_insert_category( ${1:\\$catarr}${2:, \\$wp_error = false} )"
"Inserts a comment into the database.":
"prefix":"wp_insert_comment"
"body":"wp_insert_comment( ${1:\\$commentdata} )"
"Inserts/updates links into/in the database.":
"prefix":"wp_insert_link"
"body":"wp_insert_link( ${1:\\$linkdata}${2:, \\$wp_error = false} )"
"Insert or update a post.":
"prefix":"wp_insert_post"
"body":"wp_insert_post( ${1:\\$postarr}${2:, \\$wp_error = false} )"
"Add a new term to the database.":
"prefix":"wp_insert_term"
"body":"wp_insert_term( ${1:\\$term}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Insert a user into the database.":
"prefix":"wp_insert_user"
"body":"wp_insert_user( ${1:\\$userdata} )"
"Installs the site.":
"prefix":"wp_install"
"body":"wp_install( ${1:\\$blog_title}${2:, \\$user_name}${3:, \\$user_email}${4:, \\$public}${5:, \\$deprecated = ''}${6:, \\$user_password = ''}${7:, \\$language = ''} )"
"Creates the initial content for a newly-installed site.":
"prefix":"wp_install_defaults"
"body":"wp_install_defaults( ${1:\\$user_id} )"
"Output the select form for the language selection on the installation screen.":
"prefix":"wp_install_language_form"
"body":"wp_install_language_form( ${1:\\$languages} )"
"Maybe enable pretty permalinks on install.":
"prefix":"wp_install_maybe_enable_pretty_permalinks"
"body":"wp_install_maybe_enable_pretty_permalinks()"
"Check or set whether WordPress is in "installation" mode.":
"prefix":"wp_installing"
"body":"wp_installing( ${1:\\$is_installing = null} )"
"Determines whether file modifications are allowed.":
"prefix":"wp_is_file_mod_allowed"
"body":"wp_is_file_mod_allowed( ${1:\\$context} )"
"Determines whether a PHP ini value is changeable at runtime.":
"prefix":"wp_is_ini_value_changeable"
"body":"wp_is_ini_value_changeable( ${1:\\$setting} )"
"Whether or not we have a large network.":
"prefix":"wp_is_large_network"
"body":"wp_is_large_network( ${1:\\$using = 'sites'}${2:, \\$network_id = null} )"
"Test if the current browser runs on a mobile device (smart phone, tablet, etc.)":
"prefix":"wp_is_mobile"
"body":"wp_is_mobile()"
"Determines if the variable is a numeric-indexed array.":
"prefix":"wp_is_numeric_array"
"body":"wp_is_numeric_array( ${1:\\$data} )"
"Determines if the specified post is an autosave.":
"prefix":"wp_is_post_autosave"
"body":"wp_is_post_autosave( ${1:\\$post} )"
"Determines if the specified post is a revision.":
"prefix":"wp_is_post_revision"
"body":"wp_is_post_revision( ${1:\\$post} )"
"Test if a given path is a stream URL":
"prefix":"wp_is_stream"
"body":"wp_is_stream( ${1:\\$path} )"
"Determine if a directory is writable.":
"prefix":"wp_is_writable"
"body":"wp_is_writable( ${1:\\$path} )"
"Convert to ASCII from email subjects.":
"prefix":"wp_iso_descrambler"
"body":"wp_iso_descrambler( ${1:\\$string} )"
"Encode a variable into JSON, with some sanity checks.":
"prefix":"wp_json_encode"
"body":"wp_json_encode( ${1:\\$data}${2:, \\$options}${3:, \\$depth = 512} )"
"Load localized data on print rather than initialization.":
"prefix":"wp_just_in_time_script_localization"
"body":"wp_just_in_time_script_localization()"
"Filters content and keeps only allowable HTML elements.":
"prefix":"wp_kses"
"body":"wp_kses( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols = array()} )"
"Return a list of allowed tags and attributes for a given context.":
"prefix":"wp_kses_allowed_html"
"body":"wp_kses_allowed_html( ${1:\\$context = ''} )"
"Goes through an array and changes the keys to all lower case.":
"prefix":"wp_kses_array_lc"
"body":"wp_kses_array_lc( ${1:\\$inarray} )"
"Removes all attributes, if none are allowed for this element.":
"prefix":"wp_kses_attr"
"body":"wp_kses_attr( ${1:\\$element}${2:, \\$attr}${3:, \\$allowed_html}${4:, \\$allowed_protocols} )"
"Determine whether an attribute is allowed.":
"prefix":"wp_kses_attr_check"
"body":"wp_kses_attr_check( ${1:\\$name}${2:, \\$value}${3:, \\$whole}${4:, \\$vless}${5:, \\$element}${6:, \\$allowed_html} )"
"Finds all attributes of an HTML element.":
"prefix":"wp_kses_attr_parse"
"body":"wp_kses_attr_parse( ${1:\\$element} )"
"Sanitize string from bad protocols.":
"prefix":"wp_kses_bad_protocol"
"body":"wp_kses_bad_protocol( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Sanitizes content from bad protocols and other characters.":
"prefix":"wp_kses_bad_protocol_once"
"body":"wp_kses_bad_protocol_once( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Callback for wp_kses_bad_protocol_once() regular expression.":
"prefix":"wp_kses_bad_protocol_once2"
"body":"wp_kses_bad_protocol_once2( ${1:\\$string}${2:, \\$allowed_protocols} )"
"Performs different checks for attribute values.":
"prefix":"wp_kses_check_attr_val"
"body":"wp_kses_check_attr_val( ${1:\\$value}${2:, \\$vless}${3:, \\$checkname}${4:, \\$checkvalue} )"
"Sanitize content with allowed HTML Kses rules. wp_kses_datare":
"prefix":"wp_kses_data"
"body":"wp_kses_data( ${1:\\$data} )"
"Convert all entities to their character counterparts.":
"prefix":"wp_kses_decode_entities"
"body":"wp_kses_decode_entities( ${1:\\$string} )"
"Builds an attribute list from string containing attributes. wp_kses_hair":
"prefix":"wp_kses_hair"
"body":"wp_kses_hair( ${1:\\$attr}${2:, \\$allowed_protocols} )"
"Builds an attribute list from string containing attributes. wp_kses_hair_parse":
"prefix":"wp_kses_hair_parse"
"body":"wp_kses_hair_parse( ${1:\\$attr} )"
"You add any kses hooks here.":
"prefix":"wp_kses_hook"
"body":"wp_kses_hook( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Handles parsing errors in wp_kses_hair().":
"prefix":"wp_kses_html_error"
"body":"wp_kses_html_error( ${1:\\$string} )"
"Removes the HTML JavaScript entities found in early versions of Netscape 4.":
"prefix":"wp_kses_js_entities"
"body":"wp_kses_js_entities( ${1:\\$string} )"
"Callback for wp_kses_normalize_entities() regular expression. wp_kses_named_entitiesre":
"prefix":"wp_kses_named_entities"
"body":"wp_kses_named_entities( ${1:\\$matches} )"
"Removes any invalid control characters in $string.":
"prefix":"wp_kses_no_null"
"body":"wp_kses_no_null( ${1:\\$string}${2:, \\$options = null} )"
"Converts and fixes HTML entities.":
"prefix":"wp_kses_normalize_entities"
"body":"wp_kses_normalize_entities( ${1:\\$string} )"
"Callback for wp_kses_normalize_entities() regular expression. wp_kses_normalize_entities2":
"prefix":"wp_kses_normalize_entities2"
"body":"wp_kses_normalize_entities2( ${1:\\$matches} )"
"Callback for wp_kses_normalize_entities() for regular expression.":
"prefix":"wp_kses_normalize_entities3"
"body":"wp_kses_normalize_entities3( ${1:\\$matches} )"
"Filters one attribute only and ensures its value is allowed.":
"prefix":"wp_kses_one_attr"
"body":"wp_kses_one_attr( ${1:\\$string}${2:, \\$element} )"
"Sanitize content for allowed HTML tags for post content. wp_kses_post":
"prefix":"wp_kses_post"
"body":"wp_kses_post( ${1:\\$data} )"
"Navigates through an array, object, or scalar, and sanitizes content for
allowed HTML tags for post content.":
"prefix":"wp_kses_post_deep"
"body":"wp_kses_post_deep( ${1:\\$data} )"
"Searches for HTML tags, no matter how malformed.":
"prefix":"wp_kses_split"
"body":"wp_kses_split( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Callback for wp_kses_split for fixing malformed HTML tags.":
"prefix":"wp_kses_split2"
"body":"wp_kses_split2( ${1:\\$string}${2:, \\$allowed_html}${3:, \\$allowed_protocols} )"
"Strips slashes from in front of quotes.":
"prefix":"wp_kses_stripslashes"
"body":"wp_kses_stripslashes( ${1:\\$string} )"
"This function returns kses' version number.":
"prefix":"wp_kses_version"
"body":"wp_kses_version()"
"Outputs a link category checklist element.":
"prefix":"wp_link_category_checklist"
"body":"wp_link_category_checklist( ${1:\\$link_id} )"
"Outputs the 'disabled' message for the WordPress Link Manager.":
"prefix":"wp_link_manager_disabled_message"
"body":"wp_link_manager_disabled_message()"
"The formatted output of a list of pages.":
"prefix":"wp_link_pages"
"body":"wp_link_pages( ${1:\\$args = ''} )"
"List all the authors of the site, with several options available.":
"prefix":"wp_list_authors"
"body":"wp_list_authors( ${1:\\$args = ''} )"
"Retrieve or echo all of the bookmarks.":
"prefix":"wp_list_bookmarks"
"body":"wp_list_bookmarks( ${1:\\$args = ''} )"
"Display or retrieve the HTML list of categories.":
"prefix":"wp_list_categories"
"body":"wp_list_categories( ${1:\\$args = ''} )"
"Lists categories. wp_list_cats":
"prefix":"wp_list_cats"
"body":"wp_list_cats( ${1:\\$args = ''} )"
"List comments.":
"prefix":"wp_list_comments"
"body":"wp_list_comments( ${1:\\$args = array()}${2:, \\$comments = null} )"
"Filters a list of objects, based on a set of key => value arguments. wp_list_filter":
"prefix":"wp_list_filter"
"body":"wp_list_filter( ${1:\\$list}${2:, \\$args = array()}${3:, \\$operator = 'AND'} )"
"Retrieve or display list of pages (or hierarchical post type items) in list (li) format.":
"prefix":"wp_list_pages"
"body":"wp_list_pages( ${1:\\$args = ''} )"
"Pluck a certain field out of each object in a list.":
"prefix":"wp_list_pluck"
"body":"wp_list_pluck( ${1:\\$list}${2:, \\$field}${3:, \\$index_key = null} )"
"Display list of a post's revisions.":
"prefix":"wp_list_post_revisions"
"body":"wp_list_post_revisions( ${1:\\$post_id}${2:, \\$type = 'all'} )"
"Sorts a list of objects, based on one or more orderby arguments.":
"prefix":"wp_list_sort"
"body":"wp_list_sort( ${1:\\$list}${2:, \\$orderby = array()}${3:, \\$order = 'ASC'}${4:, \\$preserve_keys = false} )"
"Show the widgets and their settings for a sidebar.":
"prefix":"wp_list_widget_controls"
"body":"wp_list_widget_controls( ${1:\\$sidebar}${2:, \\$sidebar_name = ''} )"
"Retrieves the widget control arguments.":
"prefix":"wp_list_widget_controls_dynamic_sidebar"
"body":"wp_list_widget_controls_dynamic_sidebar( ${1:\\$params} )"
"Display list of the available widgets.":
"prefix":"wp_list_widgets"
"body":"wp_list_widgets()"
"Loads and caches all autoloaded options, if available or all options.":
"prefix":"wp_load_alloptions"
"body":"wp_load_alloptions()"
"Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used.":
"prefix":"wp_load_core_site_options"
"body":"wp_load_core_site_options( ${1:\\$site_id = null} )"
"Load an image from a string, if PHP supports it.":
"prefix":"wp_load_image"
"body":"wp_load_image( ${1:\\$file} )"
"Attempt an early load of translations.":
"prefix":"wp_load_translations_early"
"body":"wp_load_translations_early()"
"Localizes community events data that needs to be passed to dashboard.js.":
"prefix":"wp_localize_community_events"
"body":"wp_localize_community_events()"
"Localizes the jQuery UI datepicker.":
"prefix":"wp_localize_jquery_ui_datepicker"
"body":"wp_localize_jquery_ui_datepicker()"
"Localize a script.":
"prefix":"wp_localize_script"
"body":"wp_localize_script( ${1:\\$handle}${2:, \\$object_name}${3:, \\$l10n} )"
"Checks a users login information and logs them in if it checks out. This function is deprecated.":
"prefix":"wp_login"
"body":"wp_login( ${1:\\$username}${2:, \\$password}${3:, \\$deprecated = ''} )"
"Provides a simple login form for use anywhere within WordPress.":
"prefix":"wp_login_form"
"body":"wp_login_form( ${1:\\$args = array()} )"
"Retrieves the login URL.":
"prefix":"wp_login_url"
"body":"wp_login_url( ${1:\\$redirect = ''}${2:, \\$force_reauth = false} )"
"wp_login_viewport_meta":
"prefix":"wp_login_viewport_meta"
"body":"wp_login_viewport_meta()"
"Display the Log In/Out link.":
"prefix":"wp_loginout"
"body":"wp_loginout( ${1:\\$redirect = ''}${2:, \\$echo = true} )"
"Log the current user out.":
"prefix":"wp_logout"
"body":"wp_logout()"
"Retrieves the logout URL.":
"prefix":"wp_logout_url"
"body":"wp_logout_url( ${1:\\$redirect = ''} )"
"Returns the URL that allows the user to retrieve the lost password":
"prefix":"wp_lostpassword_url"
"body":"wp_lostpassword_url( ${1:\\$redirect = ''} )"
"Add magic quotes to `$_GET`, `$_POST`, `$_COOKIE`, and `$_SERVER`.":
"prefix":"wp_magic_quotes"
"body":"wp_magic_quotes()"
"Send mail, similar to PHP's mail":
"prefix":"wp_mail"
"body":"wp_mail( ${1:\\$to}${2:, \\$subject}${3:, \\$message}${4:, \\$headers = ''}${5:, \\$attachments = array()} )"
"Die with a maintenance message when conditions are met.":
"prefix":"wp_maintenance"
"body":"wp_maintenance()"
"Filters 'img' elements in post content to add 'srcset' and 'sizes' attributes.":
"prefix":"wp_make_content_images_responsive"
"body":"wp_make_content_images_responsive( ${1:\\$content} )"
"Convert full URL paths to absolute paths.":
"prefix":"wp_make_link_relative"
"body":"wp_make_link_relative( ${1:\\$link} )"
"Check a MIME-Type against a list.":
"prefix":"wp_match_mime_types"
"body":"wp_match_mime_types( ${1:\\$wildcard_mime_types}${2:, \\$real_mime_types} )"
"Determines the maximum upload size allowed in php.ini.":
"prefix":"wp_max_upload_size"
"body":"wp_max_upload_size()"
"Performs WordPress automatic background updates.":
"prefix":"wp_maybe_auto_update"
"body":"wp_maybe_auto_update()"
"Determines if the date should be declined.":
"prefix":"wp_maybe_decline_date"
"body":"wp_maybe_decline_date( ${1:\\$date} )"
"Maybe attempts to generate attachment metadata, if missing.":
"prefix":"wp_maybe_generate_attachment_metadata"
"body":"wp_maybe_generate_attachment_metadata( ${1:\\$attachment} )"
"Determines if default embed handlers should be loaded.":
"prefix":"wp_maybe_load_embeds"
"body":"wp_maybe_load_embeds()"
"Determines if Widgets library should be loaded.":
"prefix":"wp_maybe_load_widgets"
"body":"wp_maybe_load_widgets()"
"Update the count of sites for the current network.":
"prefix":"wp_maybe_update_network_site_counts"
"body":"wp_maybe_update_network_site_counts( ${1:\\$network_id = null} )"
"Update the network-wide users count.":
"prefix":"wp_maybe_update_network_user_counts"
"body":"wp_maybe_update_network_user_counts( ${1:\\$network_id = null} )"
"Encapsulate logic for Attach/Detach actions":
"prefix":"wp_media_attach_action"
"body":"wp_media_attach_action( ${1:\\$parent_id}${2:, \\$action = 'attach'} )"
"Creates the form for external url":
"prefix":"wp_media_insert_url_form"
"body":"wp_media_insert_url_form( ${1:\\$default_view = 'image'} )"
"Handles the process of uploading media.":
"prefix":"wp_media_upload_handler"
"body":"wp_media_upload_handler()"
"Provides a No-JS Flash fallback as a last resort for audio / video.":
"prefix":"wp_mediaelement_fallback"
"body":"wp_mediaelement_fallback( ${1:\\$url} )"
"Theme container function for the 'wp_meta' action.":
"prefix":"wp_meta"
"body":"wp_meta()"
"Retrieves the queue for lazy-loading metadata.":
"prefix":"wp_metadata_lazyloader"
"body":"wp_metadata_lazyloader()"
"Retrieve the icon for a MIME type.":
"prefix":"wp_mime_type_icon"
"body":"wp_mime_type_icon( ${1:\\$mime} )"
"Recursive directory creation based on full path.":
"prefix":"wp_mkdir_p"
"body":"wp_mkdir_p( ${1:\\$target} )"
"Displays a navigation menu.":
"prefix":"wp_nav_menu"
"body":"wp_nav_menu( ${1:\\$args = array()} )"
"Check whether to disable the Menu Locations meta box submit button":
"prefix":"wp_nav_menu_disabled_check"
"body":"wp_nav_menu_disabled_check( ${1:\\$nav_menu_selected_id} )"
"Displays a meta box for the custom links menu item.":
"prefix":"wp_nav_menu_item_link_meta_box"
"body":"wp_nav_menu_item_link_meta_box()"
"Displays a meta box for a post type menu item.":
"prefix":"wp_nav_menu_item_post_type_meta_box"
"body":"wp_nav_menu_item_post_type_meta_box( ${1:\\$object}${2:, \\$box} )"
"Displays a meta box for a taxonomy menu item.":
"prefix":"wp_nav_menu_item_taxonomy_meta_box"
"body":"wp_nav_menu_item_taxonomy_meta_box( ${1:\\$object}${2:, \\$box} )"
"This was once used to display a meta box for the nav menu theme locations.":
"prefix":"wp_nav_menu_locations_meta_box"
"body":"wp_nav_menu_locations_meta_box()"
"Returns the columns for the nav menus page.":
"prefix":"wp_nav_menu_manage_columns"
"body":"wp_nav_menu_manage_columns()"
"wp_nav_menu_max_depth":
"prefix":"wp_nav_menu_max_depth"
"body":"wp_nav_menu_max_depth( ${1:\\$classes} )"
"Creates meta boxes for any post type menu item..":
"prefix":"wp_nav_menu_post_type_meta_boxes"
"body":"wp_nav_menu_post_type_meta_boxes()"
"Register nav menu meta boxes and advanced menu items.":
"prefix":"wp_nav_menu_setup"
"body":"wp_nav_menu_setup()"
"Creates meta boxes for any taxonomy menu item.":
"prefix":"wp_nav_menu_taxonomy_meta_boxes"
"body":"wp_nav_menu_taxonomy_meta_boxes()"
"Saves nav menu items":
"prefix":"wp_nav_menu_update_menu_items"
"body":"wp_nav_menu_update_menu_items( ${1:\\$nav_menu_selected_id}${2:, \\$nav_menu_selected_title} )"
"wp_network_dashboard_right_now":
"prefix":"wp_network_dashboard_right_now"
"body":"wp_network_dashboard_right_now()"
"Notifies the site admin that the setup is complete.":
"prefix":"wp_new_blog_notification"
"body":"wp_new_blog_notification( ${1:\\$blog_title}${2:, \\$blog_url}${3:, \\$user_id}${4:, \\$password} )"
"Adds a new comment to the database.":
"prefix":"wp_new_comment"
"body":"wp_new_comment( ${1:\\$commentdata}${2:, \\$avoid_die = false} )"
"Send a comment moderation notification to the comment moderator.":
"prefix":"wp_new_comment_notify_moderator"
"body":"wp_new_comment_notify_moderator( ${1:\\$comment_ID} )"
"Send a notification of a new comment to the post author.":
"prefix":"wp_new_comment_notify_postauthor"
"body":"wp_new_comment_notify_postauthor( ${1:\\$comment_ID} )"
"Email login credentials to a newly-registered user.":
"prefix":"wp_new_user_notification"
"body":"wp_new_user_notification( ${1:\\$user_id}${2:, \\$deprecated = null}${3:, \\$notify = ''} )"
"Retrieve the next timestamp for an event.":
"prefix":"wp_next_scheduled"
"body":"wp_next_scheduled( ${1:\\$hook}${2:, \\$args = array()} )"
"Display a noindex meta tag.":
"prefix":"wp_no_robots"
"body":"wp_no_robots()"
"Display "Are You Sure" message to confirm the action being taken.":
"prefix":"wp_nonce_ays"
"body":"wp_nonce_ays( ${1:\\$action} )"
"Retrieve or display nonce hidden field for forms.":
"prefix":"wp_nonce_field"
"body":"wp_nonce_field( ${1:\\$action = -1}${2:, \\$name = '_wpnonce'}${3:, \\$referer = true}${4:, \\$echo = true} )"
"Get the time-dependent variable for nonce creation.":
"prefix":"wp_nonce_tick"
"body":"wp_nonce_tick()"
"Retrieve URL with nonce added to URL query.":
"prefix":"wp_nonce_url"
"body":"wp_nonce_url( ${1:\\$actionurl}${2:, \\$action = -1}${3:, \\$name = '_wpnonce'} )"
"Normalize a filesystem path.":
"prefix":"wp_normalize_path"
"body":"wp_normalize_path( ${1:\\$path} )"
"Redirect to the installer if WordPress is not installed.":
"prefix":"wp_not_installed"
"body":"wp_not_installed()"
"Notifies the moderator of the site about a new comment that is awaiting approval.":
"prefix":"wp_notify_moderator"
"body":"wp_notify_moderator( ${1:\\$comment_id} )"
"Notify an author (and/or others) of a comment/trackback/pingback on a post.":
"prefix":"wp_notify_postauthor"
"body":"wp_notify_postauthor( ${1:\\$comment_id}${2:, \\$deprecated = null} )"
"Flush all output buffers for PHP 5.2.":
"prefix":"wp_ob_end_flush_all"
"body":"wp_ob_end_flush_all()"
"Adds oEmbed discovery links in the website <head>.":
"prefix":"wp_oembed_add_discovery_links"
"body":"wp_oembed_add_discovery_links()"
"Adds the necessary JavaScript to communicate with the embedded iframes.":
"prefix":"wp_oembed_add_host_js"
"body":"wp_oembed_add_host_js()"
"Adds a URL format and oEmbed provider URL pair.":
"prefix":"wp_oembed_add_provider"
"body":"wp_oembed_add_provider( ${1:\\$format}${2:, \\$provider}${3:, \\$regex = false} )"
"Ensures that the specified format is either 'json' or 'xml'.":
"prefix":"wp_oembed_ensure_format"
"body":"wp_oembed_ensure_format( ${1:\\$format} )"
"Attempts to fetch the embed HTML for a provided URL using oEmbed.":
"prefix":"wp_oembed_get"
"body":"wp_oembed_get( ${1:\\$url}${2:, \\$args = ''} )"
"Registers the oEmbed REST API route.":
"prefix":"wp_oembed_register_route"
"body":"wp_oembed_register_route()"
"Removes an oEmbed provider.":
"prefix":"wp_oembed_remove_provider"
"body":"wp_oembed_remove_provider( ${1:\\$format} )"
"Redirect old slugs to the correct permalink.":
"prefix":"wp_old_slug_redirect"
"body":"wp_old_slug_redirect()"
"Retrieve or display original referer hidden field for forms.":
"prefix":"wp_original_referer_field"
"body":"wp_original_referer_field( ${1:\\$echo = true}${2:, \\$jump_back_to = 'current'} )"
"Displays or retrieves a list of pages with an optional home link.":
"prefix":"wp_page_menu"
"body":"wp_page_menu( ${1:\\$args = array()} )"
"Outputs JS that reloads the page if the user navigated to it with the Back or Forward button.":
"prefix":"wp_page_reload_on_back_button_js"
"body":"wp_page_reload_on_back_button_js()"
"Merge user defined arguments into defaults array.":
"prefix":"wp_parse_args"
"body":"wp_parse_args( ${1:\\$args}${2:, \\$defaults = ''} )"
"Parse a cookie into its components":
"prefix":"wp_parse_auth_cookie"
"body":"wp_parse_auth_cookie( ${1:\\$cookie = ''}${2:, \\$scheme = ''} )"
"Clean up an array, comma- or space-separated list of IDs.":
"prefix":"wp_parse_id_list"
"body":"wp_parse_id_list( ${1:\\$list} )"
"Clean up an array, comma- or space-separated list of slugs.":
"prefix":"wp_parse_slug_list"
"body":"wp_parse_slug_list( ${1:\\$list} )"
"Parses a string into variables to be stored in an array.":
"prefix":"wp_parse_str"
"body":"wp_parse_str( ${1:\\$string}${2:, \\$array} )"
"A wrapper for PHP's parse_url() function that handles consistency in the return
values across PHP versions.":
"prefix":"wp_parse_url"
"body":"wp_parse_url( ${1:\\$url}${2:, \\$component = -1} )"
"Notify the blog admin of a user changing password, normally via email.":
"prefix":"wp_password_change_notification"
"body":"wp_password_change_notification( ${1:\\$user} )"
"Outputs and enqueue default scripts and styles for playlists.":
"prefix":"wp_playlist_scripts"
"body":"wp_playlist_scripts( ${1:\\$type} )"
"Builds the Playlist shortcode output.":
"prefix":"wp_playlist_shortcode"
"body":"wp_playlist_shortcode( ${1:\\$attr} )"
"Defines plugin directory WordPress constants":
"prefix":"wp_plugin_directory_constants"
"body":"wp_plugin_directory_constants()"
"Displays update information for a plugin.":
"prefix":"wp_plugin_update_row"
"body":"wp_plugin_update_row( ${1:\\$file}${2:, \\$plugin_data} )"
"wp_plugin_update_rows":
"prefix":"wp_plugin_update_rows"
"body":"wp_plugin_update_rows()"
"Prints default Plupload arguments.":
"prefix":"wp_plupload_default_settings"
"body":"wp_plupload_default_settings()"
"Retrieve a list of the most popular terms from the specified taxonomy.":
"prefix":"wp_popular_terms_checklist"
"body":"wp_popular_terms_checklist( ${1:\\$taxonomy}${2:, \\$default}${3:, \\$number = 10}${4:, \\$echo = true} )"
"Convert MIME types into SQL.":
"prefix":"wp_post_mime_type_where"
"body":"wp_post_mime_type_where( ${1:\\$post_mime_types}${2:, \\$table_alias = ''} )"
"Outputs a small JS snippet on preview tabs/windows to remove `window.name` on unload.":
"prefix":"wp_post_preview_js"
"body":"wp_post_preview_js()"
"Retrieve formatted date timestamp of a revision (linked to that revisions's page). wp_post_revision_title":
"prefix":"wp_post_revision_title"
"body":"wp_post_revision_title( ${1:\\$revision}${2:, \\$link = true} )"
"Retrieve formatted date timestamp of a revision (linked to that revisions's page). wp_post_revision_title_expanded":
"prefix":"wp_post_revision_title_expanded"
"body":"wp_post_revision_title_expanded( ${1:\\$revision}${2:, \\$link = true} )"
"Convert lone less than signs.":
"prefix":"wp_pre_kses_less_than"
"body":"wp_pre_kses_less_than( ${1:\\$text} )"
"Callback function used by preg_replace.":
"prefix":"wp_pre_kses_less_than_callback"
"body":"wp_pre_kses_less_than_callback( ${1:\\$matches} )"
"Preloads TinyMCE dialogs.":
"prefix":"wp_preload_dialogs"
"body":"wp_preload_dialogs()"
"Prepares an attachment post object for JS, where it is expected
to be JSON-encoded and fit into an Attachment model.":
"prefix":"wp_prepare_attachment_for_js"
"body":"wp_prepare_attachment_for_js( ${1:\\$attachment} )"
"Prepare revisions for JavaScript.":
"prefix":"wp_prepare_revisions_for_js"
"body":"wp_prepare_revisions_for_js( ${1:\\$post}${2:, \\$selected_revision_id}${3:, \\$from = null} )"
"Prepare themes for JavaScript.":
"prefix":"wp_prepare_themes_for_js"
"body":"wp_prepare_themes_for_js( ${1:\\$themes = null} )"
"Prints the JavaScript templates for update admin notices.":
"prefix":"wp_print_admin_notice_templates"
"body":"wp_print_admin_notice_templates()"
"Prints the markup for the Community Events section of the Events and News Dashboard widget.":
"prefix":"wp_print_community_events_markup"
"body":"wp_print_community_events_markup()"
"Renders the events templates for the Event and News widget.":
"prefix":"wp_print_community_events_templates"
"body":"wp_print_community_events_templates()"
"Prints TinyMCE editor JS.":
"prefix":"wp_print_editor_js"
"body":"wp_print_editor_js()"
"Hooks to print the scripts and styles in the footer.":
"prefix":"wp_print_footer_scripts"
"body":"wp_print_footer_scripts()"
"Prints the script queue in the HTML head on the front end.":
"prefix":"wp_print_head_scripts"
"body":"wp_print_head_scripts()"
"Prints the templates used in the media manager.":
"prefix":"wp_print_media_templates"
"body":"wp_print_media_templates()"
"Print the filesystem credentials modal when needed.":
"prefix":"wp_print_request_filesystem_credentials_modal"
"body":"wp_print_request_filesystem_credentials_modal()"
"Print JavaScript templates required for the revisions experience.":
"prefix":"wp_print_revision_templates"
"body":"wp_print_revision_templates()"
"Prints scripts in document head that are in the $handles queue.":
"prefix":"wp_print_scripts"
"body":"wp_print_scripts( ${1:\\$handles = false} )"
"Display styles that are in the $handles queue.":
"prefix":"wp_print_styles"
"body":"wp_print_styles( ${1:\\$handles = false} )"
"Prints the JavaScript templates for update and deletion rows in list tables.":
"prefix":"wp_print_update_row_templates"
"body":"wp_print_update_row_templates()"
"Protect WordPress special option from being modified.":
"prefix":"wp_protect_special_option"
"body":"wp_protect_special_option( ${1:\\$option} )"
"Reorder JavaScript scripts array to place prototype before jQuery.":
"prefix":"wp_prototype_before_jquery"
"body":"wp_prototype_before_jquery( ${1:\\$js_array} )"
"Publish a post by transitioning the post status.":
"prefix":"wp_publish_post"
"body":"wp_publish_post( ${1:\\$post} )"
"Queues comments for metadata lazy-loading.":
"prefix":"wp_queue_comments_for_comment_meta_lazyload"
"body":"wp_queue_comments_for_comment_meta_lazyload( ${1:\\$comments} )"
"Queues posts for lazy-loading of term meta.":
"prefix":"wp_queue_posts_for_term_meta_lazyload"
"body":"wp_queue_posts_for_term_meta_lazyload( ${1:\\$posts} )"
"Handles quicktags.":
"prefix":"wp_quicktags"
"body":"wp_quicktags()"
"Attempts to raise the PHP memory limit for memory intensive processes.":
"prefix":"wp_raise_memory_limit"
"body":"wp_raise_memory_limit( ${1:\\$context = 'admin'} )"
"Generates a random number":
"prefix":"wp_rand"
"body":"wp_rand( ${1:\\$min}${2:, \\$max} )"
"Retrieve metadata from a audio file's ID3 tags":
"prefix":"wp_read_audio_metadata"
"body":"wp_read_audio_metadata( ${1:\\$file} )"
"Get extended image metadata, exif or iptc as available.":
"prefix":"wp_read_image_metadata"
"body":"wp_read_image_metadata( ${1:\\$file} )"
"Retrieve metadata from a video file's ID3 tags":
"prefix":"wp_read_video_metadata"
"body":"wp_read_video_metadata( ${1:\\$file} )"
"Redirects to another page.":
"prefix":"wp_redirect"
"body":"wp_redirect( ${1:\\$location}${2:, \\$status = 302} )"
"Redirects a variety of shorthand URLs to the admin.":
"prefix":"wp_redirect_admin_locations"
"body":"wp_redirect_admin_locations()"
"Retrieve or display referer hidden field for forms.":
"prefix":"wp_referer_field"
"body":"wp_referer_field( ${1:\\$echo = true} )"
"Check lock status on the New/Edit Post screen and refresh the lock":
"prefix":"wp_refresh_post_lock"
"body":"wp_refresh_post_lock( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Check nonce expiration on the New/Edit Post screen and refresh if needed":
"prefix":"wp_refresh_post_nonces"
"body":"wp_refresh_post_nonces( ${1:\\$response}${2:, \\$data}${3:, \\$screen_id} )"
"Display the Registration or Admin link.":
"prefix":"wp_register"
"body":"wp_register( ${1:\\$before = '<li>'}${2:, \\$after = '</li>'}${3:, \\$echo = true} )"
"Register a plugin's real path.":
"prefix":"wp_register_plugin_realpath"
"body":"wp_register_plugin_realpath( ${1:\\$file} )"
"Register a new script.":
"prefix":"wp_register_script"
"body":"wp_register_script( ${1:\\$handle}${2:, \\$src}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$in_footer = false} )"
"Register an instance of a widget.":
"prefix":"wp_register_sidebar_widget"
"body":"wp_register_sidebar_widget( ${1:\\$id}${2:, \\$name}${3:, \\$output_callback}${4:, \\$options = array()} )"
"Register a CSS stylesheet.":
"prefix":"wp_register_style"
"body":"wp_register_style( ${1:\\$handle}${2:, \\$src}${3:, \\$deps = array()}${4:, \\$ver = false}${5:, \\$media = 'all'} )"
"Registers widget control callback for customizing options. wp_register_widget_control":
"prefix":"wp_register_widget_control"
"body":"wp_register_widget_control( ${1:\\$id}${2:, \\$name}${3:, \\$control_callback}${4:, \\$options = array()} )"
"Returns the URL that allows the user to register on the site.":
"prefix":"wp_registration_url"
"body":"wp_registration_url()"
"Adds rel nofollow string to all HTML A elements in content.":
"prefix":"wp_rel_nofollow"
"body":"wp_rel_nofollow( ${1:\\$text} )"
"Callback to add rel=nofollow string to HTML A element.":
"prefix":"wp_rel_nofollow_callback"
"body":"wp_rel_nofollow_callback( ${1:\\$matches} )"
"HTTP request for URI to retrieve content.":
"prefix":"wp_remote_fopen"
"body":"wp_remote_fopen( ${1:\\$uri} )"
"Retrieve the raw response from the HTTP request using the GET method.":
"prefix":"wp_remote_get"
"body":"wp_remote_get( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request using the HEAD method.":
"prefix":"wp_remote_head"
"body":"wp_remote_head( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request using the POST method.":
"prefix":"wp_remote_post"
"body":"wp_remote_post( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from the HTTP request.":
"prefix":"wp_remote_request"
"body":"wp_remote_request( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve only the body from the raw response.":
"prefix":"wp_remote_retrieve_body"
"body":"wp_remote_retrieve_body( ${1:\\$response} )"
"Retrieve a single cookie by name from the raw response.":
"prefix":"wp_remote_retrieve_cookie"
"body":"wp_remote_retrieve_cookie( ${1:\\$response}${2:, \\$name} )"
"Retrieve a single cookie's value by name from the raw response.":
"prefix":"wp_remote_retrieve_cookie_value"
"body":"wp_remote_retrieve_cookie_value( ${1:\\$response}${2:, \\$name} )"
"Retrieve only the cookies from the raw response.":
"prefix":"wp_remote_retrieve_cookies"
"body":"wp_remote_retrieve_cookies( ${1:\\$response} )"
"Retrieve a single header by name from the raw response.":
"prefix":"wp_remote_retrieve_header"
"body":"wp_remote_retrieve_header( ${1:\\$response}${2:, \\$header} )"
"Retrieve only the headers from the raw response.":
"prefix":"wp_remote_retrieve_headers"
"body":"wp_remote_retrieve_headers( ${1:\\$response} )"
"Retrieve only the response code from the raw response.":
"prefix":"wp_remote_retrieve_response_code"
"body":"wp_remote_retrieve_response_code( ${1:\\$response} )"
"Retrieve only the response message from the raw response.":
"prefix":"wp_remote_retrieve_response_message"
"body":"wp_remote_retrieve_response_message( ${1:\\$response} )"
"Returns an array of single-use query variable names that can be removed from a URL.":
"prefix":"wp_removable_query_args"
"body":"wp_removable_query_args()"
"Remove term(s) associated with a given object.":
"prefix":"wp_remove_object_terms"
"body":"wp_remove_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy} )"
"Replace characters or phrases within HTML elements only.":
"prefix":"wp_replace_in_html_tags"
"body":"wp_replace_in_html_tags( ${1:\\$haystack}${2:, \\$replace_pairs} )"
"Reschedule a recurring event.":
"prefix":"wp_reschedule_event"
"body":"wp_reschedule_event( ${1:\\$timestamp}${2:, \\$recurrence}${3:, \\$hook}${4:, \\$args = array()} )"
"After looping through a separate query, this function restores
the $post global to the current post in the main query.":
"prefix":"wp_reset_postdata"
"body":"wp_reset_postdata()"
"Destroys the previous query and sets up a new query.":
"prefix":"wp_reset_query"
"body":"wp_reset_query()"
"Resets global variables based on $_GET and $_POST":
"prefix":"wp_reset_vars"
"body":"wp_reset_vars( ${1:\\$vars} )"
"Resolve numeric slugs that collide with date permalinks.":
"prefix":"wp_resolve_numeric_slug_conflicts"
"body":"wp_resolve_numeric_slug_conflicts( ${1:\\$query_vars = array()} )"
"Prints resource hints to browsers for pre-fetching, pre-rendering
and pre-connecting to web sites.":
"prefix":"wp_resource_hints"
"body":"wp_resource_hints()"
"Restores the metadata for a given attachment.":
"prefix":"wp_restore_image"
"body":"wp_restore_image( ${1:\\$post_id} )"
"Restores a post to the specified revision.":
"prefix":"wp_restore_post_revision"
"body":"wp_restore_post_revision( ${1:\\$revision_id}${2:, \\$fields = null} )"
"Determine if revisions are enabled for a given post.":
"prefix":"wp_revisions_enabled"
"body":"wp_revisions_enabled( ${1:\\$post} )"
"Determine how many revisions to retain for a given post.":
"prefix":"wp_revisions_to_keep"
"body":"wp_revisions_to_keep( ${1:\\$post} )"
"Remove all capabilities from user.":
"prefix":"wp_revoke_user"
"body":"wp_revoke_user( ${1:\\$id} )"
"Formats text for the rich text editor.":
"prefix":"wp_richedit_pre"
"body":"wp_richedit_pre( ${1:\\$text} )"
"Retrieves the global WP_Roles instance and instantiates it if necessary.":
"prefix":"wp_roles"
"body":"wp_roles()"
"Display all RSS items in a HTML ordered list.":
"prefix":"wp_rss"
"body":"wp_rss( ${1:\\$url}${2:, \\$num_items = -1} )"
"Performs a safe (local) redirect, using wp_redirect().":
"prefix":"wp_safe_redirect"
"body":"wp_safe_redirect( ${1:\\$location}${2:, \\$status = 302} )"
"Retrieve the raw response from a safe HTTP request using the GET method.":
"prefix":"wp_safe_remote_get"
"body":"wp_safe_remote_get( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request using the HEAD method.":
"prefix":"wp_safe_remote_head"
"body":"wp_safe_remote_head( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request using the POST method.":
"prefix":"wp_safe_remote_post"
"body":"wp_safe_remote_post( ${1:\\$url}${2:, \\$args = array()} )"
"Retrieve the raw response from a safe HTTP request.":
"prefix":"wp_safe_remote_request"
"body":"wp_safe_remote_request( ${1:\\$url}${2:, \\$args = array()} )"
"Get salt to add to hashes.":
"prefix":"wp_salt"
"body":"wp_salt( ${1:\\$scheme = 'auth'} )"
"Sanitizes a URL for use in a redirect.":
"prefix":"wp_sanitize_redirect"
"body":"wp_sanitize_redirect( ${1:\\$location} )"
"Saves image to post along with enqueued changes
in $_REQUEST['history']":
"prefix":"wp_save_image"
"body":"wp_save_image( ${1:\\$post_id} )"
"Saves Image to File":
"prefix":"wp_save_image_file"
"body":"wp_save_image_file( ${1:\\$filename}${2:, \\$image}${3:, \\$mime_type}${4:, \\$post_id} )"
"Save posted nav menu item data.":
"prefix":"wp_save_nav_menu_items"
"body":"wp_save_nav_menu_items( ${1:\\$menu_id}${2:, \\$menu_data = array()} )"
"Creates a revision for the current version of a post.":
"prefix":"wp_save_post_revision"
"body":"wp_save_post_revision( ${1:\\$post_id} )"
"Schedule a recurring event.":
"prefix":"wp_schedule_event"
"body":"wp_schedule_event( ${1:\\$timestamp}${2:, \\$recurrence}${3:, \\$hook}${4:, \\$args = array()} )"
"Schedules an event to run only once.":
"prefix":"wp_schedule_single_event"
"body":"wp_schedule_single_event( ${1:\\$timestamp}${2:, \\$hook}${3:, \\$args = array()} )"
"Schedule core, theme, and plugin update checks.":
"prefix":"wp_schedule_update_checks"
"body":"wp_schedule_update_checks()"
"Schedule update of the network-wide counts for the current network.":
"prefix":"wp_schedule_update_network_counts"
"body":"wp_schedule_update_network_counts()"
"Permanently delete comments or posts of any type that have held a status
of 'trash' for the number of days defined in EMPTY_TRASH_DAYS.":
"prefix":"wp_scheduled_delete"
"body":"wp_scheduled_delete()"
"Add metadata to a script.":
"prefix":"wp_script_add_data"
"body":"wp_script_add_data( ${1:\\$handle}${2:, \\$key}${3:, \\$value} )"
"Check whether a script has been added to the queue.":
"prefix":"wp_script_is"
"body":"wp_script_is( ${1:\\$handle}${2:, \\$list = 'enqueued'} )"
"Initialize $wp_scripts if it has not been set.":
"prefix":"wp_scripts"
"body":"wp_scripts()"
"Send a JSON response back to an Ajax request.":
"prefix":"wp_send_json"
"body":"wp_send_json( ${1:\\$response}${2:, \\$status_code = null} )"
"Send a JSON response back to an Ajax request, indicating failure.":
"prefix":"wp_send_json_error"
"body":"wp_send_json_error( ${1:\\$data = null}${2:, \\$status_code = null} )"
"Send a JSON response back to an Ajax request, indicating success.":
"prefix":"wp_send_json_success"
"body":"wp_send_json_success( ${1:\\$data = null}${2:, \\$status_code = null} )"
"Initiates email notifications related to the creation of new users.":
"prefix":"wp_send_new_user_notifications"
"body":"wp_send_new_user_notifications( ${1:\\$user_id}${2:, \\$notify = 'both'} )"
"Private. Set all user interface settings.":
"prefix":"wp_set_all_user_settings"
"body":"wp_set_all_user_settings( ${1:\\$user_settings} )"
"Log in a user by setting authentication cookies.":
"prefix":"wp_set_auth_cookie"
"body":"wp_set_auth_cookie( ${1:\\$user_id}${2:, \\$remember = false}${3:, \\$secure = ''}${4:, \\$token = ''} )"
"Sets the cookies used to store an unauthenticated commentator's identity. Typically used
to recall previous comments by this commentator that are still held in moderation.":
"prefix":"wp_set_comment_cookies"
"body":"wp_set_comment_cookies( ${1:\\$comment}${2:, \\$user} )"
"Sets the status of a comment.":
"prefix":"wp_set_comment_status"
"body":"wp_set_comment_status( ${1:\\$comment_id}${2:, \\$comment_status}${3:, \\$wp_error = false} )"
"Changes the current user by ID or name. wp_set_current_user":
"prefix":"wp_set_current_user"
"body":"wp_set_current_user( ${1:\\$id}${2:, \\$name = ''} )"
"Set internal encoding.":
"prefix":"wp_set_internal_encoding"
"body":"wp_set_internal_encoding()"
"Set the location of the language directory.":
"prefix":"wp_set_lang_dir"
"body":"wp_set_lang_dir()"
"Update link with the specified link categories.":
"prefix":"wp_set_link_cats"
"body":"wp_set_link_cats( ${1:\\$link_id}${2:, \\$link_categories = array()} )"
"Create Term and Taxonomy Relationships.":
"prefix":"wp_set_object_terms"
"body":"wp_set_object_terms( ${1:\\$object_id}${2:, \\$terms}${3:, \\$taxonomy}${4:, \\$append = false} )"
"Updates the user's password with a new encrypted one.":
"prefix":"wp_set_password"
"body":"wp_set_password( ${1:\\$password}${2:, \\$user_id} )"
"Set categories for a post.":
"prefix":"wp_set_post_categories"
"body":"wp_set_post_categories( ${1:\\$post_ID}${2:, \\$post_categories = array()}${3:, \\$append = false} )"
"Sets the categories that the post id belongs to.":
"prefix":"wp_set_post_cats"
"body":"wp_set_post_cats( ${1:\\$blogid = '1'}${2:, \\$post_ID}${3:, \\$post_categories = array()} )"
"Mark the post as currently being edited by the current user":
"prefix":"wp_set_post_lock"
"body":"wp_set_post_lock( ${1:\\$post_id} )"
"Set the tags for a post.":
"prefix":"wp_set_post_tags"
"body":"wp_set_post_tags( ${1:\\$post_id}${2:, \\$tags = ''}${3:, \\$append = false} )"
"Set the terms for a post.":
"prefix":"wp_set_post_terms"
"body":"wp_set_post_terms( ${1:\\$post_id}${2:, \\$tags = ''}${3:, \\$taxonomy = 'post_tag'}${4:, \\$append = false} )"
"Set the sidebar widget option to update sidebars.":
"prefix":"wp_set_sidebars_widgets"
"body":"wp_set_sidebars_widgets( ${1:\\$sidebars_widgets} )"
"Set the database table prefix and the format specifiers for database
table columns.":
"prefix":"wp_set_wpdb_vars"
"body":"wp_set_wpdb_vars()"
"Sets a cookie for a user who just logged in. This function is deprecated.":
"prefix":"wp_setcookie"
"body":"wp_setcookie( ${1:\\$username}${2:, \\$password = ''}${3:, \\$already_md5 = false}${4:, \\$home = ''}${5:, \\$siteurl = ''}${6:, \\$remember = false} )"
"Decorates a menu item object with the shared navigation menu item properties.":
"prefix":"wp_setup_nav_menu_item"
"body":"wp_setup_nav_menu_item( ${1:\\$menu_item} )"
"wp_shake_js":
"prefix":"wp_shake_js"
"body":"wp_shake_js()"
"Sends a Link: rel=shortlink header if a shortlink is defined for the current page.":
"prefix":"wp_shortlink_header"
"body":"wp_shortlink_header()"
"Injects rel=shortlink into the head if a shortlink is defined for the current page.":
"prefix":"wp_shortlink_wp_head"
"body":"wp_shortlink_wp_head()"
"Determine if global tables should be upgraded.":
"prefix":"wp_should_upgrade_global_tables"
"body":"wp_should_upgrade_global_tables()"
"Calculates the new dimensions for a downsampled image.":
"prefix":"wp_shrink_dimensions"
"body":"wp_shrink_dimensions( ${1:\\$width}${2:, \\$height}${3:, \\$wmax = 128}${4:, \\$hmax = 96} )"
"Retrieve description for a sidebar.":
"prefix":"wp_sidebar_description"
"body":"wp_sidebar_description( ${1:\\$id} )"
"Authenticates and logs a user in with 'remember' capability.":
"prefix":"wp_signon"
"body":"wp_signon( ${1:\\$credentials = array()}${2:, \\$secure_cookie = ''} )"
"WordPress autoloader for SimplePie.":
"prefix":"wp_simplepie_autoload"
"body":"wp_simplepie_autoload()"
"Display site icon meta tags.":
"prefix":"wp_site_icon"
"body":"wp_site_icon()"
"Add slashes to a string or array of strings.":
"prefix":"wp_slash"
"body":"wp_slash( ${1:\\$value} )"
"Returns the regexp for common whitespace characters.":
"prefix":"wp_spaces_regexp"
"body":"wp_spaces_regexp()"
"Marks a comment as Spam":
"prefix":"wp_spam_comment"
"body":"wp_spam_comment( ${1:\\$comment_id} )"
"Legacy escaping for HTML blocks.":
"prefix":"wp_specialchars"
"body":"wp_specialchars( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES}${3:, \\$charset = false}${4:, \\$double_encode = false} )"
"Converts a number of HTML entities into their special characters.":
"prefix":"wp_specialchars_decode"
"body":"wp_specialchars_decode( ${1:\\$string}${2:, \\$quote_style = ENT_NOQUOTES} )"
"WordPress implementation of PHP sprintf() with filters.":
"prefix":"wp_sprintf"
"body":"wp_sprintf( ${1:\\$pattern}${2:, \\$args} )"
"Localize list items before the rest of the content.":
"prefix":"wp_sprintf_l"
"body":"wp_sprintf_l( ${1:\\$pattern}${2:, \\$args} )"
"Defines cookie related WordPress constants wp_ssl_constants":
"prefix":"wp_ssl_constants"
"body":"wp_ssl_constants()"
"Output a HTML element with a star rating for a given rating.":
"prefix":"wp_star_rating"
"body":"wp_star_rating( ${1:\\$args = array()} )"
"Start the WordPress object cache.":
"prefix":"wp_start_object_cache"
"body":"wp_start_object_cache()"
"Convert emoji to a static img element.":
"prefix":"wp_staticize_emoji"
"body":"wp_staticize_emoji( ${1:\\$text} )"
"Convert emoji in emails into static images.":
"prefix":"wp_staticize_emoji_for_email"
"body":"wp_staticize_emoji_for_email( ${1:\\$mail} )"
"Streams image in WP_Image_Editor to browser.":
"prefix":"wp_stream_image"
"body":"wp_stream_image( ${1:\\$image}${2:, \\$mime_type}${3:, \\$post_id} )"
"Properly strip all HTML tags including script and style":
"prefix":"wp_strip_all_tags"
"body":"wp_strip_all_tags( ${1:\\$string}${2:, \\$remove_breaks = false} )"
"Add metadata to a CSS stylesheet.":
"prefix":"wp_style_add_data"
"body":"wp_style_add_data( ${1:\\$handle}${2:, \\$key}${3:, \\$value} )"
"Check whether a CSS stylesheet has been added to the queue.":
"prefix":"wp_style_is"
"body":"wp_style_is( ${1:\\$handle}${2:, \\$list = 'enqueued'} )"
"Administration Screen CSS for changing the styles.":
"prefix":"wp_style_loader_src"
"body":"wp_style_loader_src( ${1:\\$src}${2:, \\$handle} )"
"Initialize $wp_styles if it has not been set.":
"prefix":"wp_styles"
"body":"wp_styles()"
"Temporarily suspend cache additions.":
"prefix":"wp_suspend_cache_addition"
"body":"wp_suspend_cache_addition( ${1:\\$suspend = null} )"
"Suspend cache invalidation.":
"prefix":"wp_suspend_cache_invalidation"
"body":"wp_suspend_cache_invalidation( ${1:\\$suspend = true} )"
"Display tag cloud.":
"prefix":"wp_tag_cloud"
"body":"wp_tag_cloud( ${1:\\$args = ''} )"
"Defines templating related WordPress constants":
"prefix":"wp_templating_constants"
"body":"wp_templating_constants()"
"Returns a filename of a Temporary unique file.":
"prefix":"wp_tempnam"
"body":"wp_tempnam( ${1:\\$filename = ''}${2:, \\$dir = ''} )"
"Determine whether a term is shared between multiple taxonomies.":
"prefix":"wp_term_is_shared"
"body":"wp_term_is_shared( ${1:\\$term_id} )"
"Output an unordered list of checkbox input elements labelled with term names.":
"prefix":"wp_terms_checklist"
"body":"wp_terms_checklist( ${1:\\$post_id}${2:, \\$args = array()} )"
"Displays a human readable HTML representation of the difference between two strings.":
"prefix":"wp_text_diff"
"body":"wp_text_diff( ${1:\\$left_string}${2:, \\$right_string}${3:, \\$args = null} )"
"Displays update information for a theme.":
"prefix":"wp_theme_update_row"
"body":"wp_theme_update_row( ${1:\\$theme_key}${2:, \\$theme} )"
"wp_theme_update_rows":
"prefix":"wp_theme_update_rows"
"body":"wp_theme_update_rows()"
"Whether a comment should be blocked because of comment flood.":
"prefix":"wp_throttle_comment_flood"
"body":"wp_throttle_comment_flood( ${1:\\$block}${2:, \\$time_lastcomment}${3:, \\$time_newcomment} )"
"Gives a nicely-formatted list of timezone strings.":
"prefix":"wp_timezone_choice"
"body":"wp_timezone_choice( ${1:\\$selected_zone}${2:, \\$locale = null} )"
"gmt_offset modification for smart timezone handling.":
"prefix":"wp_timezone_override_offset"
"body":"wp_timezone_override_offset()"
"Check for PHP timezone support":
"prefix":"wp_timezone_supported"
"body":"wp_timezone_supported()"
"Outputs the TinyMCE editor.":
"prefix":"wp_tiny_mce"
"body":"wp_tiny_mce()"
"Display or retrieve page title for all areas of blog.":
"prefix":"wp_title"
"body":"wp_title( ${1:\\$sep = '»'}${2:, \\$display = true}${3:, \\$seplocation = ''} )"
"Display the blog title for display of the feed title.":
"prefix":"wp_title_rss"
"body":"wp_title_rss( ${1:\\$deprecated = '–'} )"
"Call hooks for when a comment status transition occurs.":
"prefix":"wp_transition_comment_status"
"body":"wp_transition_comment_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$comment} )"
"Fires actions related to the transitioning of a post's status.":
"prefix":"wp_transition_post_status"
"body":"wp_transition_post_status( ${1:\\$new_status}${2:, \\$old_status}${3:, \\$post} )"
"Moves a comment to the Trash":
"prefix":"wp_trash_comment"
"body":"wp_trash_comment( ${1:\\$comment_id} )"
"Move a post or page to the Trash":
"prefix":"wp_trash_post"
"body":"wp_trash_post( ${1:\\$post_id} )"
"Moves comments for a post to the trash.":
"prefix":"wp_trash_post_comments"
"body":"wp_trash_post_comments( ${1:\\$post = null} )"
"Generates an excerpt from the content, if needed.":
"prefix":"wp_trim_excerpt"
"body":"wp_trim_excerpt( ${1:\\$text = ''} )"
"Trims text to a certain number of words.":
"prefix":"wp_trim_words"
"body":"wp_trim_words( ${1:\\$text}${2:, \\$num_words = 55}${3:, \\$more = null} )"
"Output the markup for a audio tag to be used in an Underscore template
when data.model is passed.":
"prefix":"wp_underscore_audio_template"
"body":"wp_underscore_audio_template()"
"Outputs the templates used by playlists.":
"prefix":"wp_underscore_playlist_templates"
"body":"wp_underscore_playlist_templates()"
"Output the markup for a video tag to be used in an Underscore template
when data.model is passed.":
"prefix":"wp_underscore_video_template"
"body":"wp_underscore_video_template()"
"Get a filename that is sanitized and unique for the given directory.":
"prefix":"wp_unique_filename"
"body":"wp_unique_filename( ${1:\\$dir}${2:, \\$filename}${3:, \\$unique_filename_callback = null} )"
"Computes a unique slug for the post, when given the desired slug and some post details.":
"prefix":"wp_unique_post_slug"
"body":"wp_unique_post_slug( ${1:\\$slug}${2:, \\$post_ID}${3:, \\$post_status}${4:, \\$post_type}${5:, \\$post_parent} )"
"Will make slug unique, if it isn't already.":
"prefix":"wp_unique_term_slug"
"body":"wp_unique_term_slug( ${1:\\$slug}${2:, \\$term} )"
"Turn register globals off.":
"prefix":"wp_unregister_globals"
"body":"wp_unregister_globals()"
"Remove widget from sidebar.":
"prefix":"wp_unregister_sidebar_widget"
"body":"wp_unregister_sidebar_widget( ${1:\\$id} )"
"Remove control callback for widget.":
"prefix":"wp_unregister_widget_control"
"body":"wp_unregister_widget_control( ${1:\\$id} )"
"Unschedule a previously scheduled event.":
"prefix":"wp_unschedule_event"
"body":"wp_unschedule_event( ${1:\\$timestamp}${2:, \\$hook}${3:, \\$args = array()} )"
"Unschedules all events attached to the hook.":
"prefix":"wp_unschedule_hook"
"body":"wp_unschedule_hook( ${1:\\$hook} )"
"Remove slashes from a string or array of strings.":
"prefix":"wp_unslash"
"body":"wp_unslash( ${1:\\$value} )"
"Removes a comment from the Spam":
"prefix":"wp_unspam_comment"
"body":"wp_unspam_comment( ${1:\\$comment_id} )"
"Removes a comment from the Trash":
"prefix":"wp_untrash_comment"
"body":"wp_untrash_comment( ${1:\\$comment_id} )"
"Restore a post or page from the Trash.":
"prefix":"wp_untrash_post"
"body":"wp_untrash_post( ${1:\\$post_id} )"
"Restore comments for a post from the trash.":
"prefix":"wp_untrash_post_comments"
"body":"wp_untrash_post_comments( ${1:\\$post = null} )"
"Update metadata for an attachment.":
"prefix":"wp_update_attachment_metadata"
"body":"wp_update_attachment_metadata( ${1:\\$post_id}${2:, \\$data} )"
"Aliases wp_insert_category() with minimal args.":
"prefix":"wp_update_category"
"body":"wp_update_category( ${1:\\$catarr} )"
"Updates an existing comment in the database.":
"prefix":"wp_update_comment"
"body":"wp_update_comment( ${1:\\$commentarr} )"
"Updates the comment count for post(s).":
"prefix":"wp_update_comment_count"
"body":"wp_update_comment_count( ${1:\\$post_id}${2:, \\$do_deferred = false} )"
"Updates the comment count for the post.":
"prefix":"wp_update_comment_count_now"
"body":"wp_update_comment_count_now( ${1:\\$post_id} )"
"This was once used to kick-off the Core Updater.":
"prefix":"wp_update_core"
"body":"wp_update_core()"
"Update the `custom_css` post for a given theme.":
"prefix":"wp_update_custom_css_post"
"body":"wp_update_custom_css_post( ${1:\\$css}${2:, \\$args = array()} )"
"Updates a link in the database.":
"prefix":"wp_update_link"
"body":"wp_update_link( ${1:\\$linkdata} )"
"Save the properties of a menu item or create a new one.":
"prefix":"wp_update_nav_menu_item"
"body":"wp_update_nav_menu_item( ${1:\\$menu_id}${2:, \\$menu_item_db_id}${3:, \\$menu_item_data = array()} )"
"Save the properties of a menu or create a new menu with those properties.":
"prefix":"wp_update_nav_menu_object"
"body":"wp_update_nav_menu_object( ${1:\\$menu_id}${2:, \\$menu_data = array()} )"
"Update the network-wide counts for the current network.":
"prefix":"wp_update_network_counts"
"body":"wp_update_network_counts( ${1:\\$network_id = null} )"
"Update the network-wide site count.":
"prefix":"wp_update_network_site_counts"
"body":"wp_update_network_site_counts( ${1:\\$network_id = null} )"
"Update the network-wide user count.":
"prefix":"wp_update_network_user_counts"
"body":"wp_update_network_user_counts( ${1:\\$network_id = null} )"
"This was once used to kick-off the Plugin Updater.":
"prefix":"wp_update_plugin"
"body":"wp_update_plugin()"
"Check plugin versions against the latest versions hosted on WordPress.org.":
"prefix":"wp_update_plugins"
"body":"wp_update_plugins( ${1:\\$extra_stats = array()} )"
"Update a post with new post data.":
"prefix":"wp_update_post"
"body":"wp_update_post( ${1:\\$postarr = array()}${2:, \\$wp_error = false} )"
"Update term based on arguments provided.":
"prefix":"wp_update_term"
"body":"wp_update_term( ${1:\\$term_id}${2:, \\$taxonomy}${3:, \\$args = array()} )"
"Updates the amount of terms in taxonomy.":
"prefix":"wp_update_term_count"
"body":"wp_update_term_count( ${1:\\$terms}${2:, \\$taxonomy}${3:, \\$do_deferred = false} )"
"Perform term count update immediately.":
"prefix":"wp_update_term_count_now"
"body":"wp_update_term_count_now( ${1:\\$terms}${2:, \\$taxonomy} )"
"This was once used to kick-off the Theme Updater.":
"prefix":"wp_update_theme"
"body":"wp_update_theme()"
"Check theme versions against the latest versions hosted on WordPress.org.":
"prefix":"wp_update_themes"
"body":"wp_update_themes( ${1:\\$extra_stats = array()} )"
"Update a user in the database.":
"prefix":"wp_update_user"
"body":"wp_update_user( ${1:\\$userdata} )"
"Runs WordPress Upgrade functions.":
"prefix":"wp_upgrade"
"body":"wp_upgrade()"
"Create a file in the upload folder with given content.":
"prefix":"wp_upload_bits"
"body":"wp_upload_bits( ${1:\\$name}${2:, \\$deprecated}${3:, \\$bits}${4:, \\$time = null} )"
"Get an array containing the current upload directory's path and url.":
"prefix":"wp_upload_dir"
"body":"wp_upload_dir( ${1:\\$time = null}${2:, \\$create_dir = true}${3:, \\$refresh_cache = false} )"
"Saves and restores user interface settings stored in a cookie.":
"prefix":"wp_user_settings"
"body":"wp_user_settings()"
"Toggle `$_wp_using_ext_object_cache` on and off without directly
touching global.":
"prefix":"wp_using_ext_object_cache"
"body":"wp_using_ext_object_cache( ${1:\\$using = null} )"
"Validates authentication cookie.":
"prefix":"wp_validate_auth_cookie"
"body":"wp_validate_auth_cookie( ${1:\\$cookie = ''}${2:, \\$scheme = ''} )"
"Filter/validate a variable as a boolean.":
"prefix":"wp_validate_boolean"
"body":"wp_validate_boolean( ${1:\\$var} )"
"Validates the logged-in cookie.":
"prefix":"wp_validate_logged_in_cookie"
"body":"wp_validate_logged_in_cookie( ${1:\\$user_id} )"
"Validates a URL for use in a redirect.":
"prefix":"wp_validate_redirect"
"body":"wp_validate_redirect( ${1:\\$location}${2:, \\$default = ''} )"
"Verify that correct nonce was used with time limit.":
"prefix":"wp_verify_nonce"
"body":"wp_verify_nonce( ${1:\\$nonce}${2:, \\$action = -1} )"
"Check WordPress version against the newest version.":
"prefix":"wp_version_check"
"body":"wp_version_check( ${1:\\$extra_stats = array()}${2:, \\$force_check = false} )"
"Builds the Video shortcode output.":
"prefix":"wp_video_shortcode"
"body":"wp_video_shortcode( ${1:\\$attr}${2:, \\$content = ''} )"
"Displays a welcome panel to introduce users to WordPress.":
"prefix":"wp_welcome_panel"
"body":"wp_welcome_panel()"
"Meta widget used to display the control form for a widget.":
"prefix":"wp_widget_control"
"body":"wp_widget_control( ${1:\\$sidebar_args} )"
"Retrieve description for widget.":
"prefix":"wp_widget_description"
"body":"wp_widget_description( ${1:\\$id} )"
"Display RSS widget options form.":
"prefix":"wp_widget_rss_form"
"body":"wp_widget_rss_form( ${1:\\$args}${2:, \\$inputs = null} )"
"Display the RSS entries in a list.":
"prefix":"wp_widget_rss_output"
"body":"wp_widget_rss_output( ${1:\\$rss}${2:, \\$args = array()} )"
"Process RSS feed widget data and optionally retrieve feed items.":
"prefix":"wp_widget_rss_process"
"body":"wp_widget_rss_process( ${1:\\$widget_rss}${2:, \\$check_feed = true} )"
"wp_widgets_access_body_class":
"prefix":"wp_widgets_access_body_class"
"body":"wp_widgets_access_body_class( ${1:\\$classes} )"
"Append the Widgets menu to the themes main menu.":
"prefix":"wp_widgets_add_menu"
"body":"wp_widgets_add_menu()"
"Registers all of the default WordPress widgets on startup.":
"prefix":"wp_widgets_init"
"body":"wp_widgets_init()"
"Creates a new post from the "Write Post" form using $_POST information.":
"prefix":"wp_write_post"
"body":"wp_write_post()"
"Replaces double line-breaks with paragraph elements.":
"prefix":"wpautop"
"body":"wpautop( ${1:\\$pee}${2:, \\$br = true} )"
"Activate a signup.":
"prefix":"wpmu_activate_signup"
"body":"wpmu_activate_signup( ${1:\\$key} )"
"Loads styles specific to this page.":
"prefix":"wpmu_activate_stylesheet"
"body":"wpmu_activate_stylesheet()"
"Redirect a user based on $_GET or $_POST arguments.":
"prefix":"wpmu_admin_do_redirect"
"body":"wpmu_admin_do_redirect( ${1:\\$url = ''} )"
"Adds an 'updated=true' argument to a URL.":
"prefix":"wpmu_admin_redirect_add_updated_param"
"body":"wpmu_admin_redirect_add_updated_param( ${1:\\$url = ''} )"
"Determines if the available space defined by the admin has been exceeded by the user.":
"prefix":"wpmu_checkavailablespace"
"body":"wpmu_checkavailablespace()"
"Create a site.":
"prefix":"wpmu_create_blog"
"body":"wpmu_create_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user_id}${5:, \\$meta = array()}${6:, \\$site_id = 1} )"
"Create a user.":
"prefix":"wpmu_create_user"
"body":"wpmu_create_user( ${1:\\$user_name}${2:, \\$password}${3:, \\$email} )"
"This deprecated function managed much of the site and network loading in multisite.":
"prefix":"wpmu_current_site"
"body":"wpmu_current_site()"
"Delete a site.":
"prefix":"wpmu_delete_blog"
"body":"wpmu_delete_blog( ${1:\\$blog_id}${2:, \\$drop = false} )"
"Delete a user from the network and remove from all sites.":
"prefix":"wpmu_delete_user"
"body":"wpmu_delete_user( ${1:\\$id} )"
"Deprecated functionality for getting themes allowed on a specific site.":
"prefix":"wpmu_get_blog_allowedthemes"
"body":"wpmu_get_blog_allowedthemes()"
"Logs the user email, IP, and registration date of a new site.":
"prefix":"wpmu_log_new_registrations"
"body":"wpmu_log_new_registrations( ${1:\\$blog_id}${2:, \\$user_id} )"
"Outputs the WPMU menu.":
"prefix":"wpmu_menu"
"body":"wpmu_menu()"
"Record site signup information for future activation.":
"prefix":"wpmu_signup_blog"
"body":"wpmu_signup_blog( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user}${5:, \\$user_email}${6:, \\$meta = array()} )"
"Notify user of signup success. wpmu_signup_blog_notification":
"prefix":"wpmu_signup_blog_notification"
"body":"wpmu_signup_blog_notification( ${1:\\$domain}${2:, \\$path}${3:, \\$title}${4:, \\$user_login}${5:, \\$user_email}${6:, \\$key}${7:, \\$meta = array()} )"
"Prints styles for front-end Multisite signup pages":
"prefix":"wpmu_signup_stylesheet"
"body":"wpmu_signup_stylesheet()"
"Record user signup information for future activation.":
"prefix":"wpmu_signup_user"
"body":"wpmu_signup_user( ${1:\\$user}${2:, \\$user_email}${3:, \\$meta = array()} )"
"Notify user of signup success. wpmu_signup_user_notificationre":
"prefix":"wpmu_signup_user_notification"
"body":"wpmu_signup_user_notification( ${1:\\$user_login}${2:, \\$user_email}${3:, \\$key}${4:, \\$meta = array()} )"
"Update the last_updated field for the current site.":
"prefix":"wpmu_update_blogs_date"
"body":"wpmu_update_blogs_date()"
"Processes new site registrations.":
"prefix":"wpmu_validate_blog_signup"
"body":"wpmu_validate_blog_signup( ${1:\\$blogname}${2:, \\$blog_title}${3:, \\$user = ''} )"
"Sanitize and validate data required for a user sign-up.":
"prefix":"wpmu_validate_user_signup"
"body":"wpmu_validate_user_signup( ${1:\\$user_name}${2:, \\$user_email} )"
"Notify a user that their blog activation has been successful.":
"prefix":"wpmu_welcome_notification"
"body":"wpmu_welcome_notification( ${1:\\$blog_id}${2:, \\$user_id}${3:, \\$password}${4:, \\$title}${5:, \\$meta = array()} )"
"Notify a user that their account activation has been successful.":
"prefix":"wpmu_welcome_user_notification"
"body":"wpmu_welcome_user_notification( ${1:\\$user_id}${2:, \\$password}${3:, \\$meta = array()} )"
"Replaces common plain text characters into formatted entities":
"prefix":"wptexturize"
"body":"wptexturize( ${1:\\$text}${2:, \\$reset = false} )"
"Implements a logic tree to determine whether or not "7'." represents seven feet,
then converts the special char into either a prime char or a closing quote char.":
"prefix":"wptexturize_primes"
"body":"wptexturize_primes( ${1:\\$haystack}${2:, \\$needle}${3:, \\$prime}${4:, \\$open_quote}${5:, \\$close_quote} )"
"Returns the URLs for CSS files used in an iframe-sandbox'd TinyMCE media view.":
"prefix":"wpview_media_sandbox_styles"
"body":"wpview_media_sandbox_styles()"
"Calls wp_write_post() and handles the errors.":
"prefix":"write_post"
"body":"write_post()"
"Display checked checkboxes attribute for xfn microformat options.":
"prefix":"xfn_check"
"body":"xfn_check( ${1:\\$class}${2:, \\$value = ''}${3:, \\$deprecated = ''} )"
"Retrieve the post category or categories from XMLRPC XML.":
"prefix":"xmlrpc_getpostcategory"
"body":"xmlrpc_getpostcategory( ${1:\\$content} )"
"Retrieve post title from XMLRPC XML.":
"prefix":"xmlrpc_getposttitle"
"body":"xmlrpc_getposttitle( ${1:\\$content} )"
"Default filter attached to xmlrpc_pingback_error.":
"prefix":"xmlrpc_pingback_error"
"body":"xmlrpc_pingback_error( ${1:\\$ixr_error} )"
"XMLRPC XML content without title and category elements.":
"prefix":"xmlrpc_removepostdata"
"body":"xmlrpc_removepostdata( ${1:\\$content} )"
"Add leading zeros when necessary.":
"prefix":"zeroise"
"body":"zeroise( ${1:\\$number}${2:, \\$threshold} )"
|
[
{
"context": "elper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->\n ",
"end": 619,
"score": 0.9998456239700317,
"start": 615,
"tag": "NAME",
"value": "John"
},
{
"context": "ay.customer.create {firstName: 'John', lastName: 'Smith'}, ... | spec/integration/braintree/credit_card_gateway_spec.coffee | StreamCo/braintree_node | 0 | require('../../spec_helper')
_ = require('underscore')._
braintree = specHelper.braintree
util = require('util')
{CreditCard} = require('../../../lib/braintree/credit_card')
{CreditCardNumbers} = require('../../../lib/braintree/test/credit_card_numbers')
{CreditCardDefaults} = require('../../../lib/braintree/test/credit_card_defaults')
{VenmoSdk} = require('../../../lib/braintree/test/venmo_sdk')
{Config} = require('../../../lib/braintree/config')
describe "CreditCardGateway", ->
describe "create", ->
customerId = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->
customerId = response.customer.id
done()
it "works for a simple create", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.equal(response.creditCard.expirationDate, '05/2012')
assert.isTrue(response.creditCard.uniqueNumberIdentifier.length == 32)
assert.match(response.creditCard.imageUrl, /png/)
done()
it "verifies card if verifyCard is set to true", (done) ->
creditCardParams =
customerId: customerId
number: '4000111111111115'
expirationDate: '05/2012'
options:
verifyCard: "true"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
done()
it "includes the verification on the credit card with risk data", (done) ->
creditCardParams =
customerId: customerId
number: '4111111111111111'
expirationDate: '05/2020'
options:
verifyCard: "true"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.verification.riskData.decision, "Not Evaluated")
assert.equal(response.creditCard.verification.riskData.id, null)
done()
it "verifies card with custom verification amount", (done) ->
creditCardParams =
customerId: customerId
number: '4000111111111115'
expirationDate: '05/2012'
options:
verifyCard: "true"
verificationAmount: "1.03"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
done()
it "accepts a billing address", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
billingAddress:
streetAddress: '123 Fake St'
locality: 'Chicago'
region: 'IL'
postalCode: '60607'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.equal(response.creditCard.expirationDate, '05/2012')
assert.equal(response.creditCard.billingAddress.streetAddress, '123 Fake St')
assert.equal(response.creditCard.billingAddress.locality, 'Chicago')
assert.equal(response.creditCard.billingAddress.region, 'IL')
assert.equal(response.creditCard.billingAddress.postalCode, '60607')
done()
it "handles errors", (done) ->
creditCardParams =
customerId: customerId
number: 'invalid'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.message, 'Credit card number must be 12-19 digits.')
assert.equal(
response.errors.for('creditCard').on('number')[0].code,
'81716'
)
assert.equal(
response.errors.for('creditCard').on('number')[0].attribute,
'number'
)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '81716')
done()
it "accepts a venmo sdk payment method code", (done) ->
creditCardParams =
customerId: customerId
venmoSdkPaymentMethodCode: VenmoSdk.VisaPaymentMethodCode
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.isTrue(response.creditCard.venmoSdk)
done()
it "rejects a bad venmo sdk payment method code", (done) ->
creditCardParams =
customerId: customerId
venmoSdkPaymentMethodCode: VenmoSdk.InvalidPaymentMethodCode
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '91727')
assert.equal(response.message, "Invalid VenmoSDK payment method code")
done()
it "venmo sdk is true for card created with a venmo sdk session", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
options:
venmoSdkSession: VenmoSdk.Session
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.isTrue(response.creditCard.venmoSdk)
done()
it "venmo sdk is false for card created with an invalid venmo sdk session", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
options:
venmoSdkSession: VenmoSdk.InvalidSession
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.isFalse(response.creditCard.venmoSdk)
done()
it "accepts a payment method nonce", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate({}, (err, result) ->
assert.isTrue(result.success)
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
share: true,
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post("/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '411111******1111')
done()
)
)
context "card type indicators", ->
it "handles prepaid cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Prepaid
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.prepaid, CreditCard.Prepaid.Yes)
done()
it "handles commercial cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Commercial
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.commercial, CreditCard.Commercial.Yes)
done()
it "handles payroll cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Payroll
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.payroll, CreditCard.Payroll.Yes)
done()
it "handles healthcare cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Healthcare
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.healthcare, CreditCard.Healthcare.Yes)
done()
it "handles durbin regulated cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.DurbinRegulated
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.durbinRegulated, CreditCard.DurbinRegulated.Yes)
done()
it "handles debit cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Debit
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.debit, CreditCard.Debit.Yes)
done()
it "sets the country of issuance", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.CountryOfIssuance
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.countryOfIssuance, CreditCardDefaults.CountryOfIssuance)
done()
it "sets the issuing bank", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.IssuingBank
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.issuingBank, CreditCardDefaults.IssuingBank)
done()
context "negative card type indicators", ->
createResponse = null
before (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.No
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
createResponse = response
done()
it 'sets the prepaid field to No', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.No)
it 'sets the payroll field to No', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.No)
assert.equal(createResponse.creditCard.payroll, CreditCard.Payroll.No)
it 'sets the debit field to No', ->
assert.equal(createResponse.creditCard.debit, CreditCard.Debit.No)
it 'sets the commercial field to No', ->
assert.equal(createResponse.creditCard.commercial, CreditCard.Commercial.No)
it 'sets the durbin regulated field to No', ->
assert.equal(createResponse.creditCard.durbinRegulated, CreditCard.DurbinRegulated.No)
it 'sets the heathcare field to No', ->
assert.equal(createResponse.creditCard.healthcare, CreditCard.Healthcare.No)
context "unknown card type indicators", ->
createResponse = null
before (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Unknown
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
createResponse = response
done()
it 'sets the prepaid field to Unknown', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.Unknown)
it 'sets the payroll field to Unknown', ->
assert.equal(createResponse.creditCard.payroll, CreditCard.Payroll.Unknown)
it 'sets the debit field to Unknown', ->
assert.equal(createResponse.creditCard.debit, CreditCard.Debit.Unknown)
it 'sets the commercial field to Unknown', ->
assert.equal(createResponse.creditCard.commercial, CreditCard.Commercial.Unknown)
it 'sets the durbin regulated field to Unknown', ->
assert.equal(createResponse.creditCard.durbinRegulated, CreditCard.DurbinRegulated.Unknown)
it 'sets the heathcare field to Unknown', ->
assert.equal(createResponse.creditCard.healthcare, CreditCard.Healthcare.Unknown)
it 'sets the country of issuance field to Unknown', ->
assert.equal(createResponse.creditCard.countryOfIssuance, CreditCard.CountryOfIssuance.Unknown)
it 'sets the issuing bank field to Unknown', ->
assert.equal(createResponse.creditCard.issuingBank, CreditCard.IssuingBank.Unknown)
describe "delete", (done) ->
customerToken = null
before (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '05/2014'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
customerToken = response.customer.creditCards[0].token
done()
it "deletes the credit card", (done) ->
specHelper.defaultGateway.creditCard.delete customerToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.creditCard.find customerToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles invalid tokens", (done) ->
specHelper.defaultGateway.creditCard.delete 'nonexistent_token', (err) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "expired", ->
it "returns expired cards", (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '01/2010'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
testCard = response.customer.creditCards[0]
specHelper.defaultGateway.creditCard.expired (err, result) ->
assert.include(result.ids, testCard.token)
done()
describe "expiringBetween", ->
it "returns card expiring between the given dates", (done) ->
customerParams =
creditCard:
number: '5105105105105100'
expirationDate: '05/2016'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
testCard = response.customer.creditCards[0]
today = new Date
before = new Date("2016-04-31")
after = new Date("2016-10-01")
specHelper.defaultGateway.creditCard.expiringBetween before, after, (err, result) ->
assert.isNull(err)
assert.include(result.ids, testCard.token)
done()
describe "find", ->
customerToken = null
before (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '05/2014'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
customerToken = response.customer.creditCards[0].token
done()
it "finds the card", (done) ->
specHelper.defaultGateway.creditCard.find customerToken, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '510510******5100')
assert.equal(creditCard.expirationDate, '05/2014')
done()
it "handles not finding the card", (done) ->
specHelper.defaultGateway.creditCard.find 'nonexistent_token', (err, creditCard) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles whitespace", (done) ->
specHelper.defaultGateway.creditCard.find ' ', (err, creditCard) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "fromNonce", ->
customerId = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'John', lastName: 'Smith'}, (err, response) ->
customerId = response.customer.id
done()
it "returns a credit card for the supplied nonce", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '411111******1111')
assert.equal(creditCard.expirationDate, '11/2099')
done()
it "returns an error if the supplied nonce points to a shared card", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
share: true,
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(creditCard)
assert.equal(err.type, "notFoundError")
assert.include(err.message, "not found")
done()
it "returns an error if the supplied nonce is consumed", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(err)
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(creditCard)
assert.equal(err.type, "notFoundError")
assert.include(err.message, "consumed")
done()
describe "update", ->
creditCardToken = null
before (done) ->
customerParams =
creditCard:
cardholderName: 'Old Cardholder Name',
number: '5105105105105100',
expirationDate: '05/2014'
billingAddress:
streetAddress: '123 Old St',
locality: 'Old City',
region: 'Old Region'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
creditCardToken = response.customer.creditCards[0].token
done()
it "updates the card", (done) ->
updateParams =
cardholderName: 'New Cardholder Name',
number: '4111111111111111',
expirationDate: '12/2015'
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.cardholderName, 'New Cardholder Name')
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.equal(response.creditCard.expirationDate, '12/2015')
done()
it "updates the billing address", (done) ->
updateParams =
cardholderName: 'New Cardholder Name'
number: '4111111111111111'
expirationDate: '12/2015'
billingAddress:
streetAddress: '123 New St'
locality: 'New City'
region: 'New Region'
options:
updateExisting: true
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.cardholderName, 'New Cardholder Name')
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.equal(response.creditCard.expirationDate, '12/2015')
billingAddress = response.creditCard.billingAddress
assert.equal(billingAddress.streetAddress, '123 New St')
assert.equal(billingAddress.locality, 'New City')
assert.equal(billingAddress.region, 'New Region')
done()
it "handles errors", (done) ->
updateParams =
number: 'invalid'
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.message, 'Credit card number must be 12-19 digits.')
assert.equal(
response.errors.for('creditCard').on('number')[0].code,
'81716'
)
assert.equal(
response.errors.for('creditCard').on('number')[0].attribute,
'number'
)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '81716')
done()
| 147690 | require('../../spec_helper')
_ = require('underscore')._
braintree = specHelper.braintree
util = require('util')
{CreditCard} = require('../../../lib/braintree/credit_card')
{CreditCardNumbers} = require('../../../lib/braintree/test/credit_card_numbers')
{CreditCardDefaults} = require('../../../lib/braintree/test/credit_card_defaults')
{VenmoSdk} = require('../../../lib/braintree/test/venmo_sdk')
{Config} = require('../../../lib/braintree/config')
describe "CreditCardGateway", ->
describe "create", ->
customerId = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: '<NAME>', lastName: '<NAME>'}, (err, response) ->
customerId = response.customer.id
done()
it "works for a simple create", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.equal(response.creditCard.expirationDate, '05/2012')
assert.isTrue(response.creditCard.uniqueNumberIdentifier.length == 32)
assert.match(response.creditCard.imageUrl, /png/)
done()
it "verifies card if verifyCard is set to true", (done) ->
creditCardParams =
customerId: customerId
number: '4000111111111115'
expirationDate: '05/2012'
options:
verifyCard: "true"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
done()
it "includes the verification on the credit card with risk data", (done) ->
creditCardParams =
customerId: customerId
number: '4111111111111111'
expirationDate: '05/2020'
options:
verifyCard: "true"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.verification.riskData.decision, "Not Evaluated")
assert.equal(response.creditCard.verification.riskData.id, null)
done()
it "verifies card with custom verification amount", (done) ->
creditCardParams =
customerId: customerId
number: '4000111111111115'
expirationDate: '05/2012'
options:
verifyCard: "true"
verificationAmount: "1.03"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
done()
it "accepts a billing address", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
billingAddress:
streetAddress: '123 Fake St'
locality: 'Chicago'
region: 'IL'
postalCode: '60607'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.equal(response.creditCard.expirationDate, '05/2012')
assert.equal(response.creditCard.billingAddress.streetAddress, '123 Fake St')
assert.equal(response.creditCard.billingAddress.locality, 'Chicago')
assert.equal(response.creditCard.billingAddress.region, 'IL')
assert.equal(response.creditCard.billingAddress.postalCode, '60607')
done()
it "handles errors", (done) ->
creditCardParams =
customerId: customerId
number: 'invalid'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.message, 'Credit card number must be 12-19 digits.')
assert.equal(
response.errors.for('creditCard').on('number')[0].code,
'81716'
)
assert.equal(
response.errors.for('creditCard').on('number')[0].attribute,
'number'
)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '81716')
done()
it "accepts a venmo sdk payment method code", (done) ->
creditCardParams =
customerId: customerId
venmoSdkPaymentMethodCode: VenmoSdk.VisaPaymentMethodCode
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.isTrue(response.creditCard.venmoSdk)
done()
it "rejects a bad venmo sdk payment method code", (done) ->
creditCardParams =
customerId: customerId
venmoSdkPaymentMethodCode: VenmoSdk.InvalidPaymentMethodCode
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '91727')
assert.equal(response.message, "Invalid VenmoSDK payment method code")
done()
it "venmo sdk is true for card created with a venmo sdk session", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
options:
venmoSdkSession: VenmoSdk.Session
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.isTrue(response.creditCard.venmoSdk)
done()
it "venmo sdk is false for card created with an invalid venmo sdk session", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
options:
venmoSdkSession: VenmoSdk.InvalidSession
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.isFalse(response.creditCard.venmoSdk)
done()
it "accepts a payment method nonce", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate({}, (err, result) ->
assert.isTrue(result.success)
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
share: true,
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post("/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '411111******1111')
done()
)
)
context "card type indicators", ->
it "handles prepaid cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Prepaid
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.prepaid, CreditCard.Prepaid.Yes)
done()
it "handles commercial cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Commercial
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.commercial, CreditCard.Commercial.Yes)
done()
it "handles payroll cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Payroll
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.payroll, CreditCard.Payroll.Yes)
done()
it "handles healthcare cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Healthcare
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.healthcare, CreditCard.Healthcare.Yes)
done()
it "handles durbin regulated cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.DurbinRegulated
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.durbinRegulated, CreditCard.DurbinRegulated.Yes)
done()
it "handles debit cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Debit
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.debit, CreditCard.Debit.Yes)
done()
it "sets the country of issuance", (done) ->
creditCardParams =
customerId: <NAME>Id
number: CreditCardNumbers.CardTypeIndicators.CountryOfIssuance
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.countryOfIssuance, CreditCardDefaults.CountryOfIssuance)
done()
it "sets the issuing bank", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.IssuingBank
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.issuingBank, CreditCardDefaults.IssuingBank)
done()
context "negative card type indicators", ->
createResponse = null
before (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.No
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
createResponse = response
done()
it 'sets the prepaid field to No', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.No)
it 'sets the payroll field to No', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.No)
assert.equal(createResponse.creditCard.payroll, CreditCard.Payroll.No)
it 'sets the debit field to No', ->
assert.equal(createResponse.creditCard.debit, CreditCard.Debit.No)
it 'sets the commercial field to No', ->
assert.equal(createResponse.creditCard.commercial, CreditCard.Commercial.No)
it 'sets the durbin regulated field to No', ->
assert.equal(createResponse.creditCard.durbinRegulated, CreditCard.DurbinRegulated.No)
it 'sets the heathcare field to No', ->
assert.equal(createResponse.creditCard.healthcare, CreditCard.Healthcare.No)
context "unknown card type indicators", ->
createResponse = null
before (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Unknown
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
createResponse = response
done()
it 'sets the prepaid field to Unknown', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.Unknown)
it 'sets the payroll field to Unknown', ->
assert.equal(createResponse.creditCard.payroll, CreditCard.Payroll.Unknown)
it 'sets the debit field to Unknown', ->
assert.equal(createResponse.creditCard.debit, CreditCard.Debit.Unknown)
it 'sets the commercial field to Unknown', ->
assert.equal(createResponse.creditCard.commercial, CreditCard.Commercial.Unknown)
it 'sets the durbin regulated field to Unknown', ->
assert.equal(createResponse.creditCard.durbinRegulated, CreditCard.DurbinRegulated.Unknown)
it 'sets the heathcare field to Unknown', ->
assert.equal(createResponse.creditCard.healthcare, CreditCard.Healthcare.Unknown)
it 'sets the country of issuance field to Unknown', ->
assert.equal(createResponse.creditCard.countryOfIssuance, CreditCard.CountryOfIssuance.Unknown)
it 'sets the issuing bank field to Unknown', ->
assert.equal(createResponse.creditCard.issuingBank, CreditCard.IssuingBank.Unknown)
describe "delete", (done) ->
customerToken = null
before (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '05/2014'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
customerToken = response.customer.creditCards[0].token
done()
it "deletes the credit card", (done) ->
specHelper.defaultGateway.creditCard.delete customerToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.creditCard.find customerToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles invalid tokens", (done) ->
specHelper.defaultGateway.creditCard.delete 'nonexistent_token', (err) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "expired", ->
it "returns expired cards", (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '01/2010'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
testCard = response.customer.creditCards[0]
specHelper.defaultGateway.creditCard.expired (err, result) ->
assert.include(result.ids, testCard.token)
done()
describe "expiringBetween", ->
it "returns card expiring between the given dates", (done) ->
customerParams =
creditCard:
number: '5105105105105100'
expirationDate: '05/2016'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
testCard = response.customer.creditCards[0]
today = new Date
before = new Date("2016-04-31")
after = new Date("2016-10-01")
specHelper.defaultGateway.creditCard.expiringBetween before, after, (err, result) ->
assert.isNull(err)
assert.include(result.ids, testCard.token)
done()
describe "find", ->
customerToken = null
before (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '05/2014'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
customerToken = response.customer.creditCards[0].token
done()
it "finds the card", (done) ->
specHelper.defaultGateway.creditCard.find customerToken, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '510510******5100')
assert.equal(creditCard.expirationDate, '05/2014')
done()
it "handles not finding the card", (done) ->
specHelper.defaultGateway.creditCard.find 'nonexistent_token', (err, creditCard) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles whitespace", (done) ->
specHelper.defaultGateway.creditCard.find ' ', (err, creditCard) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "fromNonce", ->
customerId = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: '<NAME>', lastName: '<NAME>'}, (err, response) ->
customerId = response.customer.id
done()
it "returns a credit card for the supplied nonce", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '411111******1111')
assert.equal(creditCard.expirationDate, '11/2099')
done()
it "returns an error if the supplied nonce points to a shared card", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
share: true,
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(creditCard)
assert.equal(err.type, "notFoundError")
assert.include(err.message, "not found")
done()
it "returns an error if the supplied nonce is consumed", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(err)
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(creditCard)
assert.equal(err.type, "notFoundError")
assert.include(err.message, "consumed")
done()
describe "update", ->
creditCardToken = null
before (done) ->
customerParams =
creditCard:
cardholderName: '<NAME>',
number: '5105105105105100',
expirationDate: '05/2014'
billingAddress:
streetAddress: '123 Old St',
locality: 'Old City',
region: 'Old Region'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
creditCardToken = response.customer.creditCards[0].token
done()
it "updates the card", (done) ->
updateParams =
cardholderName: '<NAME>',
number: '4111111111111111',
expirationDate: '12/2015'
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.cardholderName, '<NAME>')
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.equal(response.creditCard.expirationDate, '12/2015')
done()
it "updates the billing address", (done) ->
updateParams =
cardholderName: '<NAME>'
number: '4111111111111111'
expirationDate: '12/2015'
billingAddress:
streetAddress: '123 New St'
locality: 'New City'
region: 'New Region'
options:
updateExisting: true
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.cardholderName, '<NAME>')
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.equal(response.creditCard.expirationDate, '12/2015')
billingAddress = response.creditCard.billingAddress
assert.equal(billingAddress.streetAddress, '123 New St')
assert.equal(billingAddress.locality, 'New City')
assert.equal(billingAddress.region, 'New Region')
done()
it "handles errors", (done) ->
updateParams =
number: 'invalid'
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.message, 'Credit card number must be 12-19 digits.')
assert.equal(
response.errors.for('creditCard').on('number')[0].code,
'81716'
)
assert.equal(
response.errors.for('creditCard').on('number')[0].attribute,
'number'
)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '81716')
done()
| true | require('../../spec_helper')
_ = require('underscore')._
braintree = specHelper.braintree
util = require('util')
{CreditCard} = require('../../../lib/braintree/credit_card')
{CreditCardNumbers} = require('../../../lib/braintree/test/credit_card_numbers')
{CreditCardDefaults} = require('../../../lib/braintree/test/credit_card_defaults')
{VenmoSdk} = require('../../../lib/braintree/test/venmo_sdk')
{Config} = require('../../../lib/braintree/config')
describe "CreditCardGateway", ->
describe "create", ->
customerId = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'PI:NAME:<NAME>END_PI', lastName: 'PI:NAME:<NAME>END_PI'}, (err, response) ->
customerId = response.customer.id
done()
it "works for a simple create", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.equal(response.creditCard.expirationDate, '05/2012')
assert.isTrue(response.creditCard.uniqueNumberIdentifier.length == 32)
assert.match(response.creditCard.imageUrl, /png/)
done()
it "verifies card if verifyCard is set to true", (done) ->
creditCardParams =
customerId: customerId
number: '4000111111111115'
expirationDate: '05/2012'
options:
verifyCard: "true"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
done()
it "includes the verification on the credit card with risk data", (done) ->
creditCardParams =
customerId: customerId
number: '4111111111111111'
expirationDate: '05/2020'
options:
verifyCard: "true"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.verification.riskData.decision, "Not Evaluated")
assert.equal(response.creditCard.verification.riskData.id, null)
done()
it "verifies card with custom verification amount", (done) ->
creditCardParams =
customerId: customerId
number: '4000111111111115'
expirationDate: '05/2012'
options:
verifyCard: "true"
verificationAmount: "1.03"
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
assert.equal(response.verification.status, 'processor_declined')
assert.equal(response.verification.processorResponseCode, '2000')
assert.equal(response.verification.processorResponseText, 'Do Not Honor')
done()
it "accepts a billing address", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
billingAddress:
streetAddress: '123 Fake St'
locality: 'Chicago'
region: 'IL'
postalCode: '60607'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.equal(response.creditCard.expirationDate, '05/2012')
assert.equal(response.creditCard.billingAddress.streetAddress, '123 Fake St')
assert.equal(response.creditCard.billingAddress.locality, 'Chicago')
assert.equal(response.creditCard.billingAddress.region, 'IL')
assert.equal(response.creditCard.billingAddress.postalCode, '60607')
done()
it "handles errors", (done) ->
creditCardParams =
customerId: customerId
number: 'invalid'
expirationDate: '05/2012'
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.message, 'Credit card number must be 12-19 digits.')
assert.equal(
response.errors.for('creditCard').on('number')[0].code,
'81716'
)
assert.equal(
response.errors.for('creditCard').on('number')[0].attribute,
'number'
)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '81716')
done()
it "accepts a venmo sdk payment method code", (done) ->
creditCardParams =
customerId: customerId
venmoSdkPaymentMethodCode: VenmoSdk.VisaPaymentMethodCode
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.isTrue(response.creditCard.venmoSdk)
done()
it "rejects a bad venmo sdk payment method code", (done) ->
creditCardParams =
customerId: customerId
venmoSdkPaymentMethodCode: VenmoSdk.InvalidPaymentMethodCode
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isFalse(response.success)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '91727')
assert.equal(response.message, "Invalid VenmoSDK payment method code")
done()
it "venmo sdk is true for card created with a venmo sdk session", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
options:
venmoSdkSession: VenmoSdk.Session
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.isTrue(response.creditCard.venmoSdk)
done()
it "venmo sdk is false for card created with an invalid venmo sdk session", (done) ->
creditCardParams =
customerId: customerId
number: '5105105105105100'
expirationDate: '05/2012'
options:
venmoSdkSession: VenmoSdk.InvalidSession
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '510510******5100')
assert.isFalse(response.creditCard.venmoSdk)
done()
it "accepts a payment method nonce", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate({}, (err, result) ->
assert.isTrue(result.success)
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
share: true,
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post("/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
creditCardParams =
customerId: customerId
paymentMethodNonce: nonce
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.maskedNumber, '411111******1111')
done()
)
)
context "card type indicators", ->
it "handles prepaid cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Prepaid
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.prepaid, CreditCard.Prepaid.Yes)
done()
it "handles commercial cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Commercial
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.commercial, CreditCard.Commercial.Yes)
done()
it "handles payroll cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Payroll
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.payroll, CreditCard.Payroll.Yes)
done()
it "handles healthcare cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Healthcare
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.healthcare, CreditCard.Healthcare.Yes)
done()
it "handles durbin regulated cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.DurbinRegulated
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.durbinRegulated, CreditCard.DurbinRegulated.Yes)
done()
it "handles debit cards", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Debit
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.debit, CreditCard.Debit.Yes)
done()
it "sets the country of issuance", (done) ->
creditCardParams =
customerId: PI:NAME:<NAME>END_PIId
number: CreditCardNumbers.CardTypeIndicators.CountryOfIssuance
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.countryOfIssuance, CreditCardDefaults.CountryOfIssuance)
done()
it "sets the issuing bank", (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.IssuingBank
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
assert.equal(response.creditCard.issuingBank, CreditCardDefaults.IssuingBank)
done()
context "negative card type indicators", ->
createResponse = null
before (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.No
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
createResponse = response
done()
it 'sets the prepaid field to No', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.No)
it 'sets the payroll field to No', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.No)
assert.equal(createResponse.creditCard.payroll, CreditCard.Payroll.No)
it 'sets the debit field to No', ->
assert.equal(createResponse.creditCard.debit, CreditCard.Debit.No)
it 'sets the commercial field to No', ->
assert.equal(createResponse.creditCard.commercial, CreditCard.Commercial.No)
it 'sets the durbin regulated field to No', ->
assert.equal(createResponse.creditCard.durbinRegulated, CreditCard.DurbinRegulated.No)
it 'sets the heathcare field to No', ->
assert.equal(createResponse.creditCard.healthcare, CreditCard.Healthcare.No)
context "unknown card type indicators", ->
createResponse = null
before (done) ->
creditCardParams =
customerId: customerId
number: CreditCardNumbers.CardTypeIndicators.Unknown
expirationDate: '05/2012'
options:
verifyCard: true
specHelper.defaultGateway.creditCard.create creditCardParams, (err, response) ->
createResponse = response
done()
it 'sets the prepaid field to Unknown', ->
assert.equal(createResponse.creditCard.prepaid, CreditCard.Prepaid.Unknown)
it 'sets the payroll field to Unknown', ->
assert.equal(createResponse.creditCard.payroll, CreditCard.Payroll.Unknown)
it 'sets the debit field to Unknown', ->
assert.equal(createResponse.creditCard.debit, CreditCard.Debit.Unknown)
it 'sets the commercial field to Unknown', ->
assert.equal(createResponse.creditCard.commercial, CreditCard.Commercial.Unknown)
it 'sets the durbin regulated field to Unknown', ->
assert.equal(createResponse.creditCard.durbinRegulated, CreditCard.DurbinRegulated.Unknown)
it 'sets the heathcare field to Unknown', ->
assert.equal(createResponse.creditCard.healthcare, CreditCard.Healthcare.Unknown)
it 'sets the country of issuance field to Unknown', ->
assert.equal(createResponse.creditCard.countryOfIssuance, CreditCard.CountryOfIssuance.Unknown)
it 'sets the issuing bank field to Unknown', ->
assert.equal(createResponse.creditCard.issuingBank, CreditCard.IssuingBank.Unknown)
describe "delete", (done) ->
customerToken = null
before (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '05/2014'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
customerToken = response.customer.creditCards[0].token
done()
it "deletes the credit card", (done) ->
specHelper.defaultGateway.creditCard.delete customerToken, (err) ->
assert.isNull(err)
specHelper.defaultGateway.creditCard.find customerToken, (err, response) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles invalid tokens", (done) ->
specHelper.defaultGateway.creditCard.delete 'nonexistent_token', (err) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "expired", ->
it "returns expired cards", (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '01/2010'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
testCard = response.customer.creditCards[0]
specHelper.defaultGateway.creditCard.expired (err, result) ->
assert.include(result.ids, testCard.token)
done()
describe "expiringBetween", ->
it "returns card expiring between the given dates", (done) ->
customerParams =
creditCard:
number: '5105105105105100'
expirationDate: '05/2016'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
testCard = response.customer.creditCards[0]
today = new Date
before = new Date("2016-04-31")
after = new Date("2016-10-01")
specHelper.defaultGateway.creditCard.expiringBetween before, after, (err, result) ->
assert.isNull(err)
assert.include(result.ids, testCard.token)
done()
describe "find", ->
customerToken = null
before (done) ->
customerParams =
creditCard:
number: '5105105105105100',
expirationDate: '05/2014'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
customerToken = response.customer.creditCards[0].token
done()
it "finds the card", (done) ->
specHelper.defaultGateway.creditCard.find customerToken, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '510510******5100')
assert.equal(creditCard.expirationDate, '05/2014')
done()
it "handles not finding the card", (done) ->
specHelper.defaultGateway.creditCard.find 'nonexistent_token', (err, creditCard) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
it "handles whitespace", (done) ->
specHelper.defaultGateway.creditCard.find ' ', (err, creditCard) ->
assert.equal(err.type, braintree.errorTypes.notFoundError)
done()
describe "fromNonce", ->
customerId = null
before (done) ->
specHelper.defaultGateway.customer.create {firstName: 'PI:NAME:<NAME>END_PI', lastName: 'PI:NAME:<NAME>END_PI'}, (err, response) ->
customerId = response.customer.id
done()
it "returns a credit card for the supplied nonce", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(err)
assert.equal(creditCard.maskedNumber, '411111******1111')
assert.equal(creditCard.expirationDate, '11/2099')
done()
it "returns an error if the supplied nonce points to a shared card", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
share: true,
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(creditCard)
assert.equal(err.type, "notFoundError")
assert.include(err.message, "not found")
done()
it "returns an error if the supplied nonce is consumed", (done) ->
myHttp = new specHelper.clientApiHttp(new Config(specHelper.defaultConfig))
specHelper.defaultGateway.clientToken.generate {customerId: customerId}, (err, result) ->
clientToken = JSON.parse(specHelper.decodeClientToken(result.clientToken))
authorizationFingerprint = clientToken.authorizationFingerprint
params = {
authorizationFingerprint: authorizationFingerprint,
sharedCustomerIdentifierType: "testing",
sharedCustomerIdentifier: "testing-identifier",
credit_card: {
number: "4111111111111111",
expiration_month: "11",
expiration_year: "2099"
}
}
myHttp.post "/client_api/v1/payment_methods/credit_cards.json", params, (statusCode, body) ->
nonce = JSON.parse(body).creditCards[0].nonce
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(err)
specHelper.defaultGateway.creditCard.fromNonce nonce, (err, creditCard) ->
assert.isNull(creditCard)
assert.equal(err.type, "notFoundError")
assert.include(err.message, "consumed")
done()
describe "update", ->
creditCardToken = null
before (done) ->
customerParams =
creditCard:
cardholderName: 'PI:NAME:<NAME>END_PI',
number: '5105105105105100',
expirationDate: '05/2014'
billingAddress:
streetAddress: '123 Old St',
locality: 'Old City',
region: 'Old Region'
specHelper.defaultGateway.customer.create customerParams, (err, response) ->
creditCardToken = response.customer.creditCards[0].token
done()
it "updates the card", (done) ->
updateParams =
cardholderName: 'PI:NAME:<NAME>END_PI',
number: '4111111111111111',
expirationDate: '12/2015'
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.cardholderName, 'PI:NAME:<NAME>END_PI')
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.equal(response.creditCard.expirationDate, '12/2015')
done()
it "updates the billing address", (done) ->
updateParams =
cardholderName: 'PI:NAME:<NAME>END_PI'
number: '4111111111111111'
expirationDate: '12/2015'
billingAddress:
streetAddress: '123 New St'
locality: 'New City'
region: 'New Region'
options:
updateExisting: true
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isNull(err)
assert.isTrue(response.success)
assert.equal(response.creditCard.cardholderName, 'PI:NAME:<NAME>END_PI')
assert.equal(response.creditCard.maskedNumber, '411111******1111')
assert.equal(response.creditCard.expirationDate, '12/2015')
billingAddress = response.creditCard.billingAddress
assert.equal(billingAddress.streetAddress, '123 New St')
assert.equal(billingAddress.locality, 'New City')
assert.equal(billingAddress.region, 'New Region')
done()
it "handles errors", (done) ->
updateParams =
number: 'invalid'
specHelper.defaultGateway.creditCard.update creditCardToken, updateParams, (err, response) ->
assert.isFalse(response.success)
assert.equal(response.message, 'Credit card number must be 12-19 digits.')
assert.equal(
response.errors.for('creditCard').on('number')[0].code,
'81716'
)
assert.equal(
response.errors.for('creditCard').on('number')[0].attribute,
'number'
)
errorCodes = (error.code for error in response.errors.deepErrors())
assert.equal(1, errorCodes.length)
assert.include(errorCodes, '81716')
done()
|
[
{
"context": " log \"adminmodule.noticeAuthorization\"\n token = appState.token()\n langTag = pwaContent.languageTag\n path =",
"end": 14571,
"score": 0.8929328918457031,
"start": 14557,
"tag": "KEY",
"value": "appState.token"
},
{
"context": " log \"adminmodule.apply\"\n ... | adminmodule/adminmodule.coffee | JhonnyJason/admin-pwa-sources-source | 0 | adminmodule = {name: "adminmodule"}
############################################################
#region printLogFunctions
log = (arg) ->
if adminModules.debugmodule.modulesToDebug["adminmodule"]? then console.log "[adminmodule]: " + arg
return
ostr = (obj) -> JSON.stringify(obj, null, 4)
olog = (obj) -> log "\n" + ostr(obj)
print = (arg) -> console.log(arg)
#endregion
############################################################
#region modulesFromEnvironment
mustache = require "mustache"
############################################################
mustachekeys = null
templatepreparation = null
network = null
adminpanel = null
appState = null
uiState = null
contentHandler = null
bottomPanel = null
floatingPanel = null
bigPanel = null
imageManagement = null
listManagement = null
linkManagement = null
auth = null
#endregion
############################################################
#region internalProperties
currentContentFallback = ""
############################################################
typingSecret = false
loggingIn = false
token = ""
panelVisible = true
showingEditables = false
altIsPressed = 0
#endregion
############################################################
adminmodule.initialize = () ->
log "adminmodule.initialize"
mustachekeys = adminModules.mustachekeysmodule
templatepreparation = adminModules.templatepreparationmodule
network = adminModules.networkmodule
adminpanel = adminModules.adminpanelmodule
appState = adminModules.appstatemodule
uiState = adminModules.uistatemodule
auth = adminModules.authmodule
contentHandler = adminModules.contenthandlermodule
bigPanel = adminModules.bigpanelmodule
floatingPanel = adminModules.floatingpanelmodule
imageManagement = adminModules.imagemanagementmodule
listManagement = adminModules.listmanagementmodule
linkManagement = adminModules.linkmanagementmodule
bottomPanel = adminModules.bottompanelmodule
return
############################################################
#region internalFunctions
renderProcess = ->
log "renderProcess"
content = contentHandler.content()
mustachekeys.createMustacheKeys()
mustacheTemplate = template(pwaMustacheKeymap)
# log mustacheTemplate
shadowBody = document.createElement("body")
shadowBody.innerHTML = mustacheTemplate
templatepreparation.prepareBody(shadowBody)
preparedTemplate = shadowBody.innerHTML
# log preparedTemplate
htmlResult = mustache.render(preparedTemplate, content)
# log htmlResult
newBody = document.createElement("body")
newBody.innerHTML = htmlResult
adminpanel.attachPanelToBody(newBody)
document.body = newBody
##fire document onload again
window.dispatchEvent(new Event("load"))
bigPanel.prepare()
addAdministrativeEventListeners()
applyEditableVisibility()
return
############################################################
addAdministrativeEventListeners = ->
log "addAdministrativeEventListeners"
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editable in allEditableTexts
editable.addEventListener("keyup", editKeyReleased)
editable.addEventListener("keydown", editKeyPressed)
editable.addEventListener("focusin", startedEditing)
editable.addEventListener("focusout", stoppedEditing)
editable.addEventListener("click", editableClicked)
defuseLink(editable)
allEditableImages = document.querySelectorAll("[image-content-key]")
for editable in allEditableImages
editable.addEventListener("click", editableImageClicked)
defuseLink(editable)
return
defuseLink = (element) ->
log "defuseLink"
# while element?
# if element.tagName == "A" then setAttribute("href", "#") element = element.parentElement
return
createLink = ->
log "createLink"
selection = window.getSelection()
rangeCount = selection.rangeCount
if rangeCount > 1 or rangeCount < 1 then return
link = document.createElement("a")
link.setAttribute("href", "#")
range = selection.getRangeAt(0)
range.surroundContents(link)
return
############################################################
#region eventListeners
editableClicked = (event) ->
log "editableClicked"
event.preventDefault()
event.stopPropagation()
return false
editableImageClicked = (event) ->
log "editableImageClicked"
event.preventDefault()
element = event.target
imageLabel = element.getAttribute("image-content-key")
# log imageLabel
# log element
# log element.id
while !imageLabel and element
element = element.parentElement
imageLabel = element.getAttribute("image-content-key")
# log imageLabel
# log element
# log element.id
return unless imageLabel
bigPanel.activateEdit("images", imageLabel)
bottomPanel.applyUIState()
return
editKeyReleased = (event) ->
log "editKeyReleased"
key = event.keyCode
if (key == 18 ) then altIsPressed = false
return
editKeyPressed = (event) ->
log "editKeyPressed"
key = event.keyCode
if (key == 76 and altIsPressed and event.ctrlKey) then createLink()
if (key == 18) then altIsPressed = true
if (key == 27) #escape
this.innerHTML = currentContentFallback
document.activeElement.blur()
return
startedEditing = (event) ->
log "startedEditing"
element = event.target
element.classList.add("editing")
currentContentFallback = cleanContentHTML(element.innerHTML)
activateFloatingPanelFor(element)
return
stoppedEditing = (event) ->
log "stoppedEditing"
floatingPanel.disappear()
element = event.target
isLink = element.getAttribute("is-link")
element.classList.remove("editing")
content = cleanContentHTML(element.innerHTML, isLink)
log "new content: " + content
element.innerHTML = content
# log "new Content: " + content
return if content == currentContentFallback
contentKeyString = element.getAttribute("text-content-key")
newContentText(contentKeyString, content, currentContentFallback)
return
#endregion
############################################################
#region contentCleaning
getCleanBold = (el) ->
# log "getCleanBold"
# log el.innerHTML
el.innerHTML = cleanContentHTML(el.innerHTML)
return el
getCleanAnchor = (el) ->
# log "getCleanAnchor"
# log el.innerHTML
el.innerHTML = cleanContentHTML(el.innerHTML)
# href = el.getAttribute("href")
# if href then el.setAttribute("href", href)
return el
cleanContentHTML = (innerHTML, isLink) ->
# log "cleanContentHTML"
# log innerHTML
el = document.createElement("div")
el.innerHTML = innerHTML
children = [el.children...]
for child in children
if child.tagName == "B" && !isLink then newNode = getCleanBold(child)
else if child.tagName == "A" && !isLink then newNode = getCleanAnchor(child)
else if child.tagName == "BR" && !isLink then newNode = document.createElement("br")
else newNode = cleanContentHTML(child.innerHTML)
# log child.innerHTML
# log child.tagName
if typeof newNode == "string"
if newNode != "<br>" && !isLink then newNode = "<br>"+newNode
child.insertAdjacentHTML("beforebegin", newNode)
el.removeChild(child)
else
el.replaceChild(newNode, child)
return el.innerHTML
#endregion
############################################################
#region contentEditing
applyEditableVisibility = ->
log "applyEditableVisibility"
if uiState.visibleEditables()
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editableText in allEditableTexts
editableText.classList.add("editable-show")
allEditableImages = document.querySelectorAll("[image-content-key]")
for editableImage in allEditableImages
editableImage.classList.add("editable-image")
else
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editableText in allEditableTexts
editableText.classList.remove("editable-show")
allEditableImages = document.querySelectorAll("[image-content-key]")
for editableImage in allEditableImages
editableImage.classList.remove("editable-image")
return
############################################################
newContentText = (contentKeyString, content, fallback) ->
log "newContentText"
log contentKeyString
log content
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
applyEdit(contentKeyString, content)
contentHandler.reflectEdit(contentKeyString, content)
updateSuccess(response)
catch err then revertEdit(contentKeyString, fallback)
return
newContentList = (contentKeyString, content, fallback) ->
log "newContentList"
log contentKeyString
log content
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
listManagement.setNewList(content, contentKeyString)
contentHandler.reflectEdit(contentKeyString, content)
updateSuccess(response)
catch err then revertListEdit(contentKeyString, fallback)
adminmodule.start()
return
newImages = (fallback) ->
log "newImages"
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
content = contentHandler.content().images
contentKeyString = "images"
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
updateSuccess(response)
catch err then revertImagesEdit(fallback)
return
############################################################
revertImagesEdit = (oldImages) ->
log "revertImagesEdit"
contentHandler.content().images = oldImages
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
return
revertListEdit = (contentKeyString, oldList) ->
log "revertListEdit"
log "actually nothing to do here^^..."
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
return
applyEdit = (contentKeyString, newContent) ->
log "applyEdit"
selector = "[text-content-key='"+contentKeyString+"']"
elements = document.querySelectorAll(selector)
for element in elements
element.innerHTML = newContent
return
revertEdit = (contentKeyString, oldContent) ->
log "revertEdit"
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
selector = "[text-content-key='"+contentKeyString+"']"
elements = document.querySelectorAll(selector)
for element in elements
element.innerHTML = oldContent
return
setCleanState = ->
log "setCleanState"
appState.setClean()
bottomPanel.applyUIState()
return
setDirtyState = ->
log "setDirtyState"
appState.setDirty()
bottomPanel.applyUIState()
return
############################################################
activateFloatingPanelFor = (element) ->
log "activateFloatingPanelFor"
floatingPanel.initializeForElement(element, currentContentFallback)
left = element.getBoundingClientRect().x
bottom = window.innerHeight - element.getBoundingClientRect().y
floatingPanel.appear(left, bottom)
return
#endregion
############################################################
#region networkEvents
updateSuccess = (response) ->
log "updateSuccess"
setDirtyState()
bottomPanel.setSuccessMessage("Veränderung angenommen")
return
prepareImages = ->
log "prepareImages"
content = contentHandler.content()
imageManagement.setImages(content.images)
return
handleDataState = (response) ->
log "handleDataState"
olog response
await contentHandler.prepareOriginal(response.contentHash)
prepareImages()
contentHandler.reflectEdits(response.edits)
if Object.keys(response.edits).length > 0 then setDirtyState()
else setCleanState()
renderProcess()
return
dataStateRequestError = ->
log "dataStateRequestError"
auth.logout()
return
#endregion
#endregion
############################################################
#region exposedFunctions
adminmodule.start = ->
log "adminmodule.start"
prepareImages()
renderProcess()
return
############################################################
#region noticeStuff
adminmodule.noticeVisibilityChanged = ->
log "adminmodule.noticeVisibilityChanged"
applyEditableVisibility()
return
adminmodule.noticeImageSwaps = (moves) ->
log "adminmodule.noticeImageSwaps"
token = appState.token()
assetType = "images"
dataObject = {assetType, moves, token}
try
await network.scicall("moveAssets", dataObject)
console.log("/moveAssets success!")
catch err
log err
console.log("/moveAssets failure!")
return
return
adminmodule.noticeImagesEdits = (fallback) ->
log "adminmodule.noticeImagesEdits"
newImages(fallback)
return
adminmodule.noticeImagesEdits = (fallback) ->
log "adminmodule.noticeImagesEdits"
newImages(fallback)
return
adminmodule.noticeListEdit = (contentKeyString, newContent, fallback) ->
log "adminmodule.noticeListEdit"
console.log ostr newContent
newContentList(contentKeyString, newContent, fallback)
return
adminmodule.noticeElementEdit = (element, fallback) ->
log "adminmodule.noticeElementEdit"
content = cleanContentHTML(element.innerHTML)
# log ""+element
element.innerHTML = content
contentKeyString = element.getAttribute("text-content-key")
newContentText(contentKeyString, content, fallback)
return
adminmodule.noticeContentChange = -> setDirtyState()
adminmodule.noticeAuthorizationSuccess = ->
log "adminmodule.noticeAuthorization"
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop();
communicationObject = {langTag, documentName, token}
try
response = await network.scicall("getDataState", communicationObject)
await handleDataState(response)
catch err then dataStateRequestError()
return
adminmodule.noticeAuthorizationFail = ->
log "adminmodule.noticeAuthorizationFail"
return
#endregion
############################################################
adminmodule.discard = ->
log "adminmodule.discard"
try
langTag = pwaContent.languageTag
await network.scicall("discard", {langTag, token})
contentHandler.reflectEdits({})
setCleanState()
bottomPanel.setSuccessMessage("Alle Änderungen wurden verworfen")
renderProcess()
catch err
bottomPanel.setErrorMessage("Keine Änderungen wurden verworfen!")
return
adminmodule.apply = ->
log "adminmodule.apply"
try
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop();
communicationObject = {langTag, documentName, token}
await network.scicall("apply", {langTag, token})
response = await network.scicall("getDataState", communicationObject)
await handleDataState(response)
bottomPanel.setSuccessMessage("Alle Änderungen wurden übernommen")
catch err
bottomPanel.setErrorMessage("Keine Änderungen wurden übernommen!")
return
#endregion
module.exports = adminmodule | 9912 | adminmodule = {name: "adminmodule"}
############################################################
#region printLogFunctions
log = (arg) ->
if adminModules.debugmodule.modulesToDebug["adminmodule"]? then console.log "[adminmodule]: " + arg
return
ostr = (obj) -> JSON.stringify(obj, null, 4)
olog = (obj) -> log "\n" + ostr(obj)
print = (arg) -> console.log(arg)
#endregion
############################################################
#region modulesFromEnvironment
mustache = require "mustache"
############################################################
mustachekeys = null
templatepreparation = null
network = null
adminpanel = null
appState = null
uiState = null
contentHandler = null
bottomPanel = null
floatingPanel = null
bigPanel = null
imageManagement = null
listManagement = null
linkManagement = null
auth = null
#endregion
############################################################
#region internalProperties
currentContentFallback = ""
############################################################
typingSecret = false
loggingIn = false
token = ""
panelVisible = true
showingEditables = false
altIsPressed = 0
#endregion
############################################################
adminmodule.initialize = () ->
log "adminmodule.initialize"
mustachekeys = adminModules.mustachekeysmodule
templatepreparation = adminModules.templatepreparationmodule
network = adminModules.networkmodule
adminpanel = adminModules.adminpanelmodule
appState = adminModules.appstatemodule
uiState = adminModules.uistatemodule
auth = adminModules.authmodule
contentHandler = adminModules.contenthandlermodule
bigPanel = adminModules.bigpanelmodule
floatingPanel = adminModules.floatingpanelmodule
imageManagement = adminModules.imagemanagementmodule
listManagement = adminModules.listmanagementmodule
linkManagement = adminModules.linkmanagementmodule
bottomPanel = adminModules.bottompanelmodule
return
############################################################
#region internalFunctions
renderProcess = ->
log "renderProcess"
content = contentHandler.content()
mustachekeys.createMustacheKeys()
mustacheTemplate = template(pwaMustacheKeymap)
# log mustacheTemplate
shadowBody = document.createElement("body")
shadowBody.innerHTML = mustacheTemplate
templatepreparation.prepareBody(shadowBody)
preparedTemplate = shadowBody.innerHTML
# log preparedTemplate
htmlResult = mustache.render(preparedTemplate, content)
# log htmlResult
newBody = document.createElement("body")
newBody.innerHTML = htmlResult
adminpanel.attachPanelToBody(newBody)
document.body = newBody
##fire document onload again
window.dispatchEvent(new Event("load"))
bigPanel.prepare()
addAdministrativeEventListeners()
applyEditableVisibility()
return
############################################################
addAdministrativeEventListeners = ->
log "addAdministrativeEventListeners"
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editable in allEditableTexts
editable.addEventListener("keyup", editKeyReleased)
editable.addEventListener("keydown", editKeyPressed)
editable.addEventListener("focusin", startedEditing)
editable.addEventListener("focusout", stoppedEditing)
editable.addEventListener("click", editableClicked)
defuseLink(editable)
allEditableImages = document.querySelectorAll("[image-content-key]")
for editable in allEditableImages
editable.addEventListener("click", editableImageClicked)
defuseLink(editable)
return
defuseLink = (element) ->
log "defuseLink"
# while element?
# if element.tagName == "A" then setAttribute("href", "#") element = element.parentElement
return
createLink = ->
log "createLink"
selection = window.getSelection()
rangeCount = selection.rangeCount
if rangeCount > 1 or rangeCount < 1 then return
link = document.createElement("a")
link.setAttribute("href", "#")
range = selection.getRangeAt(0)
range.surroundContents(link)
return
############################################################
#region eventListeners
editableClicked = (event) ->
log "editableClicked"
event.preventDefault()
event.stopPropagation()
return false
editableImageClicked = (event) ->
log "editableImageClicked"
event.preventDefault()
element = event.target
imageLabel = element.getAttribute("image-content-key")
# log imageLabel
# log element
# log element.id
while !imageLabel and element
element = element.parentElement
imageLabel = element.getAttribute("image-content-key")
# log imageLabel
# log element
# log element.id
return unless imageLabel
bigPanel.activateEdit("images", imageLabel)
bottomPanel.applyUIState()
return
editKeyReleased = (event) ->
log "editKeyReleased"
key = event.keyCode
if (key == 18 ) then altIsPressed = false
return
editKeyPressed = (event) ->
log "editKeyPressed"
key = event.keyCode
if (key == 76 and altIsPressed and event.ctrlKey) then createLink()
if (key == 18) then altIsPressed = true
if (key == 27) #escape
this.innerHTML = currentContentFallback
document.activeElement.blur()
return
startedEditing = (event) ->
log "startedEditing"
element = event.target
element.classList.add("editing")
currentContentFallback = cleanContentHTML(element.innerHTML)
activateFloatingPanelFor(element)
return
stoppedEditing = (event) ->
log "stoppedEditing"
floatingPanel.disappear()
element = event.target
isLink = element.getAttribute("is-link")
element.classList.remove("editing")
content = cleanContentHTML(element.innerHTML, isLink)
log "new content: " + content
element.innerHTML = content
# log "new Content: " + content
return if content == currentContentFallback
contentKeyString = element.getAttribute("text-content-key")
newContentText(contentKeyString, content, currentContentFallback)
return
#endregion
############################################################
#region contentCleaning
getCleanBold = (el) ->
# log "getCleanBold"
# log el.innerHTML
el.innerHTML = cleanContentHTML(el.innerHTML)
return el
getCleanAnchor = (el) ->
# log "getCleanAnchor"
# log el.innerHTML
el.innerHTML = cleanContentHTML(el.innerHTML)
# href = el.getAttribute("href")
# if href then el.setAttribute("href", href)
return el
cleanContentHTML = (innerHTML, isLink) ->
# log "cleanContentHTML"
# log innerHTML
el = document.createElement("div")
el.innerHTML = innerHTML
children = [el.children...]
for child in children
if child.tagName == "B" && !isLink then newNode = getCleanBold(child)
else if child.tagName == "A" && !isLink then newNode = getCleanAnchor(child)
else if child.tagName == "BR" && !isLink then newNode = document.createElement("br")
else newNode = cleanContentHTML(child.innerHTML)
# log child.innerHTML
# log child.tagName
if typeof newNode == "string"
if newNode != "<br>" && !isLink then newNode = "<br>"+newNode
child.insertAdjacentHTML("beforebegin", newNode)
el.removeChild(child)
else
el.replaceChild(newNode, child)
return el.innerHTML
#endregion
############################################################
#region contentEditing
applyEditableVisibility = ->
log "applyEditableVisibility"
if uiState.visibleEditables()
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editableText in allEditableTexts
editableText.classList.add("editable-show")
allEditableImages = document.querySelectorAll("[image-content-key]")
for editableImage in allEditableImages
editableImage.classList.add("editable-image")
else
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editableText in allEditableTexts
editableText.classList.remove("editable-show")
allEditableImages = document.querySelectorAll("[image-content-key]")
for editableImage in allEditableImages
editableImage.classList.remove("editable-image")
return
############################################################
newContentText = (contentKeyString, content, fallback) ->
log "newContentText"
log contentKeyString
log content
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
applyEdit(contentKeyString, content)
contentHandler.reflectEdit(contentKeyString, content)
updateSuccess(response)
catch err then revertEdit(contentKeyString, fallback)
return
newContentList = (contentKeyString, content, fallback) ->
log "newContentList"
log contentKeyString
log content
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
listManagement.setNewList(content, contentKeyString)
contentHandler.reflectEdit(contentKeyString, content)
updateSuccess(response)
catch err then revertListEdit(contentKeyString, fallback)
adminmodule.start()
return
newImages = (fallback) ->
log "newImages"
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
content = contentHandler.content().images
contentKeyString = "images"
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
updateSuccess(response)
catch err then revertImagesEdit(fallback)
return
############################################################
revertImagesEdit = (oldImages) ->
log "revertImagesEdit"
contentHandler.content().images = oldImages
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
return
revertListEdit = (contentKeyString, oldList) ->
log "revertListEdit"
log "actually nothing to do here^^..."
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
return
applyEdit = (contentKeyString, newContent) ->
log "applyEdit"
selector = "[text-content-key='"+contentKeyString+"']"
elements = document.querySelectorAll(selector)
for element in elements
element.innerHTML = newContent
return
revertEdit = (contentKeyString, oldContent) ->
log "revertEdit"
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
selector = "[text-content-key='"+contentKeyString+"']"
elements = document.querySelectorAll(selector)
for element in elements
element.innerHTML = oldContent
return
setCleanState = ->
log "setCleanState"
appState.setClean()
bottomPanel.applyUIState()
return
setDirtyState = ->
log "setDirtyState"
appState.setDirty()
bottomPanel.applyUIState()
return
############################################################
activateFloatingPanelFor = (element) ->
log "activateFloatingPanelFor"
floatingPanel.initializeForElement(element, currentContentFallback)
left = element.getBoundingClientRect().x
bottom = window.innerHeight - element.getBoundingClientRect().y
floatingPanel.appear(left, bottom)
return
#endregion
############################################################
#region networkEvents
updateSuccess = (response) ->
log "updateSuccess"
setDirtyState()
bottomPanel.setSuccessMessage("Veränderung angenommen")
return
prepareImages = ->
log "prepareImages"
content = contentHandler.content()
imageManagement.setImages(content.images)
return
handleDataState = (response) ->
log "handleDataState"
olog response
await contentHandler.prepareOriginal(response.contentHash)
prepareImages()
contentHandler.reflectEdits(response.edits)
if Object.keys(response.edits).length > 0 then setDirtyState()
else setCleanState()
renderProcess()
return
dataStateRequestError = ->
log "dataStateRequestError"
auth.logout()
return
#endregion
#endregion
############################################################
#region exposedFunctions
adminmodule.start = ->
log "adminmodule.start"
prepareImages()
renderProcess()
return
############################################################
#region noticeStuff
adminmodule.noticeVisibilityChanged = ->
log "adminmodule.noticeVisibilityChanged"
applyEditableVisibility()
return
adminmodule.noticeImageSwaps = (moves) ->
log "adminmodule.noticeImageSwaps"
token = appState.token()
assetType = "images"
dataObject = {assetType, moves, token}
try
await network.scicall("moveAssets", dataObject)
console.log("/moveAssets success!")
catch err
log err
console.log("/moveAssets failure!")
return
return
adminmodule.noticeImagesEdits = (fallback) ->
log "adminmodule.noticeImagesEdits"
newImages(fallback)
return
adminmodule.noticeImagesEdits = (fallback) ->
log "adminmodule.noticeImagesEdits"
newImages(fallback)
return
adminmodule.noticeListEdit = (contentKeyString, newContent, fallback) ->
log "adminmodule.noticeListEdit"
console.log ostr newContent
newContentList(contentKeyString, newContent, fallback)
return
adminmodule.noticeElementEdit = (element, fallback) ->
log "adminmodule.noticeElementEdit"
content = cleanContentHTML(element.innerHTML)
# log ""+element
element.innerHTML = content
contentKeyString = element.getAttribute("text-content-key")
newContentText(contentKeyString, content, fallback)
return
adminmodule.noticeContentChange = -> setDirtyState()
adminmodule.noticeAuthorizationSuccess = ->
log "adminmodule.noticeAuthorization"
token = <KEY>()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop();
communicationObject = {langTag, documentName, token}
try
response = await network.scicall("getDataState", communicationObject)
await handleDataState(response)
catch err then dataStateRequestError()
return
adminmodule.noticeAuthorizationFail = ->
log "adminmodule.noticeAuthorizationFail"
return
#endregion
############################################################
adminmodule.discard = ->
log "adminmodule.discard"
try
langTag = pwaContent.languageTag
await network.scicall("discard", {langTag, token})
contentHandler.reflectEdits({})
setCleanState()
bottomPanel.setSuccessMessage("Alle Änderungen wurden verworfen")
renderProcess()
catch err
bottomPanel.setErrorMessage("Keine Änderungen wurden verworfen!")
return
adminmodule.apply = ->
log "adminmodule.apply"
try
token = <KEY>()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop();
communicationObject = {langTag, documentName, token}
await network.scicall("apply", {langTag, token})
response = await network.scicall("getDataState", communicationObject)
await handleDataState(response)
bottomPanel.setSuccessMessage("Alle Änderungen wurden übernommen")
catch err
bottomPanel.setErrorMessage("Keine Änderungen wurden übernommen!")
return
#endregion
module.exports = adminmodule | true | adminmodule = {name: "adminmodule"}
############################################################
#region printLogFunctions
log = (arg) ->
if adminModules.debugmodule.modulesToDebug["adminmodule"]? then console.log "[adminmodule]: " + arg
return
ostr = (obj) -> JSON.stringify(obj, null, 4)
olog = (obj) -> log "\n" + ostr(obj)
print = (arg) -> console.log(arg)
#endregion
############################################################
#region modulesFromEnvironment
mustache = require "mustache"
############################################################
mustachekeys = null
templatepreparation = null
network = null
adminpanel = null
appState = null
uiState = null
contentHandler = null
bottomPanel = null
floatingPanel = null
bigPanel = null
imageManagement = null
listManagement = null
linkManagement = null
auth = null
#endregion
############################################################
#region internalProperties
currentContentFallback = ""
############################################################
typingSecret = false
loggingIn = false
token = ""
panelVisible = true
showingEditables = false
altIsPressed = 0
#endregion
############################################################
adminmodule.initialize = () ->
log "adminmodule.initialize"
mustachekeys = adminModules.mustachekeysmodule
templatepreparation = adminModules.templatepreparationmodule
network = adminModules.networkmodule
adminpanel = adminModules.adminpanelmodule
appState = adminModules.appstatemodule
uiState = adminModules.uistatemodule
auth = adminModules.authmodule
contentHandler = adminModules.contenthandlermodule
bigPanel = adminModules.bigpanelmodule
floatingPanel = adminModules.floatingpanelmodule
imageManagement = adminModules.imagemanagementmodule
listManagement = adminModules.listmanagementmodule
linkManagement = adminModules.linkmanagementmodule
bottomPanel = adminModules.bottompanelmodule
return
############################################################
#region internalFunctions
renderProcess = ->
log "renderProcess"
content = contentHandler.content()
mustachekeys.createMustacheKeys()
mustacheTemplate = template(pwaMustacheKeymap)
# log mustacheTemplate
shadowBody = document.createElement("body")
shadowBody.innerHTML = mustacheTemplate
templatepreparation.prepareBody(shadowBody)
preparedTemplate = shadowBody.innerHTML
# log preparedTemplate
htmlResult = mustache.render(preparedTemplate, content)
# log htmlResult
newBody = document.createElement("body")
newBody.innerHTML = htmlResult
adminpanel.attachPanelToBody(newBody)
document.body = newBody
##fire document onload again
window.dispatchEvent(new Event("load"))
bigPanel.prepare()
addAdministrativeEventListeners()
applyEditableVisibility()
return
############################################################
addAdministrativeEventListeners = ->
log "addAdministrativeEventListeners"
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editable in allEditableTexts
editable.addEventListener("keyup", editKeyReleased)
editable.addEventListener("keydown", editKeyPressed)
editable.addEventListener("focusin", startedEditing)
editable.addEventListener("focusout", stoppedEditing)
editable.addEventListener("click", editableClicked)
defuseLink(editable)
allEditableImages = document.querySelectorAll("[image-content-key]")
for editable in allEditableImages
editable.addEventListener("click", editableImageClicked)
defuseLink(editable)
return
defuseLink = (element) ->
log "defuseLink"
# while element?
# if element.tagName == "A" then setAttribute("href", "#") element = element.parentElement
return
createLink = ->
log "createLink"
selection = window.getSelection()
rangeCount = selection.rangeCount
if rangeCount > 1 or rangeCount < 1 then return
link = document.createElement("a")
link.setAttribute("href", "#")
range = selection.getRangeAt(0)
range.surroundContents(link)
return
############################################################
#region eventListeners
editableClicked = (event) ->
log "editableClicked"
event.preventDefault()
event.stopPropagation()
return false
editableImageClicked = (event) ->
log "editableImageClicked"
event.preventDefault()
element = event.target
imageLabel = element.getAttribute("image-content-key")
# log imageLabel
# log element
# log element.id
while !imageLabel and element
element = element.parentElement
imageLabel = element.getAttribute("image-content-key")
# log imageLabel
# log element
# log element.id
return unless imageLabel
bigPanel.activateEdit("images", imageLabel)
bottomPanel.applyUIState()
return
editKeyReleased = (event) ->
log "editKeyReleased"
key = event.keyCode
if (key == 18 ) then altIsPressed = false
return
editKeyPressed = (event) ->
log "editKeyPressed"
key = event.keyCode
if (key == 76 and altIsPressed and event.ctrlKey) then createLink()
if (key == 18) then altIsPressed = true
if (key == 27) #escape
this.innerHTML = currentContentFallback
document.activeElement.blur()
return
startedEditing = (event) ->
log "startedEditing"
element = event.target
element.classList.add("editing")
currentContentFallback = cleanContentHTML(element.innerHTML)
activateFloatingPanelFor(element)
return
stoppedEditing = (event) ->
log "stoppedEditing"
floatingPanel.disappear()
element = event.target
isLink = element.getAttribute("is-link")
element.classList.remove("editing")
content = cleanContentHTML(element.innerHTML, isLink)
log "new content: " + content
element.innerHTML = content
# log "new Content: " + content
return if content == currentContentFallback
contentKeyString = element.getAttribute("text-content-key")
newContentText(contentKeyString, content, currentContentFallback)
return
#endregion
############################################################
#region contentCleaning
getCleanBold = (el) ->
# log "getCleanBold"
# log el.innerHTML
el.innerHTML = cleanContentHTML(el.innerHTML)
return el
getCleanAnchor = (el) ->
# log "getCleanAnchor"
# log el.innerHTML
el.innerHTML = cleanContentHTML(el.innerHTML)
# href = el.getAttribute("href")
# if href then el.setAttribute("href", href)
return el
cleanContentHTML = (innerHTML, isLink) ->
# log "cleanContentHTML"
# log innerHTML
el = document.createElement("div")
el.innerHTML = innerHTML
children = [el.children...]
for child in children
if child.tagName == "B" && !isLink then newNode = getCleanBold(child)
else if child.tagName == "A" && !isLink then newNode = getCleanAnchor(child)
else if child.tagName == "BR" && !isLink then newNode = document.createElement("br")
else newNode = cleanContentHTML(child.innerHTML)
# log child.innerHTML
# log child.tagName
if typeof newNode == "string"
if newNode != "<br>" && !isLink then newNode = "<br>"+newNode
child.insertAdjacentHTML("beforebegin", newNode)
el.removeChild(child)
else
el.replaceChild(newNode, child)
return el.innerHTML
#endregion
############################################################
#region contentEditing
applyEditableVisibility = ->
log "applyEditableVisibility"
if uiState.visibleEditables()
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editableText in allEditableTexts
editableText.classList.add("editable-show")
allEditableImages = document.querySelectorAll("[image-content-key]")
for editableImage in allEditableImages
editableImage.classList.add("editable-image")
else
allEditableTexts = document.querySelectorAll("[text-content-key]")
for editableText in allEditableTexts
editableText.classList.remove("editable-show")
allEditableImages = document.querySelectorAll("[image-content-key]")
for editableImage in allEditableImages
editableImage.classList.remove("editable-image")
return
############################################################
newContentText = (contentKeyString, content, fallback) ->
log "newContentText"
log contentKeyString
log content
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
applyEdit(contentKeyString, content)
contentHandler.reflectEdit(contentKeyString, content)
updateSuccess(response)
catch err then revertEdit(contentKeyString, fallback)
return
newContentList = (contentKeyString, content, fallback) ->
log "newContentList"
log contentKeyString
log content
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
listManagement.setNewList(content, contentKeyString)
contentHandler.reflectEdit(contentKeyString, content)
updateSuccess(response)
catch err then revertListEdit(contentKeyString, fallback)
adminmodule.start()
return
newImages = (fallback) ->
log "newImages"
token = appState.token()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop()
content = contentHandler.content().images
contentKeyString = "images"
updateObject = {langTag, documentName, contentKeyString, content, token}
try
response = await network.scicall("update", updateObject)
updateSuccess(response)
catch err then revertImagesEdit(fallback)
return
############################################################
revertImagesEdit = (oldImages) ->
log "revertImagesEdit"
contentHandler.content().images = oldImages
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
return
revertListEdit = (contentKeyString, oldList) ->
log "revertListEdit"
log "actually nothing to do here^^..."
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
return
applyEdit = (contentKeyString, newContent) ->
log "applyEdit"
selector = "[text-content-key='"+contentKeyString+"']"
elements = document.querySelectorAll(selector)
for element in elements
element.innerHTML = newContent
return
revertEdit = (contentKeyString, oldContent) ->
log "revertEdit"
bottomPanel.setErrorMessage("Veränderung konnte nicht angenommen werden!")
selector = "[text-content-key='"+contentKeyString+"']"
elements = document.querySelectorAll(selector)
for element in elements
element.innerHTML = oldContent
return
setCleanState = ->
log "setCleanState"
appState.setClean()
bottomPanel.applyUIState()
return
setDirtyState = ->
log "setDirtyState"
appState.setDirty()
bottomPanel.applyUIState()
return
############################################################
activateFloatingPanelFor = (element) ->
log "activateFloatingPanelFor"
floatingPanel.initializeForElement(element, currentContentFallback)
left = element.getBoundingClientRect().x
bottom = window.innerHeight - element.getBoundingClientRect().y
floatingPanel.appear(left, bottom)
return
#endregion
############################################################
#region networkEvents
updateSuccess = (response) ->
log "updateSuccess"
setDirtyState()
bottomPanel.setSuccessMessage("Veränderung angenommen")
return
prepareImages = ->
log "prepareImages"
content = contentHandler.content()
imageManagement.setImages(content.images)
return
handleDataState = (response) ->
log "handleDataState"
olog response
await contentHandler.prepareOriginal(response.contentHash)
prepareImages()
contentHandler.reflectEdits(response.edits)
if Object.keys(response.edits).length > 0 then setDirtyState()
else setCleanState()
renderProcess()
return
dataStateRequestError = ->
log "dataStateRequestError"
auth.logout()
return
#endregion
#endregion
############################################################
#region exposedFunctions
adminmodule.start = ->
log "adminmodule.start"
prepareImages()
renderProcess()
return
############################################################
#region noticeStuff
adminmodule.noticeVisibilityChanged = ->
log "adminmodule.noticeVisibilityChanged"
applyEditableVisibility()
return
adminmodule.noticeImageSwaps = (moves) ->
log "adminmodule.noticeImageSwaps"
token = appState.token()
assetType = "images"
dataObject = {assetType, moves, token}
try
await network.scicall("moveAssets", dataObject)
console.log("/moveAssets success!")
catch err
log err
console.log("/moveAssets failure!")
return
return
adminmodule.noticeImagesEdits = (fallback) ->
log "adminmodule.noticeImagesEdits"
newImages(fallback)
return
adminmodule.noticeImagesEdits = (fallback) ->
log "adminmodule.noticeImagesEdits"
newImages(fallback)
return
adminmodule.noticeListEdit = (contentKeyString, newContent, fallback) ->
log "adminmodule.noticeListEdit"
console.log ostr newContent
newContentList(contentKeyString, newContent, fallback)
return
adminmodule.noticeElementEdit = (element, fallback) ->
log "adminmodule.noticeElementEdit"
content = cleanContentHTML(element.innerHTML)
# log ""+element
element.innerHTML = content
contentKeyString = element.getAttribute("text-content-key")
newContentText(contentKeyString, content, fallback)
return
adminmodule.noticeContentChange = -> setDirtyState()
adminmodule.noticeAuthorizationSuccess = ->
log "adminmodule.noticeAuthorization"
token = PI:KEY:<KEY>END_PI()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop();
communicationObject = {langTag, documentName, token}
try
response = await network.scicall("getDataState", communicationObject)
await handleDataState(response)
catch err then dataStateRequestError()
return
adminmodule.noticeAuthorizationFail = ->
log "adminmodule.noticeAuthorizationFail"
return
#endregion
############################################################
adminmodule.discard = ->
log "adminmodule.discard"
try
langTag = pwaContent.languageTag
await network.scicall("discard", {langTag, token})
contentHandler.reflectEdits({})
setCleanState()
bottomPanel.setSuccessMessage("Alle Änderungen wurden verworfen")
renderProcess()
catch err
bottomPanel.setErrorMessage("Keine Änderungen wurden verworfen!")
return
adminmodule.apply = ->
log "adminmodule.apply"
try
token = PI:KEY:<KEY>END_PI()
langTag = pwaContent.languageTag
path = window.location.pathname
documentName = path.split("/").pop();
communicationObject = {langTag, documentName, token}
await network.scicall("apply", {langTag, token})
response = await network.scicall("getDataState", communicationObject)
await handleDataState(response)
bottomPanel.setSuccessMessage("Alle Änderungen wurden übernommen")
catch err
bottomPanel.setErrorMessage("Keine Änderungen wurden übernommen!")
return
#endregion
module.exports = adminmodule |
[
{
"context": "if apikey was provided or not\n try msg.user = @user._id if @user?._id?\n msg.unauthorised = true ",
"end": 3647,
"score": 0.9902667999267578,
"start": 3642,
"tag": "USERNAME",
"value": "@user"
},
{
"context": "gs.mail?.feedback?[this.urlParams.token]?.from ? ... | worker/src/log.coffee | oaworks/paradigm | 1 |
S.log ?= {}
_bg_log_batch = []
_bg_log_batch_timeout = false
_bg_last_log_batch = false
P.log = (msg, store) ->
_save_batch = () =>
# TODO may be worth generalising this into index functionality and having an option to bulk any index
# then index calls that are writing data should route to the bg /index functions instead of
# direct to the index, so that they can be temporarily stored and handled in bulk (only suitable for when they can be lost too)
clearTimeout(_bg_log_batch_timeout) if _bg_log_batch_timeout isnt false
_bg_log_batch_timeout = setTimeout _save_batch, 30000
_bg_last_log_batch = Date.now()
_last = (new Date(_bg_last_log_batch)).toISOString().replace('T',' ').split('.')[0]
_batch = []
while _batch.length < 400 and _bg_log_batch.length
_batch.push _bg_log_batch.shift()
if _batch.length
console.log('Writing ' + _batch.length + ' logs to index', _batch[0]._id, _batch[_batch.length-1]._id, _last) if @S.bg is true
if not indexed = await @index 'logs', _batch
await @index 'logs', {}
await @index 'logs', _batch
_batch = []
else if @S.bg is true
console.log 'Checked log batch but none to save', _last
if @S.log isnt false and @nolog isnt true
store = not msg? if store isnt true # an empty call to log stores everything in the _logs list
if typeof msg is 'string'
if msg.indexOf('/') isnt -1 and msg.indexOf(' ') is -1
msg = fn: msg
else
msg = msg: msg
else if Array.isArray msg
@_logs.push(l) for l in msg
msg = undefined
if not msg?
if @parts.length is 1 and @parts[0] is 'log' # should a remote log be allowed to send to a sub-route URL as an ID? maybe with particular auth?
if @system
_bg_log_batch.push @body
_save_batch() if _bg_log_batch_timeout is false
return true # end here, just saving a log received from remote with system credential
else
# receive a remote log - what permissions should be required?
msg = if typeof @body is 'object' then @body else @params # bunch of logs sent in as POST body, or else just params
msg = {logs: msg} if Array.isArray msg
msg ?= {}
try
msg.request =
url: @request.url
method: @request.method
try msg.request.body = @body?
try
msg.request.cf =
colo: @request.cf.colo
country: @request.cf.country
try
msg.request.headers = @headers # just get all headers to see what's useful?
if msg.request.headers.cookie
msg.cookie = true
delete msg.request.headers.cookie
#catch
#try
# msg.request.headers = {}
# msg.headers.ip = (@headers['x-forwarded-for'] ? @headers['x-real-ip']) if @headers['x-real-ip'] or @headers['x-forwarded-for']
# msg.headers['user-agent'] = @headers['user-agent'] if @headers['user-agent']
# msg.headers.referer = @headers.referer if @headers.referer
try
msg.fn = @fn if not msg.fn? and @fn?
msg.refresh = @refresh if @refresh
msg.parts = @parts
msg.completed = @completed if @completed
msg.cached = @cached if @cached
try
# don't stringify the whole obj, allow individual keys, but make them all strings to avoid mapping clashes
msg.params = {}
for p of @params
msg.params[p] = if typeof @params[p] is 'string' then @params[p] else JSON.stringify @params[p]
try msg.apikey = @apikey? # only record if apikey was provided or not
try msg.user = @user._id if @user?._id?
msg.unauthorised = true if @unauthorised
else if typeof msg is 'object' and msg.res and msg.args # this indicates the fn had _diff true
try # find a previous log for the same thing and if it's different add a diff: true to the log of this one. Or diff: false if same, to track that it was diffed
prevs = await @index 'logs', 'args:"' + msg.args + '"' # TODO what if it was a diff on a main log event though? do all log events have child log events now? check. and check what args/params should be compared for diff
prev = prevs.hits.hits[0]._source
msg.diff = if msg.checksum and prev.checksum then (msg.checksum isnt prev.checksum) else (msg.res isnt prev.res)
# if msg.diff, send an email alert? Or have schedule pick up on those later?
if store
if not msg.logs
msg.logs = []
if Array.isArray(this?._logs) and @_logs.length
for l in @_logs
#msg.msg ?= l.msg
msg.alert ?= l.alert if l.alert
msg.notify ?= l.notify if l.notify
msg.logs.push l
msg.createdAt = new Date() #Date.now()
msg.name ?= S.name
msg.version ?= S.version
msg.base = @base
msg.domain = @domain if @domain
msg.bg = true if @S.bg is true
msg.system = true if @system is true
msg.scheduled = true if @scheduled is true
try
msg.started = @started
msg.took = Date.now() - @started
msg._id = @rid
if @S.index?.url?
if @S.bg is true
_bg_log_batch.push msg
if (typeof @S.log is 'object' and @S.log.batch is false) or _bg_log_batch.length > 300 or _bg_last_log_batch is false or Date.now() > (_bg_last_log_batch + 30000)
_save_batch()
else if typeof @S.bg isnt 'string' or (typeof @S.log is 'object' and @S.log.batch is false)
_bg_log_batch.push msg
@waitUntil _save_batch()
else
@waitUntil @fetch @S.bg + '/log', body: msg
else
try
@kv 'logs/' + msg._id, msg
catch
console.log 'Logging unable to save to kv or index'
consolg.log msg
else
@_logs.push msg
else if @S.dev and @S.bg is true
console.log 'NOT logging', msg
return true
P.log._hide = true
P.logs = _index: true, _hide: true, _auth: 'system'
# a user should be able to set a list of endpoints they want to receive notifications for
# could also wildcard* match
# note if there are lots of notifications, may need to group them
# user won't need auth for the endpoint because it won't give any info about the result - just that it happened?
# or if results are wanted, auth for the endpoint would be necessary
# notifications from this will go to a google chat bot webhook
# notifications will be triggered by log analysis, a scheduled job will need to check through them
'''
P.log.monitor = (opts) ->
opts ?= @params
if (opts.email or opts.chat) and opts.q
opts.q = JSON.stringify(opts.q) if typeof opts.q isnt 'string'
opts.frequency ?= 60
# also can provide an opts.name as a nice name for the monitor instead if just the query
return opts
return
P.log.monitor = _index: true
P.log.monitor._schedule = () ->
notify = {}
chat = []
counter = 0
await @index.each 'log_monitor', '*', (rec) ->
if not rec.notified or rec.notified + (rec.frequency * 60000) < @started
rec.notified = @started
@waitUntil @index 'log_monitor/' + rec._id, @copy rec
q = if typeof rec.q is 'string' and rec.q.startsWith('{') then JSON.parse(rec.q) else rec.q
q = await @index.translate q, { newest: true, restrict: [{query_string: {query: 'createdAt:>' + (@started - (rec.frequency * 60000))}}]}
count = await @index.count 'logs', undefined, q
if count
counter += count
rec.dq = q
rec.count = count
if rec.email
notify.email ?= []
notify.email.push rec
if rec.chat
chat.push rec
for e of notify
txt = ''
for n in notify[e]
txt += 'https://bg' + (if @S.dev then 'b' else '') + '.lvatn.com/log?q=' + JSON.stringify(n.dq) + '\n\n'
@waitUntil @mail.send
to: notify[e].email
subject: notify[e].length + ' of your monitors have ' + rec.count + ' new alerts'
text: txt
if chat.length
txt = chat.length + ' monitor notifications:'
for c in chat
txt += '\nhttps://bg' + (if @S.dev then 'b' else '') + '.lvatn.com/log?q=' + JSON.stringify(c.dq)
@waitUntil @src.google.chat txt
return counter
'''
'''
P.add 'mail/feedback/:token',
get: () ->
try
from = this.queryParams.from ? P.settings.mail?.feedback?[this.urlParams.token]?.from ? "sysadmin@cottagelabs.com"
to = P.settings.mail?.feedback?[this.urlParams.token]?.to
service = P.settings.mail?.feedback?[this.urlParams.token]?.service
subject = P.settings.mail?.feedback?[this.urlParams.token]?.subject ? "Feedback"
if to?
P.mail.send
service: service
from: from
to: to
subject: subject
text: this.queryParams.content
return {}
level/loglevel
group (default to whatever is after svc or src, or just part 0)
notify/alert
P.log = (opts, fn, lvl='debug') ->
loglevels = ['all', 'trace', 'debug', 'info', 'warn', 'error', 'fatal', 'off']
loglevel = P.settings.log?.level ? 'all'
if loglevels.indexOf(loglevel) <= loglevels.indexOf opts.level
if opts.notify and P.settings.log?.notify
try
os = @copy opts
catch
os = opts
Meteor.setTimeout (() -> P.notify os), 100
for o of opts
if not opts[o]?
delete opts[o]
else if typeof opts[o] isnt 'string' and not _.isArray opts[o]
try
opts[o] = JSON.stringify opts[o]
catch
try
opts[o] = opts[o].toString()
catch
delete opts[o]
if loglevels.indexOf(loglevel) <= loglevels.indexOf 'debug'
console.log opts.msg if opts.msg
if typeof notify is 'string'
if note.indexOf '@' isnt -1
note = to: note
if typeof note is 'object'
note.text ?= note.msg ? opts.msg
note.subject ?= P.settings.name ? 'API log message'
note.from ?= P.settings.log?.from ? 'alert@cottagelabs.com'
note.to ?= P.settings.log?.to ? 'mark@cottagelabs.com'
P.mail.send note
P.ping = (url,shortid) ->
return false if not url?
url = 'http://' + url if url.indexOf('http') isnt 0
if (not shortid? or shortid is 'random') and spre = pings.find {url:url,redirect:true}
return spre._id
else
obj = {url:url,redirect:true}
if shortid? and shortid isnt 'random'
while already = pings.get shortid
shortid += Random.hexString(2)
obj._id = shortid
return pings.insert obj
# craft an img link and put it in an email, if the email is viewed as html it will load the URL of the img,
# which actually hits this route, and allows us to record stuff about the event
# so for example for oabutton where this was first created for, an image url like this could be created,
# with whatever params are required to be saved, in addition to the nonce.
# On receipt the pinger will grab IP and try to retrieve location data from that too:
# <img src="https://api.cottagelabs.com/ping/p.png?n=<CURRENTNONCE>service=oabutton&id=<USERID>">
P.ping.png = () ->
if not P.settings.ping?.nonce? or this.queryParams.n is P.settings.ping.nonce
data = this.queryParams
delete data.n
data.ip = this.request.headers['x-forwarded-for'] ? this.request.headers['cf-connecting-ip'] ? this.request.headers['x-real-ip']
data.forwarded = this.request.headers['x-forwarded-for']
try
res = HTTP.call 'GET', 'http://ipinfo.io/' + data.ip + (if P.settings?.use?.ipinfo?.token? then '?token=' + P.settings.use.ipinfo.token else '')
info = JSON.parse res.content
data[k] = info[k] for k of info
if data.loc
try
latlon = data.loc.split(',')
data.lat = latlon[0]
data.lon = latlon[1]
pings.insert data
img = new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4z8BQDwAEgAF/posBPQAAAABJRU5ErkJggg==', 'base64');
if this.queryParams.red
img = new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgYAAAAAMAASsJTYQAAAAASUVORK5CYII=', 'base64')
this.response.writeHead 200,
'Content-disposition': "inline; filename=ping.png"
'Content-type': 'image/png'
'Content-length': img.length
'Access-Control-Allow-Origin': '*'
this.response.end img
P.add 'ping/:shortid',
get: () ->
if this.urlParams.shortid is 'random' and this.queryParams.url
# may want to disbale this eventually as it makes it easy to flood the server, if auth is added on other routes
return P.ping this.queryParams.url, this.urlParams.shortid
else if exists = pings.get(this.urlParams.shortid) and exists.url?
count = exists.count ? 0
count += 1
pings.update exists._id, {count:count}
return
statusCode: 302
headers:
'Content-Type': 'text/plain'
'Location': exists.url
body: 'Location: ' + exists.url
else return 404
put:
authRequired: true
action: () ->
# certain user groups can overwrite a shortlink
# TODO: overwrite a short link ID that already exists, or error out
post: () ->
return P.ping (this.request.body.url ? this.queryParams.url), this.urlParams.shortid
delete:
#authRequired: true
action: () ->
if exists = pings.get this.urlParams.shortid
pings.remove exists._id
return true
else
return 404
'''
| 67025 |
S.log ?= {}
_bg_log_batch = []
_bg_log_batch_timeout = false
_bg_last_log_batch = false
P.log = (msg, store) ->
_save_batch = () =>
# TODO may be worth generalising this into index functionality and having an option to bulk any index
# then index calls that are writing data should route to the bg /index functions instead of
# direct to the index, so that they can be temporarily stored and handled in bulk (only suitable for when they can be lost too)
clearTimeout(_bg_log_batch_timeout) if _bg_log_batch_timeout isnt false
_bg_log_batch_timeout = setTimeout _save_batch, 30000
_bg_last_log_batch = Date.now()
_last = (new Date(_bg_last_log_batch)).toISOString().replace('T',' ').split('.')[0]
_batch = []
while _batch.length < 400 and _bg_log_batch.length
_batch.push _bg_log_batch.shift()
if _batch.length
console.log('Writing ' + _batch.length + ' logs to index', _batch[0]._id, _batch[_batch.length-1]._id, _last) if @S.bg is true
if not indexed = await @index 'logs', _batch
await @index 'logs', {}
await @index 'logs', _batch
_batch = []
else if @S.bg is true
console.log 'Checked log batch but none to save', _last
if @S.log isnt false and @nolog isnt true
store = not msg? if store isnt true # an empty call to log stores everything in the _logs list
if typeof msg is 'string'
if msg.indexOf('/') isnt -1 and msg.indexOf(' ') is -1
msg = fn: msg
else
msg = msg: msg
else if Array.isArray msg
@_logs.push(l) for l in msg
msg = undefined
if not msg?
if @parts.length is 1 and @parts[0] is 'log' # should a remote log be allowed to send to a sub-route URL as an ID? maybe with particular auth?
if @system
_bg_log_batch.push @body
_save_batch() if _bg_log_batch_timeout is false
return true # end here, just saving a log received from remote with system credential
else
# receive a remote log - what permissions should be required?
msg = if typeof @body is 'object' then @body else @params # bunch of logs sent in as POST body, or else just params
msg = {logs: msg} if Array.isArray msg
msg ?= {}
try
msg.request =
url: @request.url
method: @request.method
try msg.request.body = @body?
try
msg.request.cf =
colo: @request.cf.colo
country: @request.cf.country
try
msg.request.headers = @headers # just get all headers to see what's useful?
if msg.request.headers.cookie
msg.cookie = true
delete msg.request.headers.cookie
#catch
#try
# msg.request.headers = {}
# msg.headers.ip = (@headers['x-forwarded-for'] ? @headers['x-real-ip']) if @headers['x-real-ip'] or @headers['x-forwarded-for']
# msg.headers['user-agent'] = @headers['user-agent'] if @headers['user-agent']
# msg.headers.referer = @headers.referer if @headers.referer
try
msg.fn = @fn if not msg.fn? and @fn?
msg.refresh = @refresh if @refresh
msg.parts = @parts
msg.completed = @completed if @completed
msg.cached = @cached if @cached
try
# don't stringify the whole obj, allow individual keys, but make them all strings to avoid mapping clashes
msg.params = {}
for p of @params
msg.params[p] = if typeof @params[p] is 'string' then @params[p] else JSON.stringify @params[p]
try msg.apikey = @apikey? # only record if apikey was provided or not
try msg.user = @user._id if @user?._id?
msg.unauthorised = true if @unauthorised
else if typeof msg is 'object' and msg.res and msg.args # this indicates the fn had _diff true
try # find a previous log for the same thing and if it's different add a diff: true to the log of this one. Or diff: false if same, to track that it was diffed
prevs = await @index 'logs', 'args:"' + msg.args + '"' # TODO what if it was a diff on a main log event though? do all log events have child log events now? check. and check what args/params should be compared for diff
prev = prevs.hits.hits[0]._source
msg.diff = if msg.checksum and prev.checksum then (msg.checksum isnt prev.checksum) else (msg.res isnt prev.res)
# if msg.diff, send an email alert? Or have schedule pick up on those later?
if store
if not msg.logs
msg.logs = []
if Array.isArray(this?._logs) and @_logs.length
for l in @_logs
#msg.msg ?= l.msg
msg.alert ?= l.alert if l.alert
msg.notify ?= l.notify if l.notify
msg.logs.push l
msg.createdAt = new Date() #Date.now()
msg.name ?= S.name
msg.version ?= S.version
msg.base = @base
msg.domain = @domain if @domain
msg.bg = true if @S.bg is true
msg.system = true if @system is true
msg.scheduled = true if @scheduled is true
try
msg.started = @started
msg.took = Date.now() - @started
msg._id = @rid
if @S.index?.url?
if @S.bg is true
_bg_log_batch.push msg
if (typeof @S.log is 'object' and @S.log.batch is false) or _bg_log_batch.length > 300 or _bg_last_log_batch is false or Date.now() > (_bg_last_log_batch + 30000)
_save_batch()
else if typeof @S.bg isnt 'string' or (typeof @S.log is 'object' and @S.log.batch is false)
_bg_log_batch.push msg
@waitUntil _save_batch()
else
@waitUntil @fetch @S.bg + '/log', body: msg
else
try
@kv 'logs/' + msg._id, msg
catch
console.log 'Logging unable to save to kv or index'
consolg.log msg
else
@_logs.push msg
else if @S.dev and @S.bg is true
console.log 'NOT logging', msg
return true
P.log._hide = true
P.logs = _index: true, _hide: true, _auth: 'system'
# a user should be able to set a list of endpoints they want to receive notifications for
# could also wildcard* match
# note if there are lots of notifications, may need to group them
# user won't need auth for the endpoint because it won't give any info about the result - just that it happened?
# or if results are wanted, auth for the endpoint would be necessary
# notifications from this will go to a google chat bot webhook
# notifications will be triggered by log analysis, a scheduled job will need to check through them
'''
P.log.monitor = (opts) ->
opts ?= @params
if (opts.email or opts.chat) and opts.q
opts.q = JSON.stringify(opts.q) if typeof opts.q isnt 'string'
opts.frequency ?= 60
# also can provide an opts.name as a nice name for the monitor instead if just the query
return opts
return
P.log.monitor = _index: true
P.log.monitor._schedule = () ->
notify = {}
chat = []
counter = 0
await @index.each 'log_monitor', '*', (rec) ->
if not rec.notified or rec.notified + (rec.frequency * 60000) < @started
rec.notified = @started
@waitUntil @index 'log_monitor/' + rec._id, @copy rec
q = if typeof rec.q is 'string' and rec.q.startsWith('{') then JSON.parse(rec.q) else rec.q
q = await @index.translate q, { newest: true, restrict: [{query_string: {query: 'createdAt:>' + (@started - (rec.frequency * 60000))}}]}
count = await @index.count 'logs', undefined, q
if count
counter += count
rec.dq = q
rec.count = count
if rec.email
notify.email ?= []
notify.email.push rec
if rec.chat
chat.push rec
for e of notify
txt = ''
for n in notify[e]
txt += 'https://bg' + (if @S.dev then 'b' else '') + '.lvatn.com/log?q=' + JSON.stringify(n.dq) + '\n\n'
@waitUntil @mail.send
to: notify[e].email
subject: notify[e].length + ' of your monitors have ' + rec.count + ' new alerts'
text: txt
if chat.length
txt = chat.length + ' monitor notifications:'
for c in chat
txt += '\nhttps://bg' + (if @S.dev then 'b' else '') + '.lvatn.com/log?q=' + JSON.stringify(c.dq)
@waitUntil @src.google.chat txt
return counter
'''
'''
P.add 'mail/feedback/:token',
get: () ->
try
from = this.queryParams.from ? P.settings.mail?.feedback?[this.urlParams.token]?.from ? "<EMAIL>"
to = P.settings.mail?.feedback?[this.urlParams.token]?.to
service = P.settings.mail?.feedback?[this.urlParams.token]?.service
subject = P.settings.mail?.feedback?[this.urlParams.token]?.subject ? "Feedback"
if to?
P.mail.send
service: service
from: from
to: to
subject: subject
text: this.queryParams.content
return {}
level/loglevel
group (default to whatever is after svc or src, or just part 0)
notify/alert
P.log = (opts, fn, lvl='debug') ->
loglevels = ['all', 'trace', 'debug', 'info', 'warn', 'error', 'fatal', 'off']
loglevel = P.settings.log?.level ? 'all'
if loglevels.indexOf(loglevel) <= loglevels.indexOf opts.level
if opts.notify and P.settings.log?.notify
try
os = @copy opts
catch
os = opts
Meteor.setTimeout (() -> P.notify os), 100
for o of opts
if not opts[o]?
delete opts[o]
else if typeof opts[o] isnt 'string' and not _.isArray opts[o]
try
opts[o] = JSON.stringify opts[o]
catch
try
opts[o] = opts[o].toString()
catch
delete opts[o]
if loglevels.indexOf(loglevel) <= loglevels.indexOf 'debug'
console.log opts.msg if opts.msg
if typeof notify is 'string'
if note.indexOf '@' isnt -1
note = to: note
if typeof note is 'object'
note.text ?= note.msg ? opts.msg
note.subject ?= P.settings.name ? 'API log message'
note.from ?= P.settings.log?.from ? '<EMAIL>'
note.to ?= P.settings.log?.to ? '<EMAIL>'
P.mail.send note
P.ping = (url,shortid) ->
return false if not url?
url = 'http://' + url if url.indexOf('http') isnt 0
if (not shortid? or shortid is 'random') and spre = pings.find {url:url,redirect:true}
return spre._id
else
obj = {url:url,redirect:true}
if shortid? and shortid isnt 'random'
while already = pings.get shortid
shortid += Random.hexString(2)
obj._id = shortid
return pings.insert obj
# craft an img link and put it in an email, if the email is viewed as html it will load the URL of the img,
# which actually hits this route, and allows us to record stuff about the event
# so for example for oabutton where this was first created for, an image url like this could be created,
# with whatever params are required to be saved, in addition to the nonce.
# On receipt the pinger will grab IP and try to retrieve location data from that too:
# <img src="https://api.cottagelabs.com/ping/p.png?n=<CURRENTNONCE>service=oabutton&id=<USERID>">
P.ping.png = () ->
if not P.settings.ping?.nonce? or this.queryParams.n is P.settings.ping.nonce
data = this.queryParams
delete data.n
data.ip = this.request.headers['x-forwarded-for'] ? this.request.headers['cf-connecting-ip'] ? this.request.headers['x-real-ip']
data.forwarded = this.request.headers['x-forwarded-for']
try
res = HTTP.call 'GET', 'http://ipinfo.io/' + data.ip + (if P.settings?.use?.ipinfo?.token? then '?token=' + P.settings.use.ipinfo.token else '')
info = JSON.parse res.content
data[k] = info[k] for k of info
if data.loc
try
latlon = data.loc.split(',')
data.lat = latlon[0]
data.lon = latlon[1]
pings.insert data
img = new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4z8BQDwAEgAF/posBPQAAAABJRU5ErkJggg==', 'base64');
if this.queryParams.red
img = new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgYAAAAAMAASsJTYQAAAAASUVORK5CYII=', 'base64')
this.response.writeHead 200,
'Content-disposition': "inline; filename=ping.png"
'Content-type': 'image/png'
'Content-length': img.length
'Access-Control-Allow-Origin': '*'
this.response.end img
P.add 'ping/:shortid',
get: () ->
if this.urlParams.shortid is 'random' and this.queryParams.url
# may want to disbale this eventually as it makes it easy to flood the server, if auth is added on other routes
return P.ping this.queryParams.url, this.urlParams.shortid
else if exists = pings.get(this.urlParams.shortid) and exists.url?
count = exists.count ? 0
count += 1
pings.update exists._id, {count:count}
return
statusCode: 302
headers:
'Content-Type': 'text/plain'
'Location': exists.url
body: 'Location: ' + exists.url
else return 404
put:
authRequired: true
action: () ->
# certain user groups can overwrite a shortlink
# TODO: overwrite a short link ID that already exists, or error out
post: () ->
return P.ping (this.request.body.url ? this.queryParams.url), this.urlParams.shortid
delete:
#authRequired: true
action: () ->
if exists = pings.get this.urlParams.shortid
pings.remove exists._id
return true
else
return 404
'''
| true |
S.log ?= {}
_bg_log_batch = []
_bg_log_batch_timeout = false
_bg_last_log_batch = false
P.log = (msg, store) ->
_save_batch = () =>
# TODO may be worth generalising this into index functionality and having an option to bulk any index
# then index calls that are writing data should route to the bg /index functions instead of
# direct to the index, so that they can be temporarily stored and handled in bulk (only suitable for when they can be lost too)
clearTimeout(_bg_log_batch_timeout) if _bg_log_batch_timeout isnt false
_bg_log_batch_timeout = setTimeout _save_batch, 30000
_bg_last_log_batch = Date.now()
_last = (new Date(_bg_last_log_batch)).toISOString().replace('T',' ').split('.')[0]
_batch = []
while _batch.length < 400 and _bg_log_batch.length
_batch.push _bg_log_batch.shift()
if _batch.length
console.log('Writing ' + _batch.length + ' logs to index', _batch[0]._id, _batch[_batch.length-1]._id, _last) if @S.bg is true
if not indexed = await @index 'logs', _batch
await @index 'logs', {}
await @index 'logs', _batch
_batch = []
else if @S.bg is true
console.log 'Checked log batch but none to save', _last
if @S.log isnt false and @nolog isnt true
store = not msg? if store isnt true # an empty call to log stores everything in the _logs list
if typeof msg is 'string'
if msg.indexOf('/') isnt -1 and msg.indexOf(' ') is -1
msg = fn: msg
else
msg = msg: msg
else if Array.isArray msg
@_logs.push(l) for l in msg
msg = undefined
if not msg?
if @parts.length is 1 and @parts[0] is 'log' # should a remote log be allowed to send to a sub-route URL as an ID? maybe with particular auth?
if @system
_bg_log_batch.push @body
_save_batch() if _bg_log_batch_timeout is false
return true # end here, just saving a log received from remote with system credential
else
# receive a remote log - what permissions should be required?
msg = if typeof @body is 'object' then @body else @params # bunch of logs sent in as POST body, or else just params
msg = {logs: msg} if Array.isArray msg
msg ?= {}
try
msg.request =
url: @request.url
method: @request.method
try msg.request.body = @body?
try
msg.request.cf =
colo: @request.cf.colo
country: @request.cf.country
try
msg.request.headers = @headers # just get all headers to see what's useful?
if msg.request.headers.cookie
msg.cookie = true
delete msg.request.headers.cookie
#catch
#try
# msg.request.headers = {}
# msg.headers.ip = (@headers['x-forwarded-for'] ? @headers['x-real-ip']) if @headers['x-real-ip'] or @headers['x-forwarded-for']
# msg.headers['user-agent'] = @headers['user-agent'] if @headers['user-agent']
# msg.headers.referer = @headers.referer if @headers.referer
try
msg.fn = @fn if not msg.fn? and @fn?
msg.refresh = @refresh if @refresh
msg.parts = @parts
msg.completed = @completed if @completed
msg.cached = @cached if @cached
try
# don't stringify the whole obj, allow individual keys, but make them all strings to avoid mapping clashes
msg.params = {}
for p of @params
msg.params[p] = if typeof @params[p] is 'string' then @params[p] else JSON.stringify @params[p]
try msg.apikey = @apikey? # only record if apikey was provided or not
try msg.user = @user._id if @user?._id?
msg.unauthorised = true if @unauthorised
else if typeof msg is 'object' and msg.res and msg.args # this indicates the fn had _diff true
try # find a previous log for the same thing and if it's different add a diff: true to the log of this one. Or diff: false if same, to track that it was diffed
prevs = await @index 'logs', 'args:"' + msg.args + '"' # TODO what if it was a diff on a main log event though? do all log events have child log events now? check. and check what args/params should be compared for diff
prev = prevs.hits.hits[0]._source
msg.diff = if msg.checksum and prev.checksum then (msg.checksum isnt prev.checksum) else (msg.res isnt prev.res)
# if msg.diff, send an email alert? Or have schedule pick up on those later?
if store
if not msg.logs
msg.logs = []
if Array.isArray(this?._logs) and @_logs.length
for l in @_logs
#msg.msg ?= l.msg
msg.alert ?= l.alert if l.alert
msg.notify ?= l.notify if l.notify
msg.logs.push l
msg.createdAt = new Date() #Date.now()
msg.name ?= S.name
msg.version ?= S.version
msg.base = @base
msg.domain = @domain if @domain
msg.bg = true if @S.bg is true
msg.system = true if @system is true
msg.scheduled = true if @scheduled is true
try
msg.started = @started
msg.took = Date.now() - @started
msg._id = @rid
if @S.index?.url?
if @S.bg is true
_bg_log_batch.push msg
if (typeof @S.log is 'object' and @S.log.batch is false) or _bg_log_batch.length > 300 or _bg_last_log_batch is false or Date.now() > (_bg_last_log_batch + 30000)
_save_batch()
else if typeof @S.bg isnt 'string' or (typeof @S.log is 'object' and @S.log.batch is false)
_bg_log_batch.push msg
@waitUntil _save_batch()
else
@waitUntil @fetch @S.bg + '/log', body: msg
else
try
@kv 'logs/' + msg._id, msg
catch
console.log 'Logging unable to save to kv or index'
consolg.log msg
else
@_logs.push msg
else if @S.dev and @S.bg is true
console.log 'NOT logging', msg
return true
P.log._hide = true
P.logs = _index: true, _hide: true, _auth: 'system'
# a user should be able to set a list of endpoints they want to receive notifications for
# could also wildcard* match
# note if there are lots of notifications, may need to group them
# user won't need auth for the endpoint because it won't give any info about the result - just that it happened?
# or if results are wanted, auth for the endpoint would be necessary
# notifications from this will go to a google chat bot webhook
# notifications will be triggered by log analysis, a scheduled job will need to check through them
'''
P.log.monitor = (opts) ->
opts ?= @params
if (opts.email or opts.chat) and opts.q
opts.q = JSON.stringify(opts.q) if typeof opts.q isnt 'string'
opts.frequency ?= 60
# also can provide an opts.name as a nice name for the monitor instead if just the query
return opts
return
P.log.monitor = _index: true
P.log.monitor._schedule = () ->
notify = {}
chat = []
counter = 0
await @index.each 'log_monitor', '*', (rec) ->
if not rec.notified or rec.notified + (rec.frequency * 60000) < @started
rec.notified = @started
@waitUntil @index 'log_monitor/' + rec._id, @copy rec
q = if typeof rec.q is 'string' and rec.q.startsWith('{') then JSON.parse(rec.q) else rec.q
q = await @index.translate q, { newest: true, restrict: [{query_string: {query: 'createdAt:>' + (@started - (rec.frequency * 60000))}}]}
count = await @index.count 'logs', undefined, q
if count
counter += count
rec.dq = q
rec.count = count
if rec.email
notify.email ?= []
notify.email.push rec
if rec.chat
chat.push rec
for e of notify
txt = ''
for n in notify[e]
txt += 'https://bg' + (if @S.dev then 'b' else '') + '.lvatn.com/log?q=' + JSON.stringify(n.dq) + '\n\n'
@waitUntil @mail.send
to: notify[e].email
subject: notify[e].length + ' of your monitors have ' + rec.count + ' new alerts'
text: txt
if chat.length
txt = chat.length + ' monitor notifications:'
for c in chat
txt += '\nhttps://bg' + (if @S.dev then 'b' else '') + '.lvatn.com/log?q=' + JSON.stringify(c.dq)
@waitUntil @src.google.chat txt
return counter
'''
'''
P.add 'mail/feedback/:token',
get: () ->
try
from = this.queryParams.from ? P.settings.mail?.feedback?[this.urlParams.token]?.from ? "PI:EMAIL:<EMAIL>END_PI"
to = P.settings.mail?.feedback?[this.urlParams.token]?.to
service = P.settings.mail?.feedback?[this.urlParams.token]?.service
subject = P.settings.mail?.feedback?[this.urlParams.token]?.subject ? "Feedback"
if to?
P.mail.send
service: service
from: from
to: to
subject: subject
text: this.queryParams.content
return {}
level/loglevel
group (default to whatever is after svc or src, or just part 0)
notify/alert
P.log = (opts, fn, lvl='debug') ->
loglevels = ['all', 'trace', 'debug', 'info', 'warn', 'error', 'fatal', 'off']
loglevel = P.settings.log?.level ? 'all'
if loglevels.indexOf(loglevel) <= loglevels.indexOf opts.level
if opts.notify and P.settings.log?.notify
try
os = @copy opts
catch
os = opts
Meteor.setTimeout (() -> P.notify os), 100
for o of opts
if not opts[o]?
delete opts[o]
else if typeof opts[o] isnt 'string' and not _.isArray opts[o]
try
opts[o] = JSON.stringify opts[o]
catch
try
opts[o] = opts[o].toString()
catch
delete opts[o]
if loglevels.indexOf(loglevel) <= loglevels.indexOf 'debug'
console.log opts.msg if opts.msg
if typeof notify is 'string'
if note.indexOf '@' isnt -1
note = to: note
if typeof note is 'object'
note.text ?= note.msg ? opts.msg
note.subject ?= P.settings.name ? 'API log message'
note.from ?= P.settings.log?.from ? 'PI:EMAIL:<EMAIL>END_PI'
note.to ?= P.settings.log?.to ? 'PI:EMAIL:<EMAIL>END_PI'
P.mail.send note
P.ping = (url,shortid) ->
return false if not url?
url = 'http://' + url if url.indexOf('http') isnt 0
if (not shortid? or shortid is 'random') and spre = pings.find {url:url,redirect:true}
return spre._id
else
obj = {url:url,redirect:true}
if shortid? and shortid isnt 'random'
while already = pings.get shortid
shortid += Random.hexString(2)
obj._id = shortid
return pings.insert obj
# craft an img link and put it in an email, if the email is viewed as html it will load the URL of the img,
# which actually hits this route, and allows us to record stuff about the event
# so for example for oabutton where this was first created for, an image url like this could be created,
# with whatever params are required to be saved, in addition to the nonce.
# On receipt the pinger will grab IP and try to retrieve location data from that too:
# <img src="https://api.cottagelabs.com/ping/p.png?n=<CURRENTNONCE>service=oabutton&id=<USERID>">
P.ping.png = () ->
if not P.settings.ping?.nonce? or this.queryParams.n is P.settings.ping.nonce
data = this.queryParams
delete data.n
data.ip = this.request.headers['x-forwarded-for'] ? this.request.headers['cf-connecting-ip'] ? this.request.headers['x-real-ip']
data.forwarded = this.request.headers['x-forwarded-for']
try
res = HTTP.call 'GET', 'http://ipinfo.io/' + data.ip + (if P.settings?.use?.ipinfo?.token? then '?token=' + P.settings.use.ipinfo.token else '')
info = JSON.parse res.content
data[k] = info[k] for k of info
if data.loc
try
latlon = data.loc.split(',')
data.lat = latlon[0]
data.lon = latlon[1]
pings.insert data
img = new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4z8BQDwAEgAF/posBPQAAAABJRU5ErkJggg==', 'base64');
if this.queryParams.red
img = new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgYAAAAAMAASsJTYQAAAAASUVORK5CYII=', 'base64')
this.response.writeHead 200,
'Content-disposition': "inline; filename=ping.png"
'Content-type': 'image/png'
'Content-length': img.length
'Access-Control-Allow-Origin': '*'
this.response.end img
P.add 'ping/:shortid',
get: () ->
if this.urlParams.shortid is 'random' and this.queryParams.url
# may want to disbale this eventually as it makes it easy to flood the server, if auth is added on other routes
return P.ping this.queryParams.url, this.urlParams.shortid
else if exists = pings.get(this.urlParams.shortid) and exists.url?
count = exists.count ? 0
count += 1
pings.update exists._id, {count:count}
return
statusCode: 302
headers:
'Content-Type': 'text/plain'
'Location': exists.url
body: 'Location: ' + exists.url
else return 404
put:
authRequired: true
action: () ->
# certain user groups can overwrite a shortlink
# TODO: overwrite a short link ID that already exists, or error out
post: () ->
return P.ping (this.request.body.url ? this.queryParams.url), this.urlParams.shortid
delete:
#authRequired: true
action: () ->
if exists = pings.get this.urlParams.shortid
pings.remove exists._id
return true
else
return 404
'''
|
[
{
"context": ".value\n data = qs.stringify\n sk: sk\n login: @username\n password: @password\n retpath: \"/\"\n res = ",
"end": 1848,
"score": 0.9991225600242615,
"start": 1839,
"tag": "USERNAME",
"value": "@username"
},
{
"context": "gify\n sk: sk\n login: @usern... | lib/components/downloader.coffee | kaikash/yandex-contest-downloader | 1 | chalk = require 'chalk'
axios = require 'axios'
_ = require 'lodash'
{ JSDOM } = require 'jsdom'
qs = require 'querystring'
fs = require 'fs'
helpers = require '../helpers.coffee'
TurndownService = require 'turndown'
path = require 'path'
url = require 'url'
class Downloader
constructor: (@options) ->
unless @options.outputDir
@options.outputDir = @options.contestId
for option of @options
@[option] = @options[option]
Downloader::run = ->
try
unless @contestId
throw new Error 'Contest id is not provided'
if !@session and @username and @password
await @login()
res = await @load()
await @saveContest res.data
catch err
console.log chalk.red err.message
Downloader::load = (path = "/contest/#{@contestId}/problems") ->
res = await axios.get "https://#{@domain}#{path}",
headers:
'Cookie': @_getCookies()
if res.data.indexOf('Для просмотра страницы необходимо ') != -1 ||
res.data.indexOf('To view this page you have to ') != -1
throw new Error 'Need to authirize to view this contest'
if res.data.indexOf('У вас нет прав просматривать это соревнование') != -1 ||
res.data.indexOf('You are not allowed to view this contest') != -1
throw new Error 'You are not allowed to view this contest'
res
Downloader::login = ->
unless @domain == 'official.contest.yandex.ru'
throw new Error 'Login supported only for `official.contest.yandex.ru`'
res = await axios.get "https://#{@domain}/login/"
if _.isArray res.headers['set-cookie']
cookies = res.headers['set-cookie'].reduce (x, y) =>
x + y.split(' ')[0] + ' '
, ''
dom = new JSDOM res.data
sk = dom.window.document.querySelector('body > div.page__main.page__sect > div > form > input[type="hidden"]:nth-child(1)').value
data = qs.stringify
sk: sk
login: @username
password: @password
retpath: "/"
res = await axios.post "https://#{@domain}/login/", data,
headers:
'Cookie': cookies
'Content-Type': 'application/x-www-form-urlencoded'
validateStatus: (status) =>
status >= 200 && status < 303
maxRedirects: 0
unless res.headers['set-cookie']
throw new Error 'Authorization failed'
session = res.headers['set-cookie'][0].split(' ')[0].split('=')[1]
@session = session.slice 0, -1
Downloader::_getCookies = () ->
if @session
return "Contest_Session_id=#{@session};"
""
Downloader::saveContest = (data) ->
dom = new JSDOM data
problemElems = dom.window.document.querySelector(
'body > div.page__main.page__sect > div > ul.tabs-menu.tabs-menu_role_problems'
).childNodes
for problemElem in problemElems
await @saveProblem problemElem.querySelector('a').href
Downloader::saveProblem = (problemUrl) ->
problemName = _.nth(problemUrl.split('/'), -2).toLowerCase()
res = await @load problemUrl
dom = new JSDOM res.data
helpers.mkdir "./#{@outputDir}"
helpers.mkdir "./#{@outputDir}/#{problemName}"
fs.writeFileSync "./#{@outputDir}/#{problemName}/main.#{@extension}", ''
tests = @prepareTests dom
if @tests
@createTests "./#{@outputDir}/#{problemName}/tests", tests
if @readme
await @saveImages "./#{@outputDir}/#{problemName}/images", dom
@createReadme "./#{@outputDir}/#{problemName}/readme.md", dom
Downloader::prepareTests = (dom) ->
result = []
dom.window.document.querySelectorAll('.sample-tests').forEach (elem) ->
headers = elem.querySelectorAll('th')
content = elem.querySelectorAll('td')
tests = _.zip headers, content
elem.innerHTML = ""
result.push
input: content[0].querySelector('pre').textContent
output: content[1].querySelector('pre').textContent
for test in tests
elem.innerHTML += "<h5>#{test[0].textContent}</h5>"
elem.appendChild test[1].querySelector('pre')
result
Downloader::createTests = (testsDir, tests) ->
helpers.mkdir testsDir
for test, ind in tests
fs.writeFileSync path.join(testsDir, "input#{ind+1}.txt"), test.input
fs.writeFileSync path.join(testsDir, "output#{ind+1}.txt"), test.output
Downloader::saveImages = (imagesDir, dom) ->
root = dom.window.document.querySelector '.problem__statement.text'
if root.querySelectorAll('img').length > 0
helpers.mkdir imagesDir
for image in root.querySelectorAll('img')
imageUrl = url.resolve "https://#{@domain}/contest/#{@contestId}/problems", image.src
imageFilename = path.basename imageUrl
image.src = "#{path.basename(imagesDir)}/#{imageFilename}"
await helpers.downloadImage imageUrl, path.join imagesDir, imageFilename
Downloader::createReadme = (filename, dom) ->
turndownService = new TurndownService
turndownService.addRule 'replacePre',
filter: 'pre'
replacement: (content) ->
'```\n' + content + '```\n'
markdown = turndownService.turndown dom.window.document.querySelector '.problem__statement.text'
fs.writeFileSync filename, markdown
module.exports = Downloader | 174242 | chalk = require 'chalk'
axios = require 'axios'
_ = require 'lodash'
{ JSDOM } = require 'jsdom'
qs = require 'querystring'
fs = require 'fs'
helpers = require '../helpers.coffee'
TurndownService = require 'turndown'
path = require 'path'
url = require 'url'
class Downloader
constructor: (@options) ->
unless @options.outputDir
@options.outputDir = @options.contestId
for option of @options
@[option] = @options[option]
Downloader::run = ->
try
unless @contestId
throw new Error 'Contest id is not provided'
if !@session and @username and @password
await @login()
res = await @load()
await @saveContest res.data
catch err
console.log chalk.red err.message
Downloader::load = (path = "/contest/#{@contestId}/problems") ->
res = await axios.get "https://#{@domain}#{path}",
headers:
'Cookie': @_getCookies()
if res.data.indexOf('Для просмотра страницы необходимо ') != -1 ||
res.data.indexOf('To view this page you have to ') != -1
throw new Error 'Need to authirize to view this contest'
if res.data.indexOf('У вас нет прав просматривать это соревнование') != -1 ||
res.data.indexOf('You are not allowed to view this contest') != -1
throw new Error 'You are not allowed to view this contest'
res
Downloader::login = ->
unless @domain == 'official.contest.yandex.ru'
throw new Error 'Login supported only for `official.contest.yandex.ru`'
res = await axios.get "https://#{@domain}/login/"
if _.isArray res.headers['set-cookie']
cookies = res.headers['set-cookie'].reduce (x, y) =>
x + y.split(' ')[0] + ' '
, ''
dom = new JSDOM res.data
sk = dom.window.document.querySelector('body > div.page__main.page__sect > div > form > input[type="hidden"]:nth-child(1)').value
data = qs.stringify
sk: sk
login: @username
password: <PASSWORD>
retpath: "/"
res = await axios.post "https://#{@domain}/login/", data,
headers:
'Cookie': cookies
'Content-Type': 'application/x-www-form-urlencoded'
validateStatus: (status) =>
status >= 200 && status < 303
maxRedirects: 0
unless res.headers['set-cookie']
throw new Error 'Authorization failed'
session = res.headers['set-cookie'][0].split(' ')[0].split('=')[1]
@session = session.slice 0, -1
Downloader::_getCookies = () ->
if @session
return "Contest_Session_id=#{@session};"
""
Downloader::saveContest = (data) ->
dom = new JSDOM data
problemElems = dom.window.document.querySelector(
'body > div.page__main.page__sect > div > ul.tabs-menu.tabs-menu_role_problems'
).childNodes
for problemElem in problemElems
await @saveProblem problemElem.querySelector('a').href
Downloader::saveProblem = (problemUrl) ->
problemName = _.nth(problemUrl.split('/'), -2).toLowerCase()
res = await @load problemUrl
dom = new JSDOM res.data
helpers.mkdir "./#{@outputDir}"
helpers.mkdir "./#{@outputDir}/#{problemName}"
fs.writeFileSync "./#{@outputDir}/#{problemName}/main.#{@extension}", ''
tests = @prepareTests dom
if @tests
@createTests "./#{@outputDir}/#{problemName}/tests", tests
if @readme
await @saveImages "./#{@outputDir}/#{problemName}/images", dom
@createReadme "./#{@outputDir}/#{problemName}/readme.md", dom
Downloader::prepareTests = (dom) ->
result = []
dom.window.document.querySelectorAll('.sample-tests').forEach (elem) ->
headers = elem.querySelectorAll('th')
content = elem.querySelectorAll('td')
tests = _.zip headers, content
elem.innerHTML = ""
result.push
input: content[0].querySelector('pre').textContent
output: content[1].querySelector('pre').textContent
for test in tests
elem.innerHTML += "<h5>#{test[0].textContent}</h5>"
elem.appendChild test[1].querySelector('pre')
result
Downloader::createTests = (testsDir, tests) ->
helpers.mkdir testsDir
for test, ind in tests
fs.writeFileSync path.join(testsDir, "input#{ind+1}.txt"), test.input
fs.writeFileSync path.join(testsDir, "output#{ind+1}.txt"), test.output
Downloader::saveImages = (imagesDir, dom) ->
root = dom.window.document.querySelector '.problem__statement.text'
if root.querySelectorAll('img').length > 0
helpers.mkdir imagesDir
for image in root.querySelectorAll('img')
imageUrl = url.resolve "https://#{@domain}/contest/#{@contestId}/problems", image.src
imageFilename = path.basename imageUrl
image.src = "#{path.basename(imagesDir)}/#{imageFilename}"
await helpers.downloadImage imageUrl, path.join imagesDir, imageFilename
Downloader::createReadme = (filename, dom) ->
turndownService = new TurndownService
turndownService.addRule 'replacePre',
filter: 'pre'
replacement: (content) ->
'```\n' + content + '```\n'
markdown = turndownService.turndown dom.window.document.querySelector '.problem__statement.text'
fs.writeFileSync filename, markdown
module.exports = Downloader | true | chalk = require 'chalk'
axios = require 'axios'
_ = require 'lodash'
{ JSDOM } = require 'jsdom'
qs = require 'querystring'
fs = require 'fs'
helpers = require '../helpers.coffee'
TurndownService = require 'turndown'
path = require 'path'
url = require 'url'
class Downloader
constructor: (@options) ->
unless @options.outputDir
@options.outputDir = @options.contestId
for option of @options
@[option] = @options[option]
Downloader::run = ->
try
unless @contestId
throw new Error 'Contest id is not provided'
if !@session and @username and @password
await @login()
res = await @load()
await @saveContest res.data
catch err
console.log chalk.red err.message
Downloader::load = (path = "/contest/#{@contestId}/problems") ->
res = await axios.get "https://#{@domain}#{path}",
headers:
'Cookie': @_getCookies()
if res.data.indexOf('Для просмотра страницы необходимо ') != -1 ||
res.data.indexOf('To view this page you have to ') != -1
throw new Error 'Need to authirize to view this contest'
if res.data.indexOf('У вас нет прав просматривать это соревнование') != -1 ||
res.data.indexOf('You are not allowed to view this contest') != -1
throw new Error 'You are not allowed to view this contest'
res
Downloader::login = ->
unless @domain == 'official.contest.yandex.ru'
throw new Error 'Login supported only for `official.contest.yandex.ru`'
res = await axios.get "https://#{@domain}/login/"
if _.isArray res.headers['set-cookie']
cookies = res.headers['set-cookie'].reduce (x, y) =>
x + y.split(' ')[0] + ' '
, ''
dom = new JSDOM res.data
sk = dom.window.document.querySelector('body > div.page__main.page__sect > div > form > input[type="hidden"]:nth-child(1)').value
data = qs.stringify
sk: sk
login: @username
password: PI:PASSWORD:<PASSWORD>END_PI
retpath: "/"
res = await axios.post "https://#{@domain}/login/", data,
headers:
'Cookie': cookies
'Content-Type': 'application/x-www-form-urlencoded'
validateStatus: (status) =>
status >= 200 && status < 303
maxRedirects: 0
unless res.headers['set-cookie']
throw new Error 'Authorization failed'
session = res.headers['set-cookie'][0].split(' ')[0].split('=')[1]
@session = session.slice 0, -1
Downloader::_getCookies = () ->
if @session
return "Contest_Session_id=#{@session};"
""
Downloader::saveContest = (data) ->
dom = new JSDOM data
problemElems = dom.window.document.querySelector(
'body > div.page__main.page__sect > div > ul.tabs-menu.tabs-menu_role_problems'
).childNodes
for problemElem in problemElems
await @saveProblem problemElem.querySelector('a').href
Downloader::saveProblem = (problemUrl) ->
problemName = _.nth(problemUrl.split('/'), -2).toLowerCase()
res = await @load problemUrl
dom = new JSDOM res.data
helpers.mkdir "./#{@outputDir}"
helpers.mkdir "./#{@outputDir}/#{problemName}"
fs.writeFileSync "./#{@outputDir}/#{problemName}/main.#{@extension}", ''
tests = @prepareTests dom
if @tests
@createTests "./#{@outputDir}/#{problemName}/tests", tests
if @readme
await @saveImages "./#{@outputDir}/#{problemName}/images", dom
@createReadme "./#{@outputDir}/#{problemName}/readme.md", dom
Downloader::prepareTests = (dom) ->
result = []
dom.window.document.querySelectorAll('.sample-tests').forEach (elem) ->
headers = elem.querySelectorAll('th')
content = elem.querySelectorAll('td')
tests = _.zip headers, content
elem.innerHTML = ""
result.push
input: content[0].querySelector('pre').textContent
output: content[1].querySelector('pre').textContent
for test in tests
elem.innerHTML += "<h5>#{test[0].textContent}</h5>"
elem.appendChild test[1].querySelector('pre')
result
Downloader::createTests = (testsDir, tests) ->
helpers.mkdir testsDir
for test, ind in tests
fs.writeFileSync path.join(testsDir, "input#{ind+1}.txt"), test.input
fs.writeFileSync path.join(testsDir, "output#{ind+1}.txt"), test.output
Downloader::saveImages = (imagesDir, dom) ->
root = dom.window.document.querySelector '.problem__statement.text'
if root.querySelectorAll('img').length > 0
helpers.mkdir imagesDir
for image in root.querySelectorAll('img')
imageUrl = url.resolve "https://#{@domain}/contest/#{@contestId}/problems", image.src
imageFilename = path.basename imageUrl
image.src = "#{path.basename(imagesDir)}/#{imageFilename}"
await helpers.downloadImage imageUrl, path.join imagesDir, imageFilename
Downloader::createReadme = (filename, dom) ->
turndownService = new TurndownService
turndownService.addRule 'replacePre',
filter: 'pre'
replacement: (content) ->
'```\n' + content + '```\n'
markdown = turndownService.turndown dom.window.document.querySelector '.problem__statement.text'
fs.writeFileSync filename, markdown
module.exports = Downloader |
[
{
"context": "= $rootScope.$new()\n @scope.fieldName = \"Test Name\"\n @windowService = $window\n @sa",
"end": 4190,
"score": 0.8811419606208801,
"start": 4181,
"tag": "NAME",
"value": "Test Name"
}
] | Tests/angular-sa-test.coffee | somewhatabstract/ngSomewhatAbstract | 2 | ###
## <reference path="../angular-sa.js"/>
###
describe 'somewhatabstract - angular-sa', ->
Given -> module 'somewhatabstract'
describe 'saHttpActivityInterceptor', ->
Given -> module ($provide) ->
fakeNavigationGuard = jasmine.createSpyObj 'saNavigationGuard', ['registerGuardian']
$provide.value 'saNavigationGuard', fakeNavigationGuard;return
describe 'exists', ->
When => inject (saHttpActivityInterceptor) =>
@saHttpActivityInterceptor = saHttpActivityInterceptor
Then => expect(@saHttpActivityInterceptor).toBeDefined()
describe '#guardian', ->
describe 'is registered', ->
Given => inject (saNavigationGuard) =>
@saNavigationGuard = saNavigationGuard
When => inject (saHttpActivityInterceptor) =>
Then => expect(@saNavigationGuard.registerGuardian).toHaveBeenCalledWith jasmine.any(Function)
describe 'returns undefined when there are no pending requests', ->
Given => inject (saNavigationGuard) =>
saNavigationGuard.registerGuardian.and.callFake (guardian) => @guardian = guardian
inject (saHttpActivityInterceptor) =>
When => @actual = @guardian()
Then => expect(@actual).toBeUndefined()
describe 'returns message when there are pending requests', ->
Given => inject (saNavigationGuard) =>
saNavigationGuard.registerGuardian.and.callFake (guardian) => @guardian = guardian
inject (saHttpActivityInterceptor) => saHttpActivityInterceptor.request { method: "POST" }
When => @actual = @guardian()
Then => expect(@actual).toBeDefined()
describe 'saNavigationGuard', ->
describe 'exists', ->
When => inject (saNavigationGuard) =>
@saNavigationGuard = saNavigationGuard
Then => expect(@saNavigationGuard).toBeDefined()
describe 'saEditableField', ->
Given -> module ($provide) ->
fakeFieldController = jasmine.createSpyObj 'saFieldController', ['showField']
$provide.value 'saFieldController', fakeFieldController;return
describe 'exists', ->
When => inject (saEditableFieldDirective) =>
@saEditableField = saEditableFieldDirective
Then => expect(@saEditableField).toBeDefined()
describe 'compiles', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
@scope.field = 'test'
@htmlFixture = angular.element('<sa-editable-field sa-field-name="Test" ng-model="field"></sa-editable-field>');
When => inject ($compile) =>
$compile(@htmlFixture)(@scope)
@scope.$apply()
Then => @htmlFixture.find('label').length == 1
And => @htmlFixture.find('label').text() == 'Test'
And => @htmlFixture.find('input').length == 1
And => @htmlFixture.find('button').length == 1
describe 'saFieldController', ->
Given -> module ($provide) ->
$provide.value '$window', jasmine.createSpyObj('$window', ['alert']);return
describe 'exists', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
When => inject ($controller) =>
@saFieldController = $controller 'saFieldController', { $scope: @scope }
Then => expect(@saFieldController).toBeDefined()
describe '#showField', ->
describe 'exists', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
When => inject ($controller) =>
@saFieldController = $controller 'saFieldController', { $scope: @scope }
Then => expect(@scope.showField).toEqual jasmine.any(Function)
describe 'calls $window.alert', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert).toHaveBeenCalled()
describe 'alert includes $scope.fieldName', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@scope.fieldName = "Test Name"
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert.calls.mostRecent().args[0]).toMatch /.*Test Name.*/
describe 'alert includes $scope.fieldValue', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@scope.fieldValue = "Test Value"
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert.calls.mostRecent().args[0]).toMatch /.*Test Value.*/ | 61552 | ###
## <reference path="../angular-sa.js"/>
###
describe 'somewhatabstract - angular-sa', ->
Given -> module 'somewhatabstract'
describe 'saHttpActivityInterceptor', ->
Given -> module ($provide) ->
fakeNavigationGuard = jasmine.createSpyObj 'saNavigationGuard', ['registerGuardian']
$provide.value 'saNavigationGuard', fakeNavigationGuard;return
describe 'exists', ->
When => inject (saHttpActivityInterceptor) =>
@saHttpActivityInterceptor = saHttpActivityInterceptor
Then => expect(@saHttpActivityInterceptor).toBeDefined()
describe '#guardian', ->
describe 'is registered', ->
Given => inject (saNavigationGuard) =>
@saNavigationGuard = saNavigationGuard
When => inject (saHttpActivityInterceptor) =>
Then => expect(@saNavigationGuard.registerGuardian).toHaveBeenCalledWith jasmine.any(Function)
describe 'returns undefined when there are no pending requests', ->
Given => inject (saNavigationGuard) =>
saNavigationGuard.registerGuardian.and.callFake (guardian) => @guardian = guardian
inject (saHttpActivityInterceptor) =>
When => @actual = @guardian()
Then => expect(@actual).toBeUndefined()
describe 'returns message when there are pending requests', ->
Given => inject (saNavigationGuard) =>
saNavigationGuard.registerGuardian.and.callFake (guardian) => @guardian = guardian
inject (saHttpActivityInterceptor) => saHttpActivityInterceptor.request { method: "POST" }
When => @actual = @guardian()
Then => expect(@actual).toBeDefined()
describe 'saNavigationGuard', ->
describe 'exists', ->
When => inject (saNavigationGuard) =>
@saNavigationGuard = saNavigationGuard
Then => expect(@saNavigationGuard).toBeDefined()
describe 'saEditableField', ->
Given -> module ($provide) ->
fakeFieldController = jasmine.createSpyObj 'saFieldController', ['showField']
$provide.value 'saFieldController', fakeFieldController;return
describe 'exists', ->
When => inject (saEditableFieldDirective) =>
@saEditableField = saEditableFieldDirective
Then => expect(@saEditableField).toBeDefined()
describe 'compiles', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
@scope.field = 'test'
@htmlFixture = angular.element('<sa-editable-field sa-field-name="Test" ng-model="field"></sa-editable-field>');
When => inject ($compile) =>
$compile(@htmlFixture)(@scope)
@scope.$apply()
Then => @htmlFixture.find('label').length == 1
And => @htmlFixture.find('label').text() == 'Test'
And => @htmlFixture.find('input').length == 1
And => @htmlFixture.find('button').length == 1
describe 'saFieldController', ->
Given -> module ($provide) ->
$provide.value '$window', jasmine.createSpyObj('$window', ['alert']);return
describe 'exists', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
When => inject ($controller) =>
@saFieldController = $controller 'saFieldController', { $scope: @scope }
Then => expect(@saFieldController).toBeDefined()
describe '#showField', ->
describe 'exists', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
When => inject ($controller) =>
@saFieldController = $controller 'saFieldController', { $scope: @scope }
Then => expect(@scope.showField).toEqual jasmine.any(Function)
describe 'calls $window.alert', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert).toHaveBeenCalled()
describe 'alert includes $scope.fieldName', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@scope.fieldName = "<NAME>"
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert.calls.mostRecent().args[0]).toMatch /.*Test Name.*/
describe 'alert includes $scope.fieldValue', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@scope.fieldValue = "Test Value"
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert.calls.mostRecent().args[0]).toMatch /.*Test Value.*/ | true | ###
## <reference path="../angular-sa.js"/>
###
describe 'somewhatabstract - angular-sa', ->
Given -> module 'somewhatabstract'
describe 'saHttpActivityInterceptor', ->
Given -> module ($provide) ->
fakeNavigationGuard = jasmine.createSpyObj 'saNavigationGuard', ['registerGuardian']
$provide.value 'saNavigationGuard', fakeNavigationGuard;return
describe 'exists', ->
When => inject (saHttpActivityInterceptor) =>
@saHttpActivityInterceptor = saHttpActivityInterceptor
Then => expect(@saHttpActivityInterceptor).toBeDefined()
describe '#guardian', ->
describe 'is registered', ->
Given => inject (saNavigationGuard) =>
@saNavigationGuard = saNavigationGuard
When => inject (saHttpActivityInterceptor) =>
Then => expect(@saNavigationGuard.registerGuardian).toHaveBeenCalledWith jasmine.any(Function)
describe 'returns undefined when there are no pending requests', ->
Given => inject (saNavigationGuard) =>
saNavigationGuard.registerGuardian.and.callFake (guardian) => @guardian = guardian
inject (saHttpActivityInterceptor) =>
When => @actual = @guardian()
Then => expect(@actual).toBeUndefined()
describe 'returns message when there are pending requests', ->
Given => inject (saNavigationGuard) =>
saNavigationGuard.registerGuardian.and.callFake (guardian) => @guardian = guardian
inject (saHttpActivityInterceptor) => saHttpActivityInterceptor.request { method: "POST" }
When => @actual = @guardian()
Then => expect(@actual).toBeDefined()
describe 'saNavigationGuard', ->
describe 'exists', ->
When => inject (saNavigationGuard) =>
@saNavigationGuard = saNavigationGuard
Then => expect(@saNavigationGuard).toBeDefined()
describe 'saEditableField', ->
Given -> module ($provide) ->
fakeFieldController = jasmine.createSpyObj 'saFieldController', ['showField']
$provide.value 'saFieldController', fakeFieldController;return
describe 'exists', ->
When => inject (saEditableFieldDirective) =>
@saEditableField = saEditableFieldDirective
Then => expect(@saEditableField).toBeDefined()
describe 'compiles', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
@scope.field = 'test'
@htmlFixture = angular.element('<sa-editable-field sa-field-name="Test" ng-model="field"></sa-editable-field>');
When => inject ($compile) =>
$compile(@htmlFixture)(@scope)
@scope.$apply()
Then => @htmlFixture.find('label').length == 1
And => @htmlFixture.find('label').text() == 'Test'
And => @htmlFixture.find('input').length == 1
And => @htmlFixture.find('button').length == 1
describe 'saFieldController', ->
Given -> module ($provide) ->
$provide.value '$window', jasmine.createSpyObj('$window', ['alert']);return
describe 'exists', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
When => inject ($controller) =>
@saFieldController = $controller 'saFieldController', { $scope: @scope }
Then => expect(@saFieldController).toBeDefined()
describe '#showField', ->
describe 'exists', ->
Given => inject ($rootScope) =>
@scope = $rootScope.$new()
When => inject ($controller) =>
@saFieldController = $controller 'saFieldController', { $scope: @scope }
Then => expect(@scope.showField).toEqual jasmine.any(Function)
describe 'calls $window.alert', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert).toHaveBeenCalled()
describe 'alert includes $scope.fieldName', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@scope.fieldName = "PI:NAME:<NAME>END_PI"
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert.calls.mostRecent().args[0]).toMatch /.*Test Name.*/
describe 'alert includes $scope.fieldValue', ->
Given => inject ($rootScope, $controller, $window) =>
@scope = $rootScope.$new()
@scope.fieldValue = "Test Value"
@windowService = $window
@saFieldController = $controller 'saFieldController', { $scope: @scope }
When => @scope.showField()
Then => expect(@windowService.alert.calls.mostRecent().args[0]).toMatch /.*Test Value.*/ |
[
{
"context": "Struggle\" ]).should.be.false\n\n for pokemon in [ \"Pichu\", \"Raichu\" ]\n testLearnset pokemon, ->\n i",
"end": 1986,
"score": 0.993604838848114,
"start": 1981,
"tag": "NAME",
"value": "Pichu"
},
{
"context": " ]).should.be.false\n\n for pokemon in [ \"Pich... | test/learnsets_spec.coffee | sarenji/pokebattle-sim | 5 | require './helpers'
{_} = require('underscore')
learnsets = require('../shared/learnsets')
{GenerationJSON} = require '../server/generations'
describe "Learnsets:", ->
testLearnset = (pokemon, func) ->
describe pokemon, ->
beforeEach ->
@pokemon = {species: pokemon}
@checkMoveset = learnsets.checkMoveset.bind(
learnsets, GenerationJSON, @pokemon)
func.call(this)
testLearnset "Tyranitar", ->
it "can learn level-up moves once that level, in its own generation", ->
@pokemon.level = 29
@checkMoveset(3, [ "Thrash" ]).should.be.true
it "cannot learn level-up moves if the level has not been reached", ->
@pokemon.level = 28
@checkMoveset(3, [ "Thrash" ]).should.be.false
it "can learn machine moves in its own generation", ->
@pokemon.level = 1
@checkMoveset(2, [ "Attract" ]).should.be.true
it "can learn tutor moves in its own generation", ->
@pokemon.level = 1
@checkMoveset(4, [ "Spite" ]).should.be.true
it "can learn tutor moves below its generation", ->
@pokemon.level = 1
@checkMoveset(4, [ "Seismic Toss" ]).should.be.true
testLearnset "Mewtwo", ->
it "can learn machine moves below its generation", ->
@checkMoveset(2, [ "Bide" ]).should.be.true
it "cannot learn machine moves below a cutoff point", ->
@checkMoveset(3, [ "Bide" ]).should.be.false
testLearnset "Vaporeon", ->
it "can learn Take Down indirectly from Eevee", ->
@checkMoveset(3, [ "Take Down" ]).should.be.true
it "can learn Wish through cross-breeding", ->
@checkMoveset(3, [ "Wish" ]).should.be.true
testLearnset "Smeargle", ->
it "can learn almost any move", ->
@checkMoveset(3, [ "Spore" ]).should.be.true
it "cannot learn Chatter", ->
@checkMoveset(3, [ "Chatter" ]).should.be.false
it "cannot learn Struggle", ->
@checkMoveset(3, [ "Struggle" ]).should.be.false
for pokemon in [ "Pichu", "Raichu" ]
testLearnset pokemon, ->
it "can learn Volt Tackle", ->
@checkMoveset(3, [ "Volt Tackle" ]).should.be.true
it "can learn Encore", ->
@checkMoveset(3, [ "Encore" ]).should.be.true
it "cannot learn Volt Tackle and Encore", ->
@checkMoveset(3, [ "Volt Tackle", "Encore" ]).should.be.false
testLearnset "Rotom", ->
it "Gen 4: learns Overheat in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Overheat" ]).should.be.true
it "Gen 5: learns Overheat in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Overheat" ]).should.be.true
it "Gen 4: learns Overheat and a standard move in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Overheat", "Thunderbolt" ]).should.be.true
it "Gen 5: learns Overheat and a standard move in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Overheat", "Thunderbolt" ]).should.be.true
it "Gen 4: learns Air Slash in its fan forme", ->
@pokemon.forme = "fan"
@checkMoveset(4, [ "Air Slash" ]).should.be.true
it "Gen 5: learns Air Slash in its fan forme", ->
@pokemon.forme = "fan"
@checkMoveset(5, [ "Air Slash" ]).should.be.true
it "Gen 4: learns Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(4, [ "Blizzard" ]).should.be.true
it "Gen 5: learns Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(5, [ "Blizzard" ]).should.be.true
it "Gen 4: learns Leaf Storm in its mow forme", ->
@pokemon.forme = "mow"
@checkMoveset(4, [ "Leaf Storm" ]).should.be.true
it "Gen 5: learns Leaf Storm in its mow forme", ->
@pokemon.forme = "mow"
@checkMoveset(5, [ "Leaf Storm" ]).should.be.true
it "Gen 4: learns Hydro Pump in its wash forme", ->
@pokemon.forme = "wash"
@checkMoveset(4, [ "Hydro Pump" ]).should.be.true
it "Gen 5: learns Hydro Pump in its wash forme", ->
@pokemon.forme = "wash"
@checkMoveset(5, [ "Hydro Pump" ]).should.be.true
it "Gen 4: cannot learn Blizzard in its default forme", ->
@checkMoveset(4, [ "Blizzard" ]).should.be.false
it "Gen 5: cannot learn Blizzard in its default forme", ->
@checkMoveset(5, [ "Blizzard" ]).should.be.false
it "Gen 4: cannot learn Blizzard in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Blizzard", "Overheat" ]).should.be.false
it "Gen 5: cannot learn Blizzard in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Blizzard", "Overheat" ]).should.be.false
it "Gen 4: must know Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(4, [ "Thunderbolt" ]).should.be.false
it "Gen 5: doesn't need to know Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(5, [ "Thunderbolt" ]).should.be.true
testLearnset "Deoxys", ->
it "learns alternate forme moves due to freely switching formes", ->
@pokemon.forme = "attack"
@checkMoveset(4, [ "Spikes" ]).should.be.true
testLearnset "Shaymin", ->
it "learns alternate forme moves due to freely switching formes", ->
@checkMoveset(4, [ "Air Slash" ]).should.be.true
testLearnset "Mamoswine", ->
it "cannot know 4 egg moves", ->
moveset = [ "Bite", "Fissure", "Curse", "Icicle Spear" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Yanmega", ->
it "cannot know 4 egg moves", ->
moveset = [ "Faint Attack", "Leech Life", "Whirlwind", "Reversal" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Tangrowth", ->
it "cannot know 4 egg moves", ->
moveset = [ "Amnesia", "Endeavor", "Leaf Storm", "Power Swap" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Mr. Mime", ->
it "cannot know 4 egg moves", ->
moveset = [ "Charm", "Healing Wish", "Fake Out", "Teeter Dance" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Ambipom", ->
it "cannot know 4 egg moves", ->
moveset = [ "Slam", "Covet", "Beat Up", "Pursuit" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Lickilicky", ->
it "cannot know 4 egg moves", ->
moveset = [ "Amnesia", "Curse", "Belly Drum", "Magnitude" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Roserade", ->
xit "cannot learn Spikes and Sleep Powder", ->
@checkMoveset(4, [ "Spikes", "Sleep Powder" ]).should.be.false
testLearnset "Celebi", ->
it "can learn Nasty Plot", ->
moveset = [ "Nasty Plot" ]
@checkMoveset(4, moveset).should.be.true
testLearnset "Banette", ->
it "can learn an event move but not an egg move", ->
moveset = [ "Cotton Guard", "Pursuit" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Gothitelle", ->
it "can inherit event moves from its pre-evos", ->
moveset = [ "Imprison" ]
@checkMoveset(5, moveset).should.be.true
testLearnset "Gengar", ->
it "learns Sludge Wave from dream world", ->
moveset = [ "Sludge Wave" ]
@checkMoveset(6, moveset).should.be.true
testLearnset "Clefable", ->
it "cannot learn Softboiled if it has Unaware", ->
@pokemon.ability = "Unaware"
moveset = [ "Softboiled" ]
@checkMoveset(6, moveset).should.be.false
it "can learn Softboiled normally", ->
moveset = [ "Softboiled" ]
@checkMoveset(6, moveset).should.be.true
testLearnset "Gliscor", ->
it "cannot learn Defog if it has Poison Heal", ->
@pokemon.ability = "Poison Heal"
moveset = [ "Defog" ]
@checkMoveset(6, moveset).should.be.false
describe "learnableMoves", ->
it "returns all possible learnable moves for a pokemon", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Deoxys"}, 6)
moves.should.containEql("Superpower")
it "returns event moves", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Genesect"}, 6)
moves.should.containEql("Shift Gear")
it "returns dream world moves", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Gengar"}, 6)
moves.should.containEql("Sludge Wave")
it "returns valid moves for battle-only formes", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Darmanitan", forme: "zen"}, 6)
# Only Darmanitan can learn this move; Darumaka can't.
moves.should.containEql("Bulk Up")
# Egg move.
moves.should.containEql("Encore")
it "does not take into account nonstandard learnsets", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Rotom"}, 6)
moves.should.not.containEql("Overheat")
moves.should.not.containEql("Leaf Storm")
moves.should.not.containEql("Hydro Pump")
moves.should.not.containEql("Blizzard")
moves.should.not.containEql("Air Slash")
it "lets pokemon learn nonstandard learnsets if they are of that forme", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Rotom", forme: "wash"}, 6)
moves.should.not.containEql("Overheat")
moves.should.not.containEql("Leaf Storm")
moves.should.containEql("Hydro Pump")
moves.should.not.containEql("Blizzard")
moves.should.not.containEql("Air Slash")
it "returns all moves except Struggle and Chatter if can learn Sketch", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Smeargle"}, 6)
moves.should.not.containEql("Struggle")
moves.should.not.containEql("Chatter")
moves.should.containEql("Sacred Fire")
moves.should.containEql("Aeroblast")
| 36728 | require './helpers'
{_} = require('underscore')
learnsets = require('../shared/learnsets')
{GenerationJSON} = require '../server/generations'
describe "Learnsets:", ->
testLearnset = (pokemon, func) ->
describe pokemon, ->
beforeEach ->
@pokemon = {species: pokemon}
@checkMoveset = learnsets.checkMoveset.bind(
learnsets, GenerationJSON, @pokemon)
func.call(this)
testLearnset "Tyranitar", ->
it "can learn level-up moves once that level, in its own generation", ->
@pokemon.level = 29
@checkMoveset(3, [ "Thrash" ]).should.be.true
it "cannot learn level-up moves if the level has not been reached", ->
@pokemon.level = 28
@checkMoveset(3, [ "Thrash" ]).should.be.false
it "can learn machine moves in its own generation", ->
@pokemon.level = 1
@checkMoveset(2, [ "Attract" ]).should.be.true
it "can learn tutor moves in its own generation", ->
@pokemon.level = 1
@checkMoveset(4, [ "Spite" ]).should.be.true
it "can learn tutor moves below its generation", ->
@pokemon.level = 1
@checkMoveset(4, [ "Seismic Toss" ]).should.be.true
testLearnset "Mewtwo", ->
it "can learn machine moves below its generation", ->
@checkMoveset(2, [ "Bide" ]).should.be.true
it "cannot learn machine moves below a cutoff point", ->
@checkMoveset(3, [ "Bide" ]).should.be.false
testLearnset "Vaporeon", ->
it "can learn Take Down indirectly from Eevee", ->
@checkMoveset(3, [ "Take Down" ]).should.be.true
it "can learn Wish through cross-breeding", ->
@checkMoveset(3, [ "Wish" ]).should.be.true
testLearnset "Smeargle", ->
it "can learn almost any move", ->
@checkMoveset(3, [ "Spore" ]).should.be.true
it "cannot learn Chatter", ->
@checkMoveset(3, [ "Chatter" ]).should.be.false
it "cannot learn Struggle", ->
@checkMoveset(3, [ "Struggle" ]).should.be.false
for pokemon in [ "<NAME>", "<NAME>" ]
testLearnset pokemon, ->
it "can learn Volt Tackle", ->
@checkMoveset(3, [ "Volt Tackle" ]).should.be.true
it "can learn Encore", ->
@checkMoveset(3, [ "Encore" ]).should.be.true
it "cannot learn Volt Tackle and Encore", ->
@checkMoveset(3, [ "Volt Tackle", "Encore" ]).should.be.false
testLearnset "Rotom", ->
it "Gen 4: learns Overheat in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Overheat" ]).should.be.true
it "Gen 5: learns Overheat in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Overheat" ]).should.be.true
it "Gen 4: learns Overheat and a standard move in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Overheat", "Thunderbolt" ]).should.be.true
it "Gen 5: learns Overheat and a standard move in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Overheat", "Thunderbolt" ]).should.be.true
it "Gen 4: learns Air Slash in its fan forme", ->
@pokemon.forme = "fan"
@checkMoveset(4, [ "Air Slash" ]).should.be.true
it "Gen 5: learns Air Slash in its fan forme", ->
@pokemon.forme = "fan"
@checkMoveset(5, [ "Air Slash" ]).should.be.true
it "Gen 4: learns Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(4, [ "Blizzard" ]).should.be.true
it "Gen 5: learns Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(5, [ "Blizzard" ]).should.be.true
it "Gen 4: learns Leaf Storm in its mow forme", ->
@pokemon.forme = "mow"
@checkMoveset(4, [ "Leaf Storm" ]).should.be.true
it "Gen 5: learns Leaf Storm in its mow forme", ->
@pokemon.forme = "mow"
@checkMoveset(5, [ "Leaf Storm" ]).should.be.true
it "Gen 4: learns Hydro Pump in its wash forme", ->
@pokemon.forme = "wash"
@checkMoveset(4, [ "Hydro Pump" ]).should.be.true
it "Gen 5: learns Hydro Pump in its wash forme", ->
@pokemon.forme = "wash"
@checkMoveset(5, [ "Hydro Pump" ]).should.be.true
it "Gen 4: cannot learn Blizzard in its default forme", ->
@checkMoveset(4, [ "Blizzard" ]).should.be.false
it "Gen 5: cannot learn Blizzard in its default forme", ->
@checkMoveset(5, [ "Blizzard" ]).should.be.false
it "Gen 4: cannot learn Blizzard in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Blizzard", "Overheat" ]).should.be.false
it "Gen 5: cannot learn Blizzard in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Blizzard", "Overheat" ]).should.be.false
it "Gen 4: must know Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(4, [ "Thunderbolt" ]).should.be.false
it "Gen 5: doesn't need to know Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(5, [ "Thunderbolt" ]).should.be.true
testLearnset "Deoxys", ->
it "learns alternate forme moves due to freely switching formes", ->
@pokemon.forme = "attack"
@checkMoveset(4, [ "Spikes" ]).should.be.true
testLearnset "Sh<NAME>", ->
it "learns alternate forme moves due to freely switching formes", ->
@checkMoveset(4, [ "Air Slash" ]).should.be.true
testLearnset "Mamoswine", ->
it "cannot know 4 egg moves", ->
moveset = [ "Bite", "Fissure", "Curse", "Icicle Spear" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Yanmega", ->
it "cannot know 4 egg moves", ->
moveset = [ "Faint Attack", "Leech Life", "Whirlwind", "Reversal" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "<NAME>", ->
it "cannot know 4 egg moves", ->
moveset = [ "Amnesia", "Endeavor", "Leaf Storm", "Power Swap" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Mr. Mime", ->
it "cannot know 4 egg moves", ->
moveset = [ "Charm", "Healing Wish", "Fake Out", "Teeter Dance" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Ambipom", ->
it "cannot know 4 egg moves", ->
moveset = [ "Slam", "Covet", "Beat Up", "Pursuit" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "<NAME>", ->
it "cannot know 4 egg moves", ->
moveset = [ "Amnesia", "Curse", "Belly Drum", "Magnitude" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "<NAME>", ->
xit "cannot learn Spikes and Sleep Powder", ->
@checkMoveset(4, [ "Spikes", "Sleep Powder" ]).should.be.false
testLearnset "C<NAME>", ->
it "can learn Nasty Plot", ->
moveset = [ "Nasty Plot" ]
@checkMoveset(4, moveset).should.be.true
testLearnset "<NAME>", ->
it "can learn an event move but not an egg move", ->
moveset = [ "Cotton Guard", "Pursuit" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Gothitelle", ->
it "can inherit event moves from its pre-evos", ->
moveset = [ "Imprison" ]
@checkMoveset(5, moveset).should.be.true
testLearnset "G<NAME>", ->
it "learns Sludge Wave from dream world", ->
moveset = [ "Sludge Wave" ]
@checkMoveset(6, moveset).should.be.true
testLearnset "Clefable", ->
it "cannot learn Softboiled if it has Unaware", ->
@pokemon.ability = "Unaware"
moveset = [ "Softboiled" ]
@checkMoveset(6, moveset).should.be.false
it "can learn Softboiled normally", ->
moveset = [ "Softboiled" ]
@checkMoveset(6, moveset).should.be.true
testLearnset "<NAME>", ->
it "cannot learn Defog if it has Poison Heal", ->
@pokemon.ability = "Poison Heal"
moveset = [ "Defog" ]
@checkMoveset(6, moveset).should.be.false
describe "learnableMoves", ->
it "returns all possible learnable moves for a pokemon", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Deoxys"}, 6)
moves.should.containEql("Superpower")
it "returns event moves", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Genesect"}, 6)
moves.should.containEql("Shift Gear")
it "returns dream world moves", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Gengar"}, 6)
moves.should.containEql("Sludge Wave")
it "returns valid moves for battle-only formes", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Darmanitan", forme: "zen"}, 6)
# Only Darmanitan can learn this move; Darumaka can't.
moves.should.containEql("Bulk Up")
# Egg move.
moves.should.containEql("Encore")
it "does not take into account nonstandard learnsets", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Rotom"}, 6)
moves.should.not.containEql("Overheat")
moves.should.not.containEql("Leaf Storm")
moves.should.not.containEql("Hydro Pump")
moves.should.not.containEql("Blizzard")
moves.should.not.containEql("Air Slash")
it "lets pokemon learn nonstandard learnsets if they are of that forme", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Rotom", forme: "wash"}, 6)
moves.should.not.containEql("Overheat")
moves.should.not.containEql("Leaf Storm")
moves.should.containEql("Hydro Pump")
moves.should.not.containEql("Blizzard")
moves.should.not.containEql("Air Slash")
it "returns all moves except Struggle and Chatter if can learn Sketch", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Smeargle"}, 6)
moves.should.not.containEql("Struggle")
moves.should.not.containEql("Chatter")
moves.should.containEql("Sacred Fire")
moves.should.containEql("Aeroblast")
| true | require './helpers'
{_} = require('underscore')
learnsets = require('../shared/learnsets')
{GenerationJSON} = require '../server/generations'
describe "Learnsets:", ->
testLearnset = (pokemon, func) ->
describe pokemon, ->
beforeEach ->
@pokemon = {species: pokemon}
@checkMoveset = learnsets.checkMoveset.bind(
learnsets, GenerationJSON, @pokemon)
func.call(this)
testLearnset "Tyranitar", ->
it "can learn level-up moves once that level, in its own generation", ->
@pokemon.level = 29
@checkMoveset(3, [ "Thrash" ]).should.be.true
it "cannot learn level-up moves if the level has not been reached", ->
@pokemon.level = 28
@checkMoveset(3, [ "Thrash" ]).should.be.false
it "can learn machine moves in its own generation", ->
@pokemon.level = 1
@checkMoveset(2, [ "Attract" ]).should.be.true
it "can learn tutor moves in its own generation", ->
@pokemon.level = 1
@checkMoveset(4, [ "Spite" ]).should.be.true
it "can learn tutor moves below its generation", ->
@pokemon.level = 1
@checkMoveset(4, [ "Seismic Toss" ]).should.be.true
testLearnset "Mewtwo", ->
it "can learn machine moves below its generation", ->
@checkMoveset(2, [ "Bide" ]).should.be.true
it "cannot learn machine moves below a cutoff point", ->
@checkMoveset(3, [ "Bide" ]).should.be.false
testLearnset "Vaporeon", ->
it "can learn Take Down indirectly from Eevee", ->
@checkMoveset(3, [ "Take Down" ]).should.be.true
it "can learn Wish through cross-breeding", ->
@checkMoveset(3, [ "Wish" ]).should.be.true
testLearnset "Smeargle", ->
it "can learn almost any move", ->
@checkMoveset(3, [ "Spore" ]).should.be.true
it "cannot learn Chatter", ->
@checkMoveset(3, [ "Chatter" ]).should.be.false
it "cannot learn Struggle", ->
@checkMoveset(3, [ "Struggle" ]).should.be.false
for pokemon in [ "PI:NAME:<NAME>END_PI", "PI:NAME:<NAME>END_PI" ]
testLearnset pokemon, ->
it "can learn Volt Tackle", ->
@checkMoveset(3, [ "Volt Tackle" ]).should.be.true
it "can learn Encore", ->
@checkMoveset(3, [ "Encore" ]).should.be.true
it "cannot learn Volt Tackle and Encore", ->
@checkMoveset(3, [ "Volt Tackle", "Encore" ]).should.be.false
testLearnset "Rotom", ->
it "Gen 4: learns Overheat in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Overheat" ]).should.be.true
it "Gen 5: learns Overheat in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Overheat" ]).should.be.true
it "Gen 4: learns Overheat and a standard move in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Overheat", "Thunderbolt" ]).should.be.true
it "Gen 5: learns Overheat and a standard move in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Overheat", "Thunderbolt" ]).should.be.true
it "Gen 4: learns Air Slash in its fan forme", ->
@pokemon.forme = "fan"
@checkMoveset(4, [ "Air Slash" ]).should.be.true
it "Gen 5: learns Air Slash in its fan forme", ->
@pokemon.forme = "fan"
@checkMoveset(5, [ "Air Slash" ]).should.be.true
it "Gen 4: learns Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(4, [ "Blizzard" ]).should.be.true
it "Gen 5: learns Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(5, [ "Blizzard" ]).should.be.true
it "Gen 4: learns Leaf Storm in its mow forme", ->
@pokemon.forme = "mow"
@checkMoveset(4, [ "Leaf Storm" ]).should.be.true
it "Gen 5: learns Leaf Storm in its mow forme", ->
@pokemon.forme = "mow"
@checkMoveset(5, [ "Leaf Storm" ]).should.be.true
it "Gen 4: learns Hydro Pump in its wash forme", ->
@pokemon.forme = "wash"
@checkMoveset(4, [ "Hydro Pump" ]).should.be.true
it "Gen 5: learns Hydro Pump in its wash forme", ->
@pokemon.forme = "wash"
@checkMoveset(5, [ "Hydro Pump" ]).should.be.true
it "Gen 4: cannot learn Blizzard in its default forme", ->
@checkMoveset(4, [ "Blizzard" ]).should.be.false
it "Gen 5: cannot learn Blizzard in its default forme", ->
@checkMoveset(5, [ "Blizzard" ]).should.be.false
it "Gen 4: cannot learn Blizzard in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(4, [ "Blizzard", "Overheat" ]).should.be.false
it "Gen 5: cannot learn Blizzard in its heat forme", ->
@pokemon.forme = "heat"
@checkMoveset(5, [ "Blizzard", "Overheat" ]).should.be.false
it "Gen 4: must know Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(4, [ "Thunderbolt" ]).should.be.false
it "Gen 5: doesn't need to know Blizzard in its frost forme", ->
@pokemon.forme = "frost"
@checkMoveset(5, [ "Thunderbolt" ]).should.be.true
testLearnset "Deoxys", ->
it "learns alternate forme moves due to freely switching formes", ->
@pokemon.forme = "attack"
@checkMoveset(4, [ "Spikes" ]).should.be.true
testLearnset "ShPI:NAME:<NAME>END_PI", ->
it "learns alternate forme moves due to freely switching formes", ->
@checkMoveset(4, [ "Air Slash" ]).should.be.true
testLearnset "Mamoswine", ->
it "cannot know 4 egg moves", ->
moveset = [ "Bite", "Fissure", "Curse", "Icicle Spear" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Yanmega", ->
it "cannot know 4 egg moves", ->
moveset = [ "Faint Attack", "Leech Life", "Whirlwind", "Reversal" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "PI:NAME:<NAME>END_PI", ->
it "cannot know 4 egg moves", ->
moveset = [ "Amnesia", "Endeavor", "Leaf Storm", "Power Swap" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Mr. Mime", ->
it "cannot know 4 egg moves", ->
moveset = [ "Charm", "Healing Wish", "Fake Out", "Teeter Dance" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Ambipom", ->
it "cannot know 4 egg moves", ->
moveset = [ "Slam", "Covet", "Beat Up", "Pursuit" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "PI:NAME:<NAME>END_PI", ->
it "cannot know 4 egg moves", ->
moveset = [ "Amnesia", "Curse", "Belly Drum", "Magnitude" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "PI:NAME:<NAME>END_PI", ->
xit "cannot learn Spikes and Sleep Powder", ->
@checkMoveset(4, [ "Spikes", "Sleep Powder" ]).should.be.false
testLearnset "CPI:NAME:<NAME>END_PI", ->
it "can learn Nasty Plot", ->
moveset = [ "Nasty Plot" ]
@checkMoveset(4, moveset).should.be.true
testLearnset "PI:NAME:<NAME>END_PI", ->
it "can learn an event move but not an egg move", ->
moveset = [ "Cotton Guard", "Pursuit" ]
@checkMoveset(4, moveset).should.be.false
testLearnset "Gothitelle", ->
it "can inherit event moves from its pre-evos", ->
moveset = [ "Imprison" ]
@checkMoveset(5, moveset).should.be.true
testLearnset "GPI:NAME:<NAME>END_PI", ->
it "learns Sludge Wave from dream world", ->
moveset = [ "Sludge Wave" ]
@checkMoveset(6, moveset).should.be.true
testLearnset "Clefable", ->
it "cannot learn Softboiled if it has Unaware", ->
@pokemon.ability = "Unaware"
moveset = [ "Softboiled" ]
@checkMoveset(6, moveset).should.be.false
it "can learn Softboiled normally", ->
moveset = [ "Softboiled" ]
@checkMoveset(6, moveset).should.be.true
testLearnset "PI:NAME:<NAME>END_PI", ->
it "cannot learn Defog if it has Poison Heal", ->
@pokemon.ability = "Poison Heal"
moveset = [ "Defog" ]
@checkMoveset(6, moveset).should.be.false
describe "learnableMoves", ->
it "returns all possible learnable moves for a pokemon", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Deoxys"}, 6)
moves.should.containEql("Superpower")
it "returns event moves", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Genesect"}, 6)
moves.should.containEql("Shift Gear")
it "returns dream world moves", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Gengar"}, 6)
moves.should.containEql("Sludge Wave")
it "returns valid moves for battle-only formes", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Darmanitan", forme: "zen"}, 6)
# Only Darmanitan can learn this move; Darumaka can't.
moves.should.containEql("Bulk Up")
# Egg move.
moves.should.containEql("Encore")
it "does not take into account nonstandard learnsets", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Rotom"}, 6)
moves.should.not.containEql("Overheat")
moves.should.not.containEql("Leaf Storm")
moves.should.not.containEql("Hydro Pump")
moves.should.not.containEql("Blizzard")
moves.should.not.containEql("Air Slash")
it "lets pokemon learn nonstandard learnsets if they are of that forme", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Rotom", forme: "wash"}, 6)
moves.should.not.containEql("Overheat")
moves.should.not.containEql("Leaf Storm")
moves.should.containEql("Hydro Pump")
moves.should.not.containEql("Blizzard")
moves.should.not.containEql("Air Slash")
it "returns all moves except Struggle and Chatter if can learn Sketch", ->
learnableMoves = learnsets.learnableMoves.bind(learnsets, GenerationJSON)
moves = learnableMoves({species: "Smeargle"}, 6)
moves.should.not.containEql("Struggle")
moves.should.not.containEql("Chatter")
moves.should.containEql("Sacred Fire")
moves.should.containEql("Aeroblast")
|
[
{
"context": "Style = fillColorString\n context.fill()\n #// Sri Lanka Drawing\n context.beginPath()\n context.move",
"end": 6753,
"score": 0.6842114329338074,
"start": 6745,
"tag": "NAME",
"value": "Sri Lank"
}
] | src/maps/SimpleWorldMapIconAppearance.coffee | intensifier/Fizzygum | 110 | class SimpleWorldMapIconAppearance extends IconAppearance
constructor: (@morph) ->
super
@preferredSize = new Point 500, 265
@specificationSize = new Point 1000, 530
paintFunction: (context) ->
fillColor = @morph.color
fillColorString = fillColor.toString()
#// October revol + Bolshevik Islands Drawing
context.beginPath()
context.moveTo 732, 22
context.lineTo 738, 20
context.lineTo 762, 33
context.lineTo 748, 35
context.lineTo 728, 29
context.lineTo 732, 22
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Svalbard Drawing
context.beginPath()
context.moveTo 525, 21
context.lineTo 542, 23
context.lineTo 544, 28
context.lineTo 528, 31
context.lineTo 537, 42
context.lineTo 528, 42
context.lineTo 525, 36
context.lineTo 520, 42
context.lineTo 509, 42
context.lineTo 508, 35
context.lineTo 503, 30
context.lineTo 506, 26
context.lineTo 525, 21
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Zemlya Georga + other islands Drawing
context.save()
context.translate 81, -263
context.beginPath()
context.moveTo 547, 277
context.lineTo 558, 274
context.lineTo 557, 284
context.lineTo 548, 287
context.lineTo 517, 288
context.lineTo 515, 284
context.lineTo 535, 278
context.lineTo 547, 277
context.closePath()
context.fillStyle = fillColorString
context.fill()
context.restore()
#// Novaya Zemlya Drawing
context.beginPath()
context.moveTo 639, 46
context.lineTo 659, 41
context.lineTo 658, 46
context.lineTo 643, 49
context.lineTo 635, 53
context.lineTo 625, 60
context.lineTo 627, 73
context.lineTo 616, 71
context.lineTo 614, 67
context.lineTo 621, 50
context.lineTo 639, 46
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 3 Drawing
context.beginPath()
context.moveTo 854, 46
context.lineTo 859, 46
context.lineTo 859, 50
context.lineTo 856, 53
context.lineTo 854, 52
context.lineTo 854, 46
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 2 Drawing
context.beginPath()
context.moveTo 862, 48
context.lineTo 868, 51
context.lineTo 863, 52
context.lineTo 862, 48
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 1 Drawing
context.beginPath()
context.moveTo 859, 55
context.lineTo 868, 60
context.lineTo 859, 60
context.lineTo 859, 55
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Iceland Drawing
context.beginPath()
context.moveTo 405, 98
context.lineTo 411, 91
context.lineTo 416, 96
context.lineTo 427, 94
context.lineTo 429, 103
context.lineTo 412, 110
context.lineTo 405, 98
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// GB Drawing
context.beginPath()
context.moveTo 454, 128
context.lineTo 460, 126
context.lineTo 459, 131
context.lineTo 463, 132
context.lineTo 468, 146
context.lineTo 472, 149
context.lineTo 471, 155
context.lineTo 457, 159
context.lineTo 460, 154
context.lineTo 454, 152
context.lineTo 460, 146
context.lineTo 454, 128
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Ireland Drawing
context.beginPath()
context.moveTo 443, 147
context.lineTo 452, 143
context.lineTo 451, 152
context.lineTo 448, 156
context.lineTo 443, 156
context.lineTo 443, 147
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Japan Drawing
context.beginPath()
context.moveTo 864, 158
context.lineTo 868, 151
context.lineTo 868, 168
context.lineTo 866, 181
context.lineTo 873, 188
context.lineTo 861, 196
context.lineTo 862, 205
context.lineTo 857, 219
context.lineTo 844, 223
context.lineTo 831, 229
context.lineTo 831, 222
context.lineTo 855, 206
context.lineTo 858, 194
context.lineTo 865, 172
context.lineTo 864, 158
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sardinia Drawing
context.beginPath()
context.moveTo 493, 203
context.lineTo 492, 197
context.lineTo 494, 195
context.lineTo 495, 203
context.lineTo 493, 203
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Cuba Drawing
context.beginPath()
context.moveTo 236, 257
context.lineTo 248, 258
context.lineTo 262, 264
context.lineTo 255, 266
context.lineTo 246, 261
context.lineTo 238, 260
context.lineTo 236, 257
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Haiti + Dominican Republic Drawing
context.beginPath()
context.moveTo 270, 267
context.lineTo 279, 272
context.lineTo 265, 273
context.lineTo 270, 267
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Philippines Drawing
context.beginPath()
context.moveTo 805, 272
context.lineTo 808, 274
context.lineTo 816, 296
context.lineTo 819, 313
context.lineTo 811, 311
context.lineTo 805, 296
context.lineTo 802, 276
context.lineTo 805, 272
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// South America Drawing
context.beginPath()
context.moveTo 266, 296
context.lineTo 281, 296
context.lineTo 297, 300
context.lineTo 313, 311
context.lineTo 325, 315
context.lineTo 334, 334
context.lineTo 369, 346
context.lineTo 373, 358
context.lineTo 365, 371
context.lineTo 358, 393
context.lineTo 352, 405
context.lineTo 338, 412
context.lineTo 326, 436
context.lineTo 317, 445
context.lineTo 310, 455
context.lineTo 296, 462
context.lineTo 285, 481
context.lineTo 285, 496
context.lineTo 279, 509
context.lineTo 284, 520
context.lineTo 278, 524
context.lineTo 269, 523
context.lineTo 262, 506
context.lineTo 260, 483
context.lineTo 262, 468
context.lineTo 268, 440
context.lineTo 270, 421
context.lineTo 271, 389
context.lineTo 261, 380
context.lineTo 255, 371
context.lineTo 246, 354
context.lineTo 249, 333
context.lineTo 256, 320
context.lineTo 255, 309
context.lineTo 266, 296
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sri Lanka Drawing
context.beginPath()
context.moveTo 691, 303
context.lineTo 696, 310
context.lineTo 691, 313
context.lineTo 691, 303
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Kalimantan Drawing
context.beginPath()
context.moveTo 773, 325
context.lineTo 797, 311
context.lineTo 797, 325
context.lineTo 792, 344
context.lineTo 775, 340
context.lineTo 773, 325
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sulawesi Drawing
context.beginPath()
context.moveTo 803, 330
context.lineTo 810, 330
context.lineTo 811, 351
context.lineTo 800, 348
context.lineTo 803, 330
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Papua Drawing
context.beginPath()
context.moveTo 833, 335
context.lineTo 867, 346
context.lineTo 877, 352
context.lineTo 884, 367
context.lineTo 855, 359
context.lineTo 849, 350
context.lineTo 839, 345
context.lineTo 833, 335
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Java Drawing
context.beginPath()
context.moveTo 763, 351
context.lineTo 789, 355
context.lineTo 795, 361
context.lineTo 783, 360
context.lineTo 763, 354
context.lineTo 763, 351
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Madagascar Drawing
context.beginPath()
context.moveTo 607, 368
context.lineTo 602, 395
context.lineTo 595, 403
context.lineTo 590, 398
context.lineTo 594, 387
context.lineTo 592, 377
context.lineTo 607, 368
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Australia Drawing
context.beginPath()
context.moveTo 860, 388
context.lineTo 864, 370
context.lineTo 876, 391
context.lineTo 887, 409
context.lineTo 892, 421
context.lineTo 890, 442
context.lineTo 883, 458
context.lineTo 871, 462
context.lineTo 857, 456
context.lineTo 850, 451
context.lineTo 843, 441
context.lineTo 837, 438
context.lineTo 826, 436
context.lineTo 812, 441
context.lineTo 804, 441
context.lineTo 791, 445
context.lineTo 791, 435
context.lineTo 786, 419
context.lineTo 785, 403
context.lineTo 804, 395
context.lineTo 809, 390
context.lineTo 817, 380
context.lineTo 827, 380
context.lineTo 833, 371
context.lineTo 847, 371
context.lineTo 847, 383
context.lineTo 860, 388
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// New Zealand Drawing
context.beginPath()
context.moveTo 949, 449
context.lineTo 965, 462
context.lineTo 943, 489
context.lineTo 934, 493
context.lineTo 931, 488
context.lineTo 946, 472
context.lineTo 956, 461
context.lineTo 949, 449
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Tasmania Drawing
context.beginPath()
context.moveTo 870, 469
context.lineTo 880, 469
context.lineTo 878, 478
context.lineTo 872, 476
context.lineTo 870, 469
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Corsica Drawing
context.beginPath()
context.moveTo 493, 195
context.lineTo 493, 192
context.lineTo 494, 191
context.lineTo 494, 195
context.lineTo 493, 195
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Africa Drawing
context.beginPath()
context.moveTo 477, 210
context.lineTo 490, 211
context.lineTo 499, 211
context.lineTo 498, 223
context.lineTo 518, 232
context.lineTo 531, 225
context.lineTo 550, 230
context.lineTo 558, 229
context.lineTo 574, 269
context.lineTo 592, 297
context.lineTo 611, 294
context.lineTo 609, 307
context.lineTo 602, 319
context.lineTo 582, 337
context.lineTo 578, 349
context.lineTo 582, 364
context.lineTo 578, 378
context.lineTo 566, 387
context.lineTo 568, 396
context.lineTo 560, 406
context.lineTo 553, 417
context.lineTo 532, 426
context.lineTo 524, 426
context.lineTo 521, 423
context.lineTo 513, 408
context.lineTo 505, 388
context.lineTo 503, 374
context.lineTo 508, 357
context.lineTo 494, 334
context.lineTo 494, 322
context.lineTo 486, 318
context.lineTo 483, 313
context.lineTo 444, 318
context.lineTo 426, 295
context.lineTo 424, 290
context.lineTo 423, 262
context.lineTo 428, 250
context.lineTo 440, 235
context.lineTo 443, 227
context.lineTo 454, 215
context.lineTo 463, 216
context.lineTo 471, 212
context.lineTo 477, 210
context.lineTo 477, 210
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Greenland Drawing
context.beginPath()
context.moveTo 353, 5
context.lineTo 370, 3
context.lineTo 407, 6
context.lineTo 435, 17
context.lineTo 425, 23
context.lineTo 415, 34
context.lineTo 420, 40
context.lineTo 419, 51
context.lineTo 410, 59
context.lineTo 413, 71
context.lineTo 401, 80
context.lineTo 360, 97
context.lineTo 350, 121
context.lineTo 336, 116
context.lineTo 328, 83
context.lineTo 313, 52
context.lineTo 306, 46
context.lineTo 300, 44
context.lineTo 272, 43
context.lineTo 271, 31
context.lineTo 287, 28
context.lineTo 301, 12
context.lineTo 314, 10
context.lineTo 326, 12
context.lineTo 353, 5
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Noth America Drawing
context.beginPath()
context.moveTo 287, 23
context.lineTo 278, 23
context.lineTo 258, 36
context.lineTo 253, 37
context.lineTo 247, 54
context.lineTo 254, 55
context.lineTo 257, 61
context.lineTo 264, 62
context.lineTo 267, 68
context.lineTo 276, 70
context.lineTo 281, 76
context.lineTo 282, 82
context.lineTo 300, 88
context.lineTo 293, 98
context.lineTo 285, 94
context.lineTo 289, 100
context.lineTo 289, 104
context.lineTo 283, 105
context.lineTo 286, 111
context.lineTo 272, 109
context.lineTo 266, 104
context.lineTo 253, 104
context.lineTo 253, 100
context.lineTo 266, 98
context.lineTo 268, 86
context.lineTo 259, 84
context.lineTo 257, 76
context.lineTo 241, 76
context.lineTo 245, 91
context.lineTo 236, 95
context.lineTo 241, 103
context.lineTo 239, 106
context.lineTo 235, 107
context.lineTo 221, 103
context.lineTo 210, 114
context.lineTo 207, 124
context.lineTo 212, 126
context.lineTo 214, 132
context.lineTo 221, 133
context.lineTo 230, 139
context.lineTo 241, 143
context.lineTo 240, 149
context.lineTo 249, 155
context.lineTo 248, 145
context.lineTo 250, 142
context.lineTo 256, 138
context.lineTo 255, 128
context.lineTo 252, 123
context.lineTo 254, 112
context.lineTo 265, 110
context.lineTo 269, 111
context.lineTo 275, 116
context.lineTo 280, 125
context.lineTo 287, 123
context.lineTo 291, 120
context.lineTo 298, 134
context.lineTo 310, 145
context.lineTo 313, 160
context.lineTo 327, 168
context.lineTo 326, 172
context.lineTo 306, 169
context.lineTo 311, 156
context.lineTo 299, 159
context.lineTo 294, 160
context.lineTo 295, 176
context.lineTo 302, 179
context.lineTo 286, 186
context.lineTo 283, 181
context.lineTo 278, 185
context.lineTo 273, 193
context.lineTo 263, 201
context.lineTo 257, 217
context.lineTo 252, 222
context.lineTo 242, 232
context.lineTo 246, 245
context.lineTo 244, 249
context.lineTo 235, 233
context.lineTo 206, 236
context.lineTo 201, 240
context.lineTo 199, 252
context.lineTo 198, 260
context.lineTo 203, 270
context.lineTo 214, 271
context.lineTo 218, 269
context.lineTo 226, 262
context.lineTo 224, 280
context.lineTo 238, 284
context.lineTo 239, 300
context.lineTo 255, 304
context.lineTo 241, 306
context.lineTo 234, 302
context.lineTo 228, 292
context.lineTo 221, 287
context.lineTo 205, 280
context.lineTo 187, 276
context.lineTo 180, 272
context.lineTo 175, 267
context.lineTo 174, 258
context.lineTo 169, 249
context.lineTo 163, 240
context.lineTo 151, 230
context.lineTo 164, 255
context.lineTo 153, 245
context.lineTo 141, 221
context.lineTo 134, 218
context.lineTo 130, 207
context.lineTo 125, 203
context.lineTo 122, 186
context.lineTo 122, 163
context.lineTo 113, 161
context.lineTo 111, 149
context.lineTo 83, 124
context.lineTo 57, 116
context.lineTo 56, 119
context.lineTo 47, 122
context.lineTo 48, 117
context.lineTo 42, 120
context.lineTo 39, 126
context.lineTo 30, 136
context.lineTo 12, 143
context.lineTo 21, 135
context.lineTo 28, 132
context.lineTo 30, 124
context.lineTo 12, 118
context.lineTo 8, 111
context.lineTo 12, 106
context.lineTo 19, 105
context.lineTo 20, 100
context.lineTo 5, 99
context.lineTo 3, 94
context.lineTo 19, 93
context.lineTo 8, 80
context.lineTo 23, 70
context.lineTo 57, 72
context.lineTo 89, 78
context.lineTo 113, 71
context.lineTo 119, 75
context.lineTo 144, 78
context.lineTo 144, 69
context.lineTo 128, 68
context.lineTo 125, 56
context.lineTo 131, 52
context.lineTo 148, 52
context.lineTo 148, 45
context.lineTo 130, 45
context.lineTo 125, 42
context.lineTo 162, 30
context.lineTo 207, 31
context.lineTo 204, 17
context.lineTo 215, 16
context.lineTo 227, 10
context.lineTo 235, 11
context.lineTo 269, 6
context.lineTo 291, 7
context.lineTo 301, 12
context.lineTo 287, 23
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Eurasia Drawing
context.beginPath()
context.moveTo 762, 38
context.lineTo 767, 42
context.lineTo 781, 42
context.lineTo 787, 52
context.lineTo 775, 55
context.lineTo 776, 58
context.lineTo 788, 56
context.lineTo 798, 59
context.lineTo 796, 60
context.lineTo 810, 62
context.lineTo 813, 57
context.lineTo 826, 63
context.lineTo 831, 71
context.lineTo 849, 70
context.lineTo 856, 69
context.lineTo 861, 62
context.lineTo 885, 67
context.lineTo 899, 71
context.lineTo 912, 71
context.lineTo 915, 76
context.lineTo 955, 76
context.lineTo 996, 97
context.lineTo 990, 104
context.lineTo 981, 103
context.lineTo 973, 100
context.lineTo 965, 102
context.lineTo 966, 112
context.lineTo 941, 122
context.lineTo 927, 122
context.lineTo 925, 124
context.lineTo 922, 137
context.lineTo 919, 145
context.lineTo 914, 151
context.lineTo 905, 159
context.lineTo 904, 156
context.lineTo 902, 143
context.lineTo 907, 131
context.lineTo 917, 123
context.lineTo 922, 120
context.lineTo 921, 116
context.lineTo 911, 115
context.lineTo 905, 116
context.lineTo 900, 124
context.lineTo 863, 124
context.lineTo 847, 143
context.lineTo 859, 149
context.lineTo 859, 167
context.lineTo 848, 183
context.lineTo 842, 191
context.lineTo 834, 189
context.lineTo 827, 200
context.lineTo 829, 216
context.lineTo 821, 220
context.lineTo 816, 204
context.lineTo 814, 201
context.lineTo 805, 198
context.lineTo 796, 207
context.lineTo 808, 210
context.lineTo 810, 212
context.lineTo 801, 218
context.lineTo 806, 228
context.lineTo 800, 252
context.lineTo 790, 260
context.lineTo 768, 266
context.lineTo 760, 272
context.lineTo 768, 280
context.lineTo 774, 294
context.lineTo 764, 304
context.lineTo 750, 293
context.lineTo 748, 305
context.lineTo 750, 311
context.lineTo 759, 327
context.lineTo 753, 326
context.lineTo 751, 322
context.lineTo 744, 301
context.lineTo 739, 278
context.lineTo 732, 281
context.lineTo 725, 261
context.lineTo 715, 263
context.lineTo 709, 268
context.lineTo 693, 282
context.lineTo 689, 302
context.lineTo 682, 305
context.lineTo 677, 295
context.lineTo 674, 285
context.lineTo 671, 264
context.lineTo 665, 266
context.lineTo 655, 249
context.lineTo 644, 252
context.lineTo 633, 249
context.lineTo 616, 243
context.lineTo 608, 234
context.lineTo 606, 235
context.lineTo 605, 241
context.lineTo 610, 248
context.lineTo 615, 250
context.lineTo 635, 258
context.lineTo 627, 274
context.lineTo 621, 278
context.lineTo 594, 291
context.lineTo 590, 279
context.lineTo 566, 236
context.lineTo 562, 236
context.lineTo 559, 229
context.lineTo 567, 228
context.lineTo 569, 213
context.lineTo 549, 212
context.lineTo 547, 210
context.lineTo 543, 199
context.lineTo 559, 194
context.lineTo 566, 193
context.lineTo 585, 196
context.lineTo 582, 189
context.lineTo 576, 184
context.lineTo 570, 183
context.lineTo 556, 178
context.lineTo 553, 180
context.lineTo 549, 187
context.lineTo 548, 195
context.lineTo 536, 198
context.lineTo 534, 211
context.lineTo 531, 209
context.lineTo 524, 195
context.lineTo 505, 181
context.lineTo 505, 187
context.lineTo 514, 196
context.lineTo 521, 201
context.lineTo 516, 201
context.lineTo 511, 211
context.lineTo 505, 208
context.lineTo 513, 204
context.lineTo 505, 196
context.lineTo 495, 185
context.lineTo 488, 186
context.lineTo 478, 190
context.lineTo 470, 201
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 456, 212
context.lineTo 444, 205
context.lineTo 448, 188
context.lineTo 458, 187
context.lineTo 467, 187
context.lineTo 467, 180
context.lineTo 459, 168
context.lineTo 481, 155
context.lineTo 485, 150
context.lineTo 493, 148
context.lineTo 493, 134
context.lineTo 499, 132
context.lineTo 499, 139
context.lineTo 505, 139
context.lineTo 524, 132
context.lineTo 536, 115
context.lineTo 527, 107
context.lineTo 536, 93
context.lineTo 531, 91
context.lineTo 514, 112
context.lineTo 514, 124
context.lineTo 506, 132
context.lineTo 499, 124
context.lineTo 493, 128
context.lineTo 489, 115
context.lineTo 516, 86
context.lineTo 513, 81
context.lineTo 534, 69
context.lineTo 551, 70
context.lineTo 559, 78
context.lineTo 568, 80
context.lineTo 577, 83
context.lineTo 582, 92
context.lineTo 575, 94
context.lineTo 564, 91
context.lineTo 573, 102
context.lineTo 576, 104
context.lineTo 584, 95
context.lineTo 590, 93
context.lineTo 592, 83
context.lineTo 597, 83
context.lineTo 597, 92
context.lineTo 610, 85
context.lineTo 628, 83
context.lineTo 639, 78
context.lineTo 642, 79
context.lineTo 660, 85
context.lineTo 658, 73
context.lineTo 659, 68
context.lineTo 666, 58
context.lineTo 678, 63
context.lineTo 694, 63
context.lineTo 697, 57
context.lineTo 710, 56
context.lineTo 715, 47
context.lineTo 751, 43
context.lineTo 753, 41
context.lineTo 754, 39
context.lineTo 762, 38
context.lineTo 762, 38
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sumatra Drawing
context.beginPath()
context.moveTo 764, 341
context.lineTo 762, 350
context.lineTo 754, 345
context.lineTo 748, 336
context.lineTo 736, 315
context.lineTo 748, 323
context.lineTo 764, 341
context.closePath()
context.fillStyle = fillColorString
context.fill()
| 90947 | class SimpleWorldMapIconAppearance extends IconAppearance
constructor: (@morph) ->
super
@preferredSize = new Point 500, 265
@specificationSize = new Point 1000, 530
paintFunction: (context) ->
fillColor = @morph.color
fillColorString = fillColor.toString()
#// October revol + Bolshevik Islands Drawing
context.beginPath()
context.moveTo 732, 22
context.lineTo 738, 20
context.lineTo 762, 33
context.lineTo 748, 35
context.lineTo 728, 29
context.lineTo 732, 22
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Svalbard Drawing
context.beginPath()
context.moveTo 525, 21
context.lineTo 542, 23
context.lineTo 544, 28
context.lineTo 528, 31
context.lineTo 537, 42
context.lineTo 528, 42
context.lineTo 525, 36
context.lineTo 520, 42
context.lineTo 509, 42
context.lineTo 508, 35
context.lineTo 503, 30
context.lineTo 506, 26
context.lineTo 525, 21
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Zemlya Georga + other islands Drawing
context.save()
context.translate 81, -263
context.beginPath()
context.moveTo 547, 277
context.lineTo 558, 274
context.lineTo 557, 284
context.lineTo 548, 287
context.lineTo 517, 288
context.lineTo 515, 284
context.lineTo 535, 278
context.lineTo 547, 277
context.closePath()
context.fillStyle = fillColorString
context.fill()
context.restore()
#// Novaya Zemlya Drawing
context.beginPath()
context.moveTo 639, 46
context.lineTo 659, 41
context.lineTo 658, 46
context.lineTo 643, 49
context.lineTo 635, 53
context.lineTo 625, 60
context.lineTo 627, 73
context.lineTo 616, 71
context.lineTo 614, 67
context.lineTo 621, 50
context.lineTo 639, 46
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 3 Drawing
context.beginPath()
context.moveTo 854, 46
context.lineTo 859, 46
context.lineTo 859, 50
context.lineTo 856, 53
context.lineTo 854, 52
context.lineTo 854, 46
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 2 Drawing
context.beginPath()
context.moveTo 862, 48
context.lineTo 868, 51
context.lineTo 863, 52
context.lineTo 862, 48
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 1 Drawing
context.beginPath()
context.moveTo 859, 55
context.lineTo 868, 60
context.lineTo 859, 60
context.lineTo 859, 55
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Iceland Drawing
context.beginPath()
context.moveTo 405, 98
context.lineTo 411, 91
context.lineTo 416, 96
context.lineTo 427, 94
context.lineTo 429, 103
context.lineTo 412, 110
context.lineTo 405, 98
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// GB Drawing
context.beginPath()
context.moveTo 454, 128
context.lineTo 460, 126
context.lineTo 459, 131
context.lineTo 463, 132
context.lineTo 468, 146
context.lineTo 472, 149
context.lineTo 471, 155
context.lineTo 457, 159
context.lineTo 460, 154
context.lineTo 454, 152
context.lineTo 460, 146
context.lineTo 454, 128
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Ireland Drawing
context.beginPath()
context.moveTo 443, 147
context.lineTo 452, 143
context.lineTo 451, 152
context.lineTo 448, 156
context.lineTo 443, 156
context.lineTo 443, 147
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Japan Drawing
context.beginPath()
context.moveTo 864, 158
context.lineTo 868, 151
context.lineTo 868, 168
context.lineTo 866, 181
context.lineTo 873, 188
context.lineTo 861, 196
context.lineTo 862, 205
context.lineTo 857, 219
context.lineTo 844, 223
context.lineTo 831, 229
context.lineTo 831, 222
context.lineTo 855, 206
context.lineTo 858, 194
context.lineTo 865, 172
context.lineTo 864, 158
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sardinia Drawing
context.beginPath()
context.moveTo 493, 203
context.lineTo 492, 197
context.lineTo 494, 195
context.lineTo 495, 203
context.lineTo 493, 203
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Cuba Drawing
context.beginPath()
context.moveTo 236, 257
context.lineTo 248, 258
context.lineTo 262, 264
context.lineTo 255, 266
context.lineTo 246, 261
context.lineTo 238, 260
context.lineTo 236, 257
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Haiti + Dominican Republic Drawing
context.beginPath()
context.moveTo 270, 267
context.lineTo 279, 272
context.lineTo 265, 273
context.lineTo 270, 267
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Philippines Drawing
context.beginPath()
context.moveTo 805, 272
context.lineTo 808, 274
context.lineTo 816, 296
context.lineTo 819, 313
context.lineTo 811, 311
context.lineTo 805, 296
context.lineTo 802, 276
context.lineTo 805, 272
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// South America Drawing
context.beginPath()
context.moveTo 266, 296
context.lineTo 281, 296
context.lineTo 297, 300
context.lineTo 313, 311
context.lineTo 325, 315
context.lineTo 334, 334
context.lineTo 369, 346
context.lineTo 373, 358
context.lineTo 365, 371
context.lineTo 358, 393
context.lineTo 352, 405
context.lineTo 338, 412
context.lineTo 326, 436
context.lineTo 317, 445
context.lineTo 310, 455
context.lineTo 296, 462
context.lineTo 285, 481
context.lineTo 285, 496
context.lineTo 279, 509
context.lineTo 284, 520
context.lineTo 278, 524
context.lineTo 269, 523
context.lineTo 262, 506
context.lineTo 260, 483
context.lineTo 262, 468
context.lineTo 268, 440
context.lineTo 270, 421
context.lineTo 271, 389
context.lineTo 261, 380
context.lineTo 255, 371
context.lineTo 246, 354
context.lineTo 249, 333
context.lineTo 256, 320
context.lineTo 255, 309
context.lineTo 266, 296
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// <NAME>a Drawing
context.beginPath()
context.moveTo 691, 303
context.lineTo 696, 310
context.lineTo 691, 313
context.lineTo 691, 303
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Kalimantan Drawing
context.beginPath()
context.moveTo 773, 325
context.lineTo 797, 311
context.lineTo 797, 325
context.lineTo 792, 344
context.lineTo 775, 340
context.lineTo 773, 325
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sulawesi Drawing
context.beginPath()
context.moveTo 803, 330
context.lineTo 810, 330
context.lineTo 811, 351
context.lineTo 800, 348
context.lineTo 803, 330
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Papua Drawing
context.beginPath()
context.moveTo 833, 335
context.lineTo 867, 346
context.lineTo 877, 352
context.lineTo 884, 367
context.lineTo 855, 359
context.lineTo 849, 350
context.lineTo 839, 345
context.lineTo 833, 335
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Java Drawing
context.beginPath()
context.moveTo 763, 351
context.lineTo 789, 355
context.lineTo 795, 361
context.lineTo 783, 360
context.lineTo 763, 354
context.lineTo 763, 351
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Madagascar Drawing
context.beginPath()
context.moveTo 607, 368
context.lineTo 602, 395
context.lineTo 595, 403
context.lineTo 590, 398
context.lineTo 594, 387
context.lineTo 592, 377
context.lineTo 607, 368
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Australia Drawing
context.beginPath()
context.moveTo 860, 388
context.lineTo 864, 370
context.lineTo 876, 391
context.lineTo 887, 409
context.lineTo 892, 421
context.lineTo 890, 442
context.lineTo 883, 458
context.lineTo 871, 462
context.lineTo 857, 456
context.lineTo 850, 451
context.lineTo 843, 441
context.lineTo 837, 438
context.lineTo 826, 436
context.lineTo 812, 441
context.lineTo 804, 441
context.lineTo 791, 445
context.lineTo 791, 435
context.lineTo 786, 419
context.lineTo 785, 403
context.lineTo 804, 395
context.lineTo 809, 390
context.lineTo 817, 380
context.lineTo 827, 380
context.lineTo 833, 371
context.lineTo 847, 371
context.lineTo 847, 383
context.lineTo 860, 388
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// New Zealand Drawing
context.beginPath()
context.moveTo 949, 449
context.lineTo 965, 462
context.lineTo 943, 489
context.lineTo 934, 493
context.lineTo 931, 488
context.lineTo 946, 472
context.lineTo 956, 461
context.lineTo 949, 449
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Tasmania Drawing
context.beginPath()
context.moveTo 870, 469
context.lineTo 880, 469
context.lineTo 878, 478
context.lineTo 872, 476
context.lineTo 870, 469
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Corsica Drawing
context.beginPath()
context.moveTo 493, 195
context.lineTo 493, 192
context.lineTo 494, 191
context.lineTo 494, 195
context.lineTo 493, 195
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Africa Drawing
context.beginPath()
context.moveTo 477, 210
context.lineTo 490, 211
context.lineTo 499, 211
context.lineTo 498, 223
context.lineTo 518, 232
context.lineTo 531, 225
context.lineTo 550, 230
context.lineTo 558, 229
context.lineTo 574, 269
context.lineTo 592, 297
context.lineTo 611, 294
context.lineTo 609, 307
context.lineTo 602, 319
context.lineTo 582, 337
context.lineTo 578, 349
context.lineTo 582, 364
context.lineTo 578, 378
context.lineTo 566, 387
context.lineTo 568, 396
context.lineTo 560, 406
context.lineTo 553, 417
context.lineTo 532, 426
context.lineTo 524, 426
context.lineTo 521, 423
context.lineTo 513, 408
context.lineTo 505, 388
context.lineTo 503, 374
context.lineTo 508, 357
context.lineTo 494, 334
context.lineTo 494, 322
context.lineTo 486, 318
context.lineTo 483, 313
context.lineTo 444, 318
context.lineTo 426, 295
context.lineTo 424, 290
context.lineTo 423, 262
context.lineTo 428, 250
context.lineTo 440, 235
context.lineTo 443, 227
context.lineTo 454, 215
context.lineTo 463, 216
context.lineTo 471, 212
context.lineTo 477, 210
context.lineTo 477, 210
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Greenland Drawing
context.beginPath()
context.moveTo 353, 5
context.lineTo 370, 3
context.lineTo 407, 6
context.lineTo 435, 17
context.lineTo 425, 23
context.lineTo 415, 34
context.lineTo 420, 40
context.lineTo 419, 51
context.lineTo 410, 59
context.lineTo 413, 71
context.lineTo 401, 80
context.lineTo 360, 97
context.lineTo 350, 121
context.lineTo 336, 116
context.lineTo 328, 83
context.lineTo 313, 52
context.lineTo 306, 46
context.lineTo 300, 44
context.lineTo 272, 43
context.lineTo 271, 31
context.lineTo 287, 28
context.lineTo 301, 12
context.lineTo 314, 10
context.lineTo 326, 12
context.lineTo 353, 5
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Noth America Drawing
context.beginPath()
context.moveTo 287, 23
context.lineTo 278, 23
context.lineTo 258, 36
context.lineTo 253, 37
context.lineTo 247, 54
context.lineTo 254, 55
context.lineTo 257, 61
context.lineTo 264, 62
context.lineTo 267, 68
context.lineTo 276, 70
context.lineTo 281, 76
context.lineTo 282, 82
context.lineTo 300, 88
context.lineTo 293, 98
context.lineTo 285, 94
context.lineTo 289, 100
context.lineTo 289, 104
context.lineTo 283, 105
context.lineTo 286, 111
context.lineTo 272, 109
context.lineTo 266, 104
context.lineTo 253, 104
context.lineTo 253, 100
context.lineTo 266, 98
context.lineTo 268, 86
context.lineTo 259, 84
context.lineTo 257, 76
context.lineTo 241, 76
context.lineTo 245, 91
context.lineTo 236, 95
context.lineTo 241, 103
context.lineTo 239, 106
context.lineTo 235, 107
context.lineTo 221, 103
context.lineTo 210, 114
context.lineTo 207, 124
context.lineTo 212, 126
context.lineTo 214, 132
context.lineTo 221, 133
context.lineTo 230, 139
context.lineTo 241, 143
context.lineTo 240, 149
context.lineTo 249, 155
context.lineTo 248, 145
context.lineTo 250, 142
context.lineTo 256, 138
context.lineTo 255, 128
context.lineTo 252, 123
context.lineTo 254, 112
context.lineTo 265, 110
context.lineTo 269, 111
context.lineTo 275, 116
context.lineTo 280, 125
context.lineTo 287, 123
context.lineTo 291, 120
context.lineTo 298, 134
context.lineTo 310, 145
context.lineTo 313, 160
context.lineTo 327, 168
context.lineTo 326, 172
context.lineTo 306, 169
context.lineTo 311, 156
context.lineTo 299, 159
context.lineTo 294, 160
context.lineTo 295, 176
context.lineTo 302, 179
context.lineTo 286, 186
context.lineTo 283, 181
context.lineTo 278, 185
context.lineTo 273, 193
context.lineTo 263, 201
context.lineTo 257, 217
context.lineTo 252, 222
context.lineTo 242, 232
context.lineTo 246, 245
context.lineTo 244, 249
context.lineTo 235, 233
context.lineTo 206, 236
context.lineTo 201, 240
context.lineTo 199, 252
context.lineTo 198, 260
context.lineTo 203, 270
context.lineTo 214, 271
context.lineTo 218, 269
context.lineTo 226, 262
context.lineTo 224, 280
context.lineTo 238, 284
context.lineTo 239, 300
context.lineTo 255, 304
context.lineTo 241, 306
context.lineTo 234, 302
context.lineTo 228, 292
context.lineTo 221, 287
context.lineTo 205, 280
context.lineTo 187, 276
context.lineTo 180, 272
context.lineTo 175, 267
context.lineTo 174, 258
context.lineTo 169, 249
context.lineTo 163, 240
context.lineTo 151, 230
context.lineTo 164, 255
context.lineTo 153, 245
context.lineTo 141, 221
context.lineTo 134, 218
context.lineTo 130, 207
context.lineTo 125, 203
context.lineTo 122, 186
context.lineTo 122, 163
context.lineTo 113, 161
context.lineTo 111, 149
context.lineTo 83, 124
context.lineTo 57, 116
context.lineTo 56, 119
context.lineTo 47, 122
context.lineTo 48, 117
context.lineTo 42, 120
context.lineTo 39, 126
context.lineTo 30, 136
context.lineTo 12, 143
context.lineTo 21, 135
context.lineTo 28, 132
context.lineTo 30, 124
context.lineTo 12, 118
context.lineTo 8, 111
context.lineTo 12, 106
context.lineTo 19, 105
context.lineTo 20, 100
context.lineTo 5, 99
context.lineTo 3, 94
context.lineTo 19, 93
context.lineTo 8, 80
context.lineTo 23, 70
context.lineTo 57, 72
context.lineTo 89, 78
context.lineTo 113, 71
context.lineTo 119, 75
context.lineTo 144, 78
context.lineTo 144, 69
context.lineTo 128, 68
context.lineTo 125, 56
context.lineTo 131, 52
context.lineTo 148, 52
context.lineTo 148, 45
context.lineTo 130, 45
context.lineTo 125, 42
context.lineTo 162, 30
context.lineTo 207, 31
context.lineTo 204, 17
context.lineTo 215, 16
context.lineTo 227, 10
context.lineTo 235, 11
context.lineTo 269, 6
context.lineTo 291, 7
context.lineTo 301, 12
context.lineTo 287, 23
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Eurasia Drawing
context.beginPath()
context.moveTo 762, 38
context.lineTo 767, 42
context.lineTo 781, 42
context.lineTo 787, 52
context.lineTo 775, 55
context.lineTo 776, 58
context.lineTo 788, 56
context.lineTo 798, 59
context.lineTo 796, 60
context.lineTo 810, 62
context.lineTo 813, 57
context.lineTo 826, 63
context.lineTo 831, 71
context.lineTo 849, 70
context.lineTo 856, 69
context.lineTo 861, 62
context.lineTo 885, 67
context.lineTo 899, 71
context.lineTo 912, 71
context.lineTo 915, 76
context.lineTo 955, 76
context.lineTo 996, 97
context.lineTo 990, 104
context.lineTo 981, 103
context.lineTo 973, 100
context.lineTo 965, 102
context.lineTo 966, 112
context.lineTo 941, 122
context.lineTo 927, 122
context.lineTo 925, 124
context.lineTo 922, 137
context.lineTo 919, 145
context.lineTo 914, 151
context.lineTo 905, 159
context.lineTo 904, 156
context.lineTo 902, 143
context.lineTo 907, 131
context.lineTo 917, 123
context.lineTo 922, 120
context.lineTo 921, 116
context.lineTo 911, 115
context.lineTo 905, 116
context.lineTo 900, 124
context.lineTo 863, 124
context.lineTo 847, 143
context.lineTo 859, 149
context.lineTo 859, 167
context.lineTo 848, 183
context.lineTo 842, 191
context.lineTo 834, 189
context.lineTo 827, 200
context.lineTo 829, 216
context.lineTo 821, 220
context.lineTo 816, 204
context.lineTo 814, 201
context.lineTo 805, 198
context.lineTo 796, 207
context.lineTo 808, 210
context.lineTo 810, 212
context.lineTo 801, 218
context.lineTo 806, 228
context.lineTo 800, 252
context.lineTo 790, 260
context.lineTo 768, 266
context.lineTo 760, 272
context.lineTo 768, 280
context.lineTo 774, 294
context.lineTo 764, 304
context.lineTo 750, 293
context.lineTo 748, 305
context.lineTo 750, 311
context.lineTo 759, 327
context.lineTo 753, 326
context.lineTo 751, 322
context.lineTo 744, 301
context.lineTo 739, 278
context.lineTo 732, 281
context.lineTo 725, 261
context.lineTo 715, 263
context.lineTo 709, 268
context.lineTo 693, 282
context.lineTo 689, 302
context.lineTo 682, 305
context.lineTo 677, 295
context.lineTo 674, 285
context.lineTo 671, 264
context.lineTo 665, 266
context.lineTo 655, 249
context.lineTo 644, 252
context.lineTo 633, 249
context.lineTo 616, 243
context.lineTo 608, 234
context.lineTo 606, 235
context.lineTo 605, 241
context.lineTo 610, 248
context.lineTo 615, 250
context.lineTo 635, 258
context.lineTo 627, 274
context.lineTo 621, 278
context.lineTo 594, 291
context.lineTo 590, 279
context.lineTo 566, 236
context.lineTo 562, 236
context.lineTo 559, 229
context.lineTo 567, 228
context.lineTo 569, 213
context.lineTo 549, 212
context.lineTo 547, 210
context.lineTo 543, 199
context.lineTo 559, 194
context.lineTo 566, 193
context.lineTo 585, 196
context.lineTo 582, 189
context.lineTo 576, 184
context.lineTo 570, 183
context.lineTo 556, 178
context.lineTo 553, 180
context.lineTo 549, 187
context.lineTo 548, 195
context.lineTo 536, 198
context.lineTo 534, 211
context.lineTo 531, 209
context.lineTo 524, 195
context.lineTo 505, 181
context.lineTo 505, 187
context.lineTo 514, 196
context.lineTo 521, 201
context.lineTo 516, 201
context.lineTo 511, 211
context.lineTo 505, 208
context.lineTo 513, 204
context.lineTo 505, 196
context.lineTo 495, 185
context.lineTo 488, 186
context.lineTo 478, 190
context.lineTo 470, 201
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 456, 212
context.lineTo 444, 205
context.lineTo 448, 188
context.lineTo 458, 187
context.lineTo 467, 187
context.lineTo 467, 180
context.lineTo 459, 168
context.lineTo 481, 155
context.lineTo 485, 150
context.lineTo 493, 148
context.lineTo 493, 134
context.lineTo 499, 132
context.lineTo 499, 139
context.lineTo 505, 139
context.lineTo 524, 132
context.lineTo 536, 115
context.lineTo 527, 107
context.lineTo 536, 93
context.lineTo 531, 91
context.lineTo 514, 112
context.lineTo 514, 124
context.lineTo 506, 132
context.lineTo 499, 124
context.lineTo 493, 128
context.lineTo 489, 115
context.lineTo 516, 86
context.lineTo 513, 81
context.lineTo 534, 69
context.lineTo 551, 70
context.lineTo 559, 78
context.lineTo 568, 80
context.lineTo 577, 83
context.lineTo 582, 92
context.lineTo 575, 94
context.lineTo 564, 91
context.lineTo 573, 102
context.lineTo 576, 104
context.lineTo 584, 95
context.lineTo 590, 93
context.lineTo 592, 83
context.lineTo 597, 83
context.lineTo 597, 92
context.lineTo 610, 85
context.lineTo 628, 83
context.lineTo 639, 78
context.lineTo 642, 79
context.lineTo 660, 85
context.lineTo 658, 73
context.lineTo 659, 68
context.lineTo 666, 58
context.lineTo 678, 63
context.lineTo 694, 63
context.lineTo 697, 57
context.lineTo 710, 56
context.lineTo 715, 47
context.lineTo 751, 43
context.lineTo 753, 41
context.lineTo 754, 39
context.lineTo 762, 38
context.lineTo 762, 38
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sumatra Drawing
context.beginPath()
context.moveTo 764, 341
context.lineTo 762, 350
context.lineTo 754, 345
context.lineTo 748, 336
context.lineTo 736, 315
context.lineTo 748, 323
context.lineTo 764, 341
context.closePath()
context.fillStyle = fillColorString
context.fill()
| true | class SimpleWorldMapIconAppearance extends IconAppearance
constructor: (@morph) ->
super
@preferredSize = new Point 500, 265
@specificationSize = new Point 1000, 530
paintFunction: (context) ->
fillColor = @morph.color
fillColorString = fillColor.toString()
#// October revol + Bolshevik Islands Drawing
context.beginPath()
context.moveTo 732, 22
context.lineTo 738, 20
context.lineTo 762, 33
context.lineTo 748, 35
context.lineTo 728, 29
context.lineTo 732, 22
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Svalbard Drawing
context.beginPath()
context.moveTo 525, 21
context.lineTo 542, 23
context.lineTo 544, 28
context.lineTo 528, 31
context.lineTo 537, 42
context.lineTo 528, 42
context.lineTo 525, 36
context.lineTo 520, 42
context.lineTo 509, 42
context.lineTo 508, 35
context.lineTo 503, 30
context.lineTo 506, 26
context.lineTo 525, 21
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Zemlya Georga + other islands Drawing
context.save()
context.translate 81, -263
context.beginPath()
context.moveTo 547, 277
context.lineTo 558, 274
context.lineTo 557, 284
context.lineTo 548, 287
context.lineTo 517, 288
context.lineTo 515, 284
context.lineTo 535, 278
context.lineTo 547, 277
context.closePath()
context.fillStyle = fillColorString
context.fill()
context.restore()
#// Novaya Zemlya Drawing
context.beginPath()
context.moveTo 639, 46
context.lineTo 659, 41
context.lineTo 658, 46
context.lineTo 643, 49
context.lineTo 635, 53
context.lineTo 625, 60
context.lineTo 627, 73
context.lineTo 616, 71
context.lineTo 614, 67
context.lineTo 621, 50
context.lineTo 639, 46
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 3 Drawing
context.beginPath()
context.moveTo 854, 46
context.lineTo 859, 46
context.lineTo 859, 50
context.lineTo 856, 53
context.lineTo 854, 52
context.lineTo 854, 46
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 2 Drawing
context.beginPath()
context.moveTo 862, 48
context.lineTo 868, 51
context.lineTo 863, 52
context.lineTo 862, 48
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Siberian Island 1 Drawing
context.beginPath()
context.moveTo 859, 55
context.lineTo 868, 60
context.lineTo 859, 60
context.lineTo 859, 55
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Iceland Drawing
context.beginPath()
context.moveTo 405, 98
context.lineTo 411, 91
context.lineTo 416, 96
context.lineTo 427, 94
context.lineTo 429, 103
context.lineTo 412, 110
context.lineTo 405, 98
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// GB Drawing
context.beginPath()
context.moveTo 454, 128
context.lineTo 460, 126
context.lineTo 459, 131
context.lineTo 463, 132
context.lineTo 468, 146
context.lineTo 472, 149
context.lineTo 471, 155
context.lineTo 457, 159
context.lineTo 460, 154
context.lineTo 454, 152
context.lineTo 460, 146
context.lineTo 454, 128
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Ireland Drawing
context.beginPath()
context.moveTo 443, 147
context.lineTo 452, 143
context.lineTo 451, 152
context.lineTo 448, 156
context.lineTo 443, 156
context.lineTo 443, 147
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Japan Drawing
context.beginPath()
context.moveTo 864, 158
context.lineTo 868, 151
context.lineTo 868, 168
context.lineTo 866, 181
context.lineTo 873, 188
context.lineTo 861, 196
context.lineTo 862, 205
context.lineTo 857, 219
context.lineTo 844, 223
context.lineTo 831, 229
context.lineTo 831, 222
context.lineTo 855, 206
context.lineTo 858, 194
context.lineTo 865, 172
context.lineTo 864, 158
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sardinia Drawing
context.beginPath()
context.moveTo 493, 203
context.lineTo 492, 197
context.lineTo 494, 195
context.lineTo 495, 203
context.lineTo 493, 203
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Cuba Drawing
context.beginPath()
context.moveTo 236, 257
context.lineTo 248, 258
context.lineTo 262, 264
context.lineTo 255, 266
context.lineTo 246, 261
context.lineTo 238, 260
context.lineTo 236, 257
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Haiti + Dominican Republic Drawing
context.beginPath()
context.moveTo 270, 267
context.lineTo 279, 272
context.lineTo 265, 273
context.lineTo 270, 267
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Philippines Drawing
context.beginPath()
context.moveTo 805, 272
context.lineTo 808, 274
context.lineTo 816, 296
context.lineTo 819, 313
context.lineTo 811, 311
context.lineTo 805, 296
context.lineTo 802, 276
context.lineTo 805, 272
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// South America Drawing
context.beginPath()
context.moveTo 266, 296
context.lineTo 281, 296
context.lineTo 297, 300
context.lineTo 313, 311
context.lineTo 325, 315
context.lineTo 334, 334
context.lineTo 369, 346
context.lineTo 373, 358
context.lineTo 365, 371
context.lineTo 358, 393
context.lineTo 352, 405
context.lineTo 338, 412
context.lineTo 326, 436
context.lineTo 317, 445
context.lineTo 310, 455
context.lineTo 296, 462
context.lineTo 285, 481
context.lineTo 285, 496
context.lineTo 279, 509
context.lineTo 284, 520
context.lineTo 278, 524
context.lineTo 269, 523
context.lineTo 262, 506
context.lineTo 260, 483
context.lineTo 262, 468
context.lineTo 268, 440
context.lineTo 270, 421
context.lineTo 271, 389
context.lineTo 261, 380
context.lineTo 255, 371
context.lineTo 246, 354
context.lineTo 249, 333
context.lineTo 256, 320
context.lineTo 255, 309
context.lineTo 266, 296
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// PI:NAME:<NAME>END_PIa Drawing
context.beginPath()
context.moveTo 691, 303
context.lineTo 696, 310
context.lineTo 691, 313
context.lineTo 691, 303
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Kalimantan Drawing
context.beginPath()
context.moveTo 773, 325
context.lineTo 797, 311
context.lineTo 797, 325
context.lineTo 792, 344
context.lineTo 775, 340
context.lineTo 773, 325
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sulawesi Drawing
context.beginPath()
context.moveTo 803, 330
context.lineTo 810, 330
context.lineTo 811, 351
context.lineTo 800, 348
context.lineTo 803, 330
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Papua Drawing
context.beginPath()
context.moveTo 833, 335
context.lineTo 867, 346
context.lineTo 877, 352
context.lineTo 884, 367
context.lineTo 855, 359
context.lineTo 849, 350
context.lineTo 839, 345
context.lineTo 833, 335
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Java Drawing
context.beginPath()
context.moveTo 763, 351
context.lineTo 789, 355
context.lineTo 795, 361
context.lineTo 783, 360
context.lineTo 763, 354
context.lineTo 763, 351
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Madagascar Drawing
context.beginPath()
context.moveTo 607, 368
context.lineTo 602, 395
context.lineTo 595, 403
context.lineTo 590, 398
context.lineTo 594, 387
context.lineTo 592, 377
context.lineTo 607, 368
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Australia Drawing
context.beginPath()
context.moveTo 860, 388
context.lineTo 864, 370
context.lineTo 876, 391
context.lineTo 887, 409
context.lineTo 892, 421
context.lineTo 890, 442
context.lineTo 883, 458
context.lineTo 871, 462
context.lineTo 857, 456
context.lineTo 850, 451
context.lineTo 843, 441
context.lineTo 837, 438
context.lineTo 826, 436
context.lineTo 812, 441
context.lineTo 804, 441
context.lineTo 791, 445
context.lineTo 791, 435
context.lineTo 786, 419
context.lineTo 785, 403
context.lineTo 804, 395
context.lineTo 809, 390
context.lineTo 817, 380
context.lineTo 827, 380
context.lineTo 833, 371
context.lineTo 847, 371
context.lineTo 847, 383
context.lineTo 860, 388
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// New Zealand Drawing
context.beginPath()
context.moveTo 949, 449
context.lineTo 965, 462
context.lineTo 943, 489
context.lineTo 934, 493
context.lineTo 931, 488
context.lineTo 946, 472
context.lineTo 956, 461
context.lineTo 949, 449
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Tasmania Drawing
context.beginPath()
context.moveTo 870, 469
context.lineTo 880, 469
context.lineTo 878, 478
context.lineTo 872, 476
context.lineTo 870, 469
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Corsica Drawing
context.beginPath()
context.moveTo 493, 195
context.lineTo 493, 192
context.lineTo 494, 191
context.lineTo 494, 195
context.lineTo 493, 195
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Africa Drawing
context.beginPath()
context.moveTo 477, 210
context.lineTo 490, 211
context.lineTo 499, 211
context.lineTo 498, 223
context.lineTo 518, 232
context.lineTo 531, 225
context.lineTo 550, 230
context.lineTo 558, 229
context.lineTo 574, 269
context.lineTo 592, 297
context.lineTo 611, 294
context.lineTo 609, 307
context.lineTo 602, 319
context.lineTo 582, 337
context.lineTo 578, 349
context.lineTo 582, 364
context.lineTo 578, 378
context.lineTo 566, 387
context.lineTo 568, 396
context.lineTo 560, 406
context.lineTo 553, 417
context.lineTo 532, 426
context.lineTo 524, 426
context.lineTo 521, 423
context.lineTo 513, 408
context.lineTo 505, 388
context.lineTo 503, 374
context.lineTo 508, 357
context.lineTo 494, 334
context.lineTo 494, 322
context.lineTo 486, 318
context.lineTo 483, 313
context.lineTo 444, 318
context.lineTo 426, 295
context.lineTo 424, 290
context.lineTo 423, 262
context.lineTo 428, 250
context.lineTo 440, 235
context.lineTo 443, 227
context.lineTo 454, 215
context.lineTo 463, 216
context.lineTo 471, 212
context.lineTo 477, 210
context.lineTo 477, 210
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Greenland Drawing
context.beginPath()
context.moveTo 353, 5
context.lineTo 370, 3
context.lineTo 407, 6
context.lineTo 435, 17
context.lineTo 425, 23
context.lineTo 415, 34
context.lineTo 420, 40
context.lineTo 419, 51
context.lineTo 410, 59
context.lineTo 413, 71
context.lineTo 401, 80
context.lineTo 360, 97
context.lineTo 350, 121
context.lineTo 336, 116
context.lineTo 328, 83
context.lineTo 313, 52
context.lineTo 306, 46
context.lineTo 300, 44
context.lineTo 272, 43
context.lineTo 271, 31
context.lineTo 287, 28
context.lineTo 301, 12
context.lineTo 314, 10
context.lineTo 326, 12
context.lineTo 353, 5
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Noth America Drawing
context.beginPath()
context.moveTo 287, 23
context.lineTo 278, 23
context.lineTo 258, 36
context.lineTo 253, 37
context.lineTo 247, 54
context.lineTo 254, 55
context.lineTo 257, 61
context.lineTo 264, 62
context.lineTo 267, 68
context.lineTo 276, 70
context.lineTo 281, 76
context.lineTo 282, 82
context.lineTo 300, 88
context.lineTo 293, 98
context.lineTo 285, 94
context.lineTo 289, 100
context.lineTo 289, 104
context.lineTo 283, 105
context.lineTo 286, 111
context.lineTo 272, 109
context.lineTo 266, 104
context.lineTo 253, 104
context.lineTo 253, 100
context.lineTo 266, 98
context.lineTo 268, 86
context.lineTo 259, 84
context.lineTo 257, 76
context.lineTo 241, 76
context.lineTo 245, 91
context.lineTo 236, 95
context.lineTo 241, 103
context.lineTo 239, 106
context.lineTo 235, 107
context.lineTo 221, 103
context.lineTo 210, 114
context.lineTo 207, 124
context.lineTo 212, 126
context.lineTo 214, 132
context.lineTo 221, 133
context.lineTo 230, 139
context.lineTo 241, 143
context.lineTo 240, 149
context.lineTo 249, 155
context.lineTo 248, 145
context.lineTo 250, 142
context.lineTo 256, 138
context.lineTo 255, 128
context.lineTo 252, 123
context.lineTo 254, 112
context.lineTo 265, 110
context.lineTo 269, 111
context.lineTo 275, 116
context.lineTo 280, 125
context.lineTo 287, 123
context.lineTo 291, 120
context.lineTo 298, 134
context.lineTo 310, 145
context.lineTo 313, 160
context.lineTo 327, 168
context.lineTo 326, 172
context.lineTo 306, 169
context.lineTo 311, 156
context.lineTo 299, 159
context.lineTo 294, 160
context.lineTo 295, 176
context.lineTo 302, 179
context.lineTo 286, 186
context.lineTo 283, 181
context.lineTo 278, 185
context.lineTo 273, 193
context.lineTo 263, 201
context.lineTo 257, 217
context.lineTo 252, 222
context.lineTo 242, 232
context.lineTo 246, 245
context.lineTo 244, 249
context.lineTo 235, 233
context.lineTo 206, 236
context.lineTo 201, 240
context.lineTo 199, 252
context.lineTo 198, 260
context.lineTo 203, 270
context.lineTo 214, 271
context.lineTo 218, 269
context.lineTo 226, 262
context.lineTo 224, 280
context.lineTo 238, 284
context.lineTo 239, 300
context.lineTo 255, 304
context.lineTo 241, 306
context.lineTo 234, 302
context.lineTo 228, 292
context.lineTo 221, 287
context.lineTo 205, 280
context.lineTo 187, 276
context.lineTo 180, 272
context.lineTo 175, 267
context.lineTo 174, 258
context.lineTo 169, 249
context.lineTo 163, 240
context.lineTo 151, 230
context.lineTo 164, 255
context.lineTo 153, 245
context.lineTo 141, 221
context.lineTo 134, 218
context.lineTo 130, 207
context.lineTo 125, 203
context.lineTo 122, 186
context.lineTo 122, 163
context.lineTo 113, 161
context.lineTo 111, 149
context.lineTo 83, 124
context.lineTo 57, 116
context.lineTo 56, 119
context.lineTo 47, 122
context.lineTo 48, 117
context.lineTo 42, 120
context.lineTo 39, 126
context.lineTo 30, 136
context.lineTo 12, 143
context.lineTo 21, 135
context.lineTo 28, 132
context.lineTo 30, 124
context.lineTo 12, 118
context.lineTo 8, 111
context.lineTo 12, 106
context.lineTo 19, 105
context.lineTo 20, 100
context.lineTo 5, 99
context.lineTo 3, 94
context.lineTo 19, 93
context.lineTo 8, 80
context.lineTo 23, 70
context.lineTo 57, 72
context.lineTo 89, 78
context.lineTo 113, 71
context.lineTo 119, 75
context.lineTo 144, 78
context.lineTo 144, 69
context.lineTo 128, 68
context.lineTo 125, 56
context.lineTo 131, 52
context.lineTo 148, 52
context.lineTo 148, 45
context.lineTo 130, 45
context.lineTo 125, 42
context.lineTo 162, 30
context.lineTo 207, 31
context.lineTo 204, 17
context.lineTo 215, 16
context.lineTo 227, 10
context.lineTo 235, 11
context.lineTo 269, 6
context.lineTo 291, 7
context.lineTo 301, 12
context.lineTo 287, 23
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Eurasia Drawing
context.beginPath()
context.moveTo 762, 38
context.lineTo 767, 42
context.lineTo 781, 42
context.lineTo 787, 52
context.lineTo 775, 55
context.lineTo 776, 58
context.lineTo 788, 56
context.lineTo 798, 59
context.lineTo 796, 60
context.lineTo 810, 62
context.lineTo 813, 57
context.lineTo 826, 63
context.lineTo 831, 71
context.lineTo 849, 70
context.lineTo 856, 69
context.lineTo 861, 62
context.lineTo 885, 67
context.lineTo 899, 71
context.lineTo 912, 71
context.lineTo 915, 76
context.lineTo 955, 76
context.lineTo 996, 97
context.lineTo 990, 104
context.lineTo 981, 103
context.lineTo 973, 100
context.lineTo 965, 102
context.lineTo 966, 112
context.lineTo 941, 122
context.lineTo 927, 122
context.lineTo 925, 124
context.lineTo 922, 137
context.lineTo 919, 145
context.lineTo 914, 151
context.lineTo 905, 159
context.lineTo 904, 156
context.lineTo 902, 143
context.lineTo 907, 131
context.lineTo 917, 123
context.lineTo 922, 120
context.lineTo 921, 116
context.lineTo 911, 115
context.lineTo 905, 116
context.lineTo 900, 124
context.lineTo 863, 124
context.lineTo 847, 143
context.lineTo 859, 149
context.lineTo 859, 167
context.lineTo 848, 183
context.lineTo 842, 191
context.lineTo 834, 189
context.lineTo 827, 200
context.lineTo 829, 216
context.lineTo 821, 220
context.lineTo 816, 204
context.lineTo 814, 201
context.lineTo 805, 198
context.lineTo 796, 207
context.lineTo 808, 210
context.lineTo 810, 212
context.lineTo 801, 218
context.lineTo 806, 228
context.lineTo 800, 252
context.lineTo 790, 260
context.lineTo 768, 266
context.lineTo 760, 272
context.lineTo 768, 280
context.lineTo 774, 294
context.lineTo 764, 304
context.lineTo 750, 293
context.lineTo 748, 305
context.lineTo 750, 311
context.lineTo 759, 327
context.lineTo 753, 326
context.lineTo 751, 322
context.lineTo 744, 301
context.lineTo 739, 278
context.lineTo 732, 281
context.lineTo 725, 261
context.lineTo 715, 263
context.lineTo 709, 268
context.lineTo 693, 282
context.lineTo 689, 302
context.lineTo 682, 305
context.lineTo 677, 295
context.lineTo 674, 285
context.lineTo 671, 264
context.lineTo 665, 266
context.lineTo 655, 249
context.lineTo 644, 252
context.lineTo 633, 249
context.lineTo 616, 243
context.lineTo 608, 234
context.lineTo 606, 235
context.lineTo 605, 241
context.lineTo 610, 248
context.lineTo 615, 250
context.lineTo 635, 258
context.lineTo 627, 274
context.lineTo 621, 278
context.lineTo 594, 291
context.lineTo 590, 279
context.lineTo 566, 236
context.lineTo 562, 236
context.lineTo 559, 229
context.lineTo 567, 228
context.lineTo 569, 213
context.lineTo 549, 212
context.lineTo 547, 210
context.lineTo 543, 199
context.lineTo 559, 194
context.lineTo 566, 193
context.lineTo 585, 196
context.lineTo 582, 189
context.lineTo 576, 184
context.lineTo 570, 183
context.lineTo 556, 178
context.lineTo 553, 180
context.lineTo 549, 187
context.lineTo 548, 195
context.lineTo 536, 198
context.lineTo 534, 211
context.lineTo 531, 209
context.lineTo 524, 195
context.lineTo 505, 181
context.lineTo 505, 187
context.lineTo 514, 196
context.lineTo 521, 201
context.lineTo 516, 201
context.lineTo 511, 211
context.lineTo 505, 208
context.lineTo 513, 204
context.lineTo 505, 196
context.lineTo 495, 185
context.lineTo 488, 186
context.lineTo 478, 190
context.lineTo 470, 201
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 465, 212
context.lineTo 456, 212
context.lineTo 444, 205
context.lineTo 448, 188
context.lineTo 458, 187
context.lineTo 467, 187
context.lineTo 467, 180
context.lineTo 459, 168
context.lineTo 481, 155
context.lineTo 485, 150
context.lineTo 493, 148
context.lineTo 493, 134
context.lineTo 499, 132
context.lineTo 499, 139
context.lineTo 505, 139
context.lineTo 524, 132
context.lineTo 536, 115
context.lineTo 527, 107
context.lineTo 536, 93
context.lineTo 531, 91
context.lineTo 514, 112
context.lineTo 514, 124
context.lineTo 506, 132
context.lineTo 499, 124
context.lineTo 493, 128
context.lineTo 489, 115
context.lineTo 516, 86
context.lineTo 513, 81
context.lineTo 534, 69
context.lineTo 551, 70
context.lineTo 559, 78
context.lineTo 568, 80
context.lineTo 577, 83
context.lineTo 582, 92
context.lineTo 575, 94
context.lineTo 564, 91
context.lineTo 573, 102
context.lineTo 576, 104
context.lineTo 584, 95
context.lineTo 590, 93
context.lineTo 592, 83
context.lineTo 597, 83
context.lineTo 597, 92
context.lineTo 610, 85
context.lineTo 628, 83
context.lineTo 639, 78
context.lineTo 642, 79
context.lineTo 660, 85
context.lineTo 658, 73
context.lineTo 659, 68
context.lineTo 666, 58
context.lineTo 678, 63
context.lineTo 694, 63
context.lineTo 697, 57
context.lineTo 710, 56
context.lineTo 715, 47
context.lineTo 751, 43
context.lineTo 753, 41
context.lineTo 754, 39
context.lineTo 762, 38
context.lineTo 762, 38
context.closePath()
context.fillStyle = fillColorString
context.fill()
#// Sumatra Drawing
context.beginPath()
context.moveTo 764, 341
context.lineTo 762, 350
context.lineTo 754, 345
context.lineTo 748, 336
context.lineTo 736, 315
context.lineTo 748, 323
context.lineTo 764, 341
context.closePath()
context.fillStyle = fillColorString
context.fill()
|
[
{
"context": " (x, y, z) ->\n g = (a) ->\n x = \"two\"\n y = \"three\"\n a[1] = \"drei\"\n a[2] = \"fuenf\"\n return\n",
"end": 2340,
"score": 0.6206384301185608,
"start": 2335,
"tag": "NAME",
"value": "three"
},
{
"context": " (a) ->\n x = \"two\"\n y = \"three... | deps/v8/test/mjsunit/arguments.coffee | lxe/io.coffee | 0 | # Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
argc0 = ->
arguments.length
argc1 = (i) ->
arguments.length
argc2 = (i, j) ->
arguments.length
argv0 = ->
arguments[index]
argv1 = (i) ->
arguments[index]
argv2 = (i, j) ->
arguments[index]
# Test that calling a lazily compiled function with
# an unexpected number of arguments works.
f = (a) ->
arguments.length
f1 = (x, y) ->
g = (a) ->
a[0] = "three"
a.length
l = g(arguments)
y = 5
assertEquals 2, l
assertEquals "three", x
assertEquals 5, y
return
f2 = ->
return arguments.callee(arguments[0] - 1) + arguments[0] if arguments[0] > 0
0
f3 = ->
assertEquals 0, arguments.length
return
f4 = ->
arguments = 0
assertEquals undefined, arguments.length
return
f5 = (x, y, z) ->
g = (a) ->
x = "two"
y = "three"
a[1] = "drei"
a[2] = "fuenf"
return
g arguments
assertEquals "two", x
assertEquals "drei", y
assertEquals "fuenf", z
return
f6 = (x, y) ->
x = "x"
arguments[1] = "y"
[
arguments.length
arguments[0]
y
arguments[2]
]
list_args = (a) ->
assertEquals "function", typeof a.callee
result = []
result.push a.length
i = 0
while i < a.length
result.push a[i]
i++
result
f1 = (x, y) ->
g = (p) ->
x = p
return
g y
list_args arguments
# Check out of bounds behavior.
arg_get = (x) ->
arguments[x]
arg_del = (x) ->
delete arguments[x]
arg_set = (x) ->
arguments[x] = 117
assertEquals 0, argc0()
assertEquals 1, argc0(1)
assertEquals 2, argc0(1, 2)
assertEquals 3, argc0(1, 2, 3)
assertEquals 0, argc1()
assertEquals 1, argc1(1)
assertEquals 2, argc1(1, 2)
assertEquals 3, argc1(1, 2, 3)
assertEquals 0, argc2()
assertEquals 1, argc2(1)
assertEquals 2, argc2(1, 2)
assertEquals 3, argc2(1, 2, 3)
index = undefined
index = 0
assertEquals 7, argv0(7)
assertEquals 7, argv0(7, 8)
assertEquals 7, argv0(7, 8, 9)
assertEquals 7, argv1(7)
assertEquals 7, argv1(7, 8)
assertEquals 7, argv1(7, 8, 9)
assertEquals 7, argv2(7)
assertEquals 7, argv2(7, 8)
assertEquals 7, argv2(7, 8, 9)
index = 1
assertEquals 8, argv0(7, 8)
assertEquals 8, argv0(7, 8)
assertEquals 8, argv1(7, 8, 9)
assertEquals 8, argv1(7, 8, 9)
assertEquals 8, argv2(7, 8, 9)
assertEquals 8, argv2(7, 8, 9)
index = 2
assertEquals 9, argv0(7, 8, 9)
assertEquals 9, argv1(7, 8, 9)
assertEquals 9, argv2(7, 8, 9)
assertEquals 3, f(1, 2, 3)
f1 3, "five"
assertEquals 55, f2(10)
f3()
f4()
f5 2, 3, 5
assertArrayEquals [
0
undefined
undefined
undefined
], f6()
assertArrayEquals [
1
"x"
undefined
undefined
], f6(1)
assertArrayEquals [
2
"x"
"y"
undefined
], f6(9, 17)
assertArrayEquals [
3
"x"
"y"
7
], f6(3, 5, 7)
assertArrayEquals [
4
"x"
"y"
"c"
], f6("a", "b", "c", "d")
assertArrayEquals [0], f1()
assertArrayEquals [
1
undefined
], f1(3)
assertArrayEquals [
2
5
5
], f1(3, 5)
assertArrayEquals [
3
5
5
7
], f1(3, 5, 7)
assertEquals `undefined`, arg_get(0xffffffff)
assertEquals true, arg_del(0xffffffff)
assertEquals 117, arg_set(0xffffffff)
| 122429 | # Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
argc0 = ->
arguments.length
argc1 = (i) ->
arguments.length
argc2 = (i, j) ->
arguments.length
argv0 = ->
arguments[index]
argv1 = (i) ->
arguments[index]
argv2 = (i, j) ->
arguments[index]
# Test that calling a lazily compiled function with
# an unexpected number of arguments works.
f = (a) ->
arguments.length
f1 = (x, y) ->
g = (a) ->
a[0] = "three"
a.length
l = g(arguments)
y = 5
assertEquals 2, l
assertEquals "three", x
assertEquals 5, y
return
f2 = ->
return arguments.callee(arguments[0] - 1) + arguments[0] if arguments[0] > 0
0
f3 = ->
assertEquals 0, arguments.length
return
f4 = ->
arguments = 0
assertEquals undefined, arguments.length
return
f5 = (x, y, z) ->
g = (a) ->
x = "two"
y = "<NAME>"
a[1] = "<NAME>"
a[2] = "fu<NAME>"
return
g arguments
assertEquals "two", x
assertEquals "d<NAME>", y
assertEquals "fuenf", z
return
f6 = (x, y) ->
x = "x"
arguments[1] = "y"
[
arguments.length
arguments[0]
y
arguments[2]
]
list_args = (a) ->
assertEquals "function", typeof a.callee
result = []
result.push a.length
i = 0
while i < a.length
result.push a[i]
i++
result
f1 = (x, y) ->
g = (p) ->
x = p
return
g y
list_args arguments
# Check out of bounds behavior.
arg_get = (x) ->
arguments[x]
arg_del = (x) ->
delete arguments[x]
arg_set = (x) ->
arguments[x] = 117
assertEquals 0, argc0()
assertEquals 1, argc0(1)
assertEquals 2, argc0(1, 2)
assertEquals 3, argc0(1, 2, 3)
assertEquals 0, argc1()
assertEquals 1, argc1(1)
assertEquals 2, argc1(1, 2)
assertEquals 3, argc1(1, 2, 3)
assertEquals 0, argc2()
assertEquals 1, argc2(1)
assertEquals 2, argc2(1, 2)
assertEquals 3, argc2(1, 2, 3)
index = undefined
index = 0
assertEquals 7, argv0(7)
assertEquals 7, argv0(7, 8)
assertEquals 7, argv0(7, 8, 9)
assertEquals 7, argv1(7)
assertEquals 7, argv1(7, 8)
assertEquals 7, argv1(7, 8, 9)
assertEquals 7, argv2(7)
assertEquals 7, argv2(7, 8)
assertEquals 7, argv2(7, 8, 9)
index = 1
assertEquals 8, argv0(7, 8)
assertEquals 8, argv0(7, 8)
assertEquals 8, argv1(7, 8, 9)
assertEquals 8, argv1(7, 8, 9)
assertEquals 8, argv2(7, 8, 9)
assertEquals 8, argv2(7, 8, 9)
index = 2
assertEquals 9, argv0(7, 8, 9)
assertEquals 9, argv1(7, 8, 9)
assertEquals 9, argv2(7, 8, 9)
assertEquals 3, f(1, 2, 3)
f1 3, "five"
assertEquals 55, f2(10)
f3()
f4()
f5 2, 3, 5
assertArrayEquals [
0
undefined
undefined
undefined
], f6()
assertArrayEquals [
1
"x"
undefined
undefined
], f6(1)
assertArrayEquals [
2
"x"
"y"
undefined
], f6(9, 17)
assertArrayEquals [
3
"x"
"y"
7
], f6(3, 5, 7)
assertArrayEquals [
4
"x"
"y"
"c"
], f6("a", "b", "c", "d")
assertArrayEquals [0], f1()
assertArrayEquals [
1
undefined
], f1(3)
assertArrayEquals [
2
5
5
], f1(3, 5)
assertArrayEquals [
3
5
5
7
], f1(3, 5, 7)
assertEquals `undefined`, arg_get(0xffffffff)
assertEquals true, arg_del(0xffffffff)
assertEquals 117, arg_set(0xffffffff)
| true | # Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
argc0 = ->
arguments.length
argc1 = (i) ->
arguments.length
argc2 = (i, j) ->
arguments.length
argv0 = ->
arguments[index]
argv1 = (i) ->
arguments[index]
argv2 = (i, j) ->
arguments[index]
# Test that calling a lazily compiled function with
# an unexpected number of arguments works.
f = (a) ->
arguments.length
f1 = (x, y) ->
g = (a) ->
a[0] = "three"
a.length
l = g(arguments)
y = 5
assertEquals 2, l
assertEquals "three", x
assertEquals 5, y
return
f2 = ->
return arguments.callee(arguments[0] - 1) + arguments[0] if arguments[0] > 0
0
f3 = ->
assertEquals 0, arguments.length
return
f4 = ->
arguments = 0
assertEquals undefined, arguments.length
return
f5 = (x, y, z) ->
g = (a) ->
x = "two"
y = "PI:NAME:<NAME>END_PI"
a[1] = "PI:NAME:<NAME>END_PI"
a[2] = "fuPI:NAME:<NAME>END_PI"
return
g arguments
assertEquals "two", x
assertEquals "dPI:NAME:<NAME>END_PI", y
assertEquals "fuenf", z
return
f6 = (x, y) ->
x = "x"
arguments[1] = "y"
[
arguments.length
arguments[0]
y
arguments[2]
]
list_args = (a) ->
assertEquals "function", typeof a.callee
result = []
result.push a.length
i = 0
while i < a.length
result.push a[i]
i++
result
f1 = (x, y) ->
g = (p) ->
x = p
return
g y
list_args arguments
# Check out of bounds behavior.
arg_get = (x) ->
arguments[x]
arg_del = (x) ->
delete arguments[x]
arg_set = (x) ->
arguments[x] = 117
assertEquals 0, argc0()
assertEquals 1, argc0(1)
assertEquals 2, argc0(1, 2)
assertEquals 3, argc0(1, 2, 3)
assertEquals 0, argc1()
assertEquals 1, argc1(1)
assertEquals 2, argc1(1, 2)
assertEquals 3, argc1(1, 2, 3)
assertEquals 0, argc2()
assertEquals 1, argc2(1)
assertEquals 2, argc2(1, 2)
assertEquals 3, argc2(1, 2, 3)
index = undefined
index = 0
assertEquals 7, argv0(7)
assertEquals 7, argv0(7, 8)
assertEquals 7, argv0(7, 8, 9)
assertEquals 7, argv1(7)
assertEquals 7, argv1(7, 8)
assertEquals 7, argv1(7, 8, 9)
assertEquals 7, argv2(7)
assertEquals 7, argv2(7, 8)
assertEquals 7, argv2(7, 8, 9)
index = 1
assertEquals 8, argv0(7, 8)
assertEquals 8, argv0(7, 8)
assertEquals 8, argv1(7, 8, 9)
assertEquals 8, argv1(7, 8, 9)
assertEquals 8, argv2(7, 8, 9)
assertEquals 8, argv2(7, 8, 9)
index = 2
assertEquals 9, argv0(7, 8, 9)
assertEquals 9, argv1(7, 8, 9)
assertEquals 9, argv2(7, 8, 9)
assertEquals 3, f(1, 2, 3)
f1 3, "five"
assertEquals 55, f2(10)
f3()
f4()
f5 2, 3, 5
assertArrayEquals [
0
undefined
undefined
undefined
], f6()
assertArrayEquals [
1
"x"
undefined
undefined
], f6(1)
assertArrayEquals [
2
"x"
"y"
undefined
], f6(9, 17)
assertArrayEquals [
3
"x"
"y"
7
], f6(3, 5, 7)
assertArrayEquals [
4
"x"
"y"
"c"
], f6("a", "b", "c", "d")
assertArrayEquals [0], f1()
assertArrayEquals [
1
undefined
], f1(3)
assertArrayEquals [
2
5
5
], f1(3, 5)
assertArrayEquals [
3
5
5
7
], f1(3, 5, 7)
assertEquals `undefined`, arg_get(0xffffffff)
assertEquals true, arg_del(0xffffffff)
assertEquals 117, arg_set(0xffffffff)
|
[
{
"context": "n singles also\", (assert) ->\n apple = new Apple \"granny smith\"\n\n assert.deepEqual createHistory(Common, {apple",
"end": 1426,
"score": 0.9132934808731079,
"start": 1414,
"tag": "NAME",
"value": "granny smith"
},
{
"context": "ve\n type: \"single\"\n na... | tests/unit/utils/create-history-test.coffee | foxnewsnetwork/autox | 0 | `import Ember from 'ember'`
`import {createHistory, persistHistory} from 'autox/utils/create-history'`
`import { module, test } from 'qunit'`
`import _ from 'lodash/lodash'`
{RSVP} = Ember
module 'Unit | Utility | create history'
{mapValues, chain, omit, partialRight} = _
class FauxModel
constructor: (@id) ->
relate: -> @
associate: (params) ->
chain(params)
.omit(["scheduledAt", "happenedAt"])
.merge(model: @, save: @save)
.value()
save: -> RSVP.resolve("ok")
get: ->
reload: -> RSVP.resolve(@)
class Apple extends FauxModel
@modelName = "apple"
class Orange extends FauxModel
@modelName = "orange"
Common =
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
test 'it works on pairs', (assert) ->
apple = new Apple(77)
orange = new Orange("blood")
assert.deepEqual createHistory(Common, {apple, orange}),
apple:
model: apple
save: apple.save
mentionedId: "blood"
mentionedType: "orange"
type: "pair"
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
orange:
model: orange
save: orange.save
mentionedId: 77
mentionedType: "apple"
type: "pair"
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
test "it works on singles also", (assert) ->
apple = new Apple "granny smith"
assert.deepEqual createHistory(Common, {apple}),
apple:
model: apple
save: apple.save
type: "single"
name: "apple-orange-test"
mentionedType: "apple"
mentionedId: "granny smith"
message: "This is a test of the apple-orange history util"
test "persistHistory should work as expected", (assert) ->
assert.expect 1
apple = new Apple(77)
orange = new Orange("blood")
persistHistory(Common, {apple, orange})
.then (results) ->
assert.deepEqual results,
apple: "ok"
orange: "ok"
test "persistHistory should work as expected on singles also", (assert) ->
assert.expect 1
orange = new Orange "Texas"
persistHistory(Common, {orange})
.then (results) ->
assert.deepEqual results,
orange: "ok"
| 90896 | `import Ember from 'ember'`
`import {createHistory, persistHistory} from 'autox/utils/create-history'`
`import { module, test } from 'qunit'`
`import _ from 'lodash/lodash'`
{RSVP} = Ember
module 'Unit | Utility | create history'
{mapValues, chain, omit, partialRight} = _
class FauxModel
constructor: (@id) ->
relate: -> @
associate: (params) ->
chain(params)
.omit(["scheduledAt", "happenedAt"])
.merge(model: @, save: @save)
.value()
save: -> RSVP.resolve("ok")
get: ->
reload: -> RSVP.resolve(@)
class Apple extends FauxModel
@modelName = "apple"
class Orange extends FauxModel
@modelName = "orange"
Common =
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
test 'it works on pairs', (assert) ->
apple = new Apple(77)
orange = new Orange("blood")
assert.deepEqual createHistory(Common, {apple, orange}),
apple:
model: apple
save: apple.save
mentionedId: "blood"
mentionedType: "orange"
type: "pair"
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
orange:
model: orange
save: orange.save
mentionedId: 77
mentionedType: "apple"
type: "pair"
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
test "it works on singles also", (assert) ->
apple = new Apple "<NAME>"
assert.deepEqual createHistory(Common, {apple}),
apple:
model: apple
save: apple.save
type: "single"
name: "apple-orange-test"
mentionedType: "apple"
mentionedId: "<NAME> sm<NAME>"
message: "This is a test of the apple-orange history util"
test "persistHistory should work as expected", (assert) ->
assert.expect 1
apple = new Apple(77)
orange = new Orange("blood")
persistHistory(Common, {apple, orange})
.then (results) ->
assert.deepEqual results,
apple: "ok"
orange: "ok"
test "persistHistory should work as expected on singles also", (assert) ->
assert.expect 1
orange = new Orange "Texas"
persistHistory(Common, {orange})
.then (results) ->
assert.deepEqual results,
orange: "ok"
| true | `import Ember from 'ember'`
`import {createHistory, persistHistory} from 'autox/utils/create-history'`
`import { module, test } from 'qunit'`
`import _ from 'lodash/lodash'`
{RSVP} = Ember
module 'Unit | Utility | create history'
{mapValues, chain, omit, partialRight} = _
class FauxModel
constructor: (@id) ->
relate: -> @
associate: (params) ->
chain(params)
.omit(["scheduledAt", "happenedAt"])
.merge(model: @, save: @save)
.value()
save: -> RSVP.resolve("ok")
get: ->
reload: -> RSVP.resolve(@)
class Apple extends FauxModel
@modelName = "apple"
class Orange extends FauxModel
@modelName = "orange"
Common =
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
test 'it works on pairs', (assert) ->
apple = new Apple(77)
orange = new Orange("blood")
assert.deepEqual createHistory(Common, {apple, orange}),
apple:
model: apple
save: apple.save
mentionedId: "blood"
mentionedType: "orange"
type: "pair"
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
orange:
model: orange
save: orange.save
mentionedId: 77
mentionedType: "apple"
type: "pair"
name: "apple-orange-test"
message: "This is a test of the apple-orange history util"
test "it works on singles also", (assert) ->
apple = new Apple "PI:NAME:<NAME>END_PI"
assert.deepEqual createHistory(Common, {apple}),
apple:
model: apple
save: apple.save
type: "single"
name: "apple-orange-test"
mentionedType: "apple"
mentionedId: "PI:NAME:<NAME>END_PI smPI:NAME:<NAME>END_PI"
message: "This is a test of the apple-orange history util"
test "persistHistory should work as expected", (assert) ->
assert.expect 1
apple = new Apple(77)
orange = new Orange("blood")
persistHistory(Common, {apple, orange})
.then (results) ->
assert.deepEqual results,
apple: "ok"
orange: "ok"
test "persistHistory should work as expected on singles also", (assert) ->
assert.expect 1
orange = new Orange "Texas"
persistHistory(Common, {orange})
.then (results) ->
assert.deepEqual results,
orange: "ok"
|
[
{
"context": "isOwnTokens\"\n expect: 200\n withData:\n name: 'Yolo'\n,\n method: \"POST\"\n model: \"DailyReportPings\"\n ",
"end": 1542,
"score": 0.9985710382461548,
"start": 1538,
"tag": "NAME",
"value": "Yolo"
},
{
"context": "ReportPings\"\n expect: 401\n withData:\n ... | api/test/api.test.coffee | MollardMichael/scrumble | 27 | loopbackApiTesting = require './utils/loopback-api-testing'
fixtures = require './utils/fixtures'
app = require '../src/server'
url = "http://#{process.env.HOST}:#{process.env.PORT}"
tests = [
method: "GET"
model: "Sprints"
expect: 401
,
method: "GET"
model: "Sprints"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "GET"
model: "Sprints/active"
expect: 401
,
method: "GET"
model: "Sprints/active"
token: "chuckDefinesHisOwnTokens"
expect: 404
,
method: "GET"
model: "Organizations"
expect: 401
,
method: "GET"
model: "Organizations"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "POST"
model: "Organizations"
expect: 401
,
method: "POST"
model: "Organizations"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
name: 'Chuck Academy'
remoteId: '-1'
,
method: "GET"
model: "Feedbacks"
expect: 401
,
method: "GET"
model: "Feedbacks"
token: "chuckDefinesHisOwnTokens"
expect: 403
,
method: "GET"
model: "Feedbacks"
token: "adminToken"
expect: 200
,
method: "POST"
model: "Feedbacks"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
message: 'Yolo'
,
method: "GET"
model: "DailyReportPings"
expect: 401
,
method: "GET"
model: "DailyReportPings"
token: "chuckDefinesHisOwnTokens"
expect: 403
,
method: "GET"
model: "DailyReportPings"
token: "adminToken"
expect: 200
,
method: "POST"
model: "DailyReportPings"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
name: 'Yolo'
,
method: "POST"
model: "DailyReportPings"
expect: 401
withData:
name: 'Yolo'
,
method: "GET"
model: "Problems"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "GET"
model: "Problems"
expect: 401
]
describe 'Status codes', ->
beforeEach = ->
fixtures.loadAll(app)
afterEach = ->
fixtures.deleteAll(app)
loopbackApiTesting.run tests, app, url, beforeEach, afterEach, (err) ->
console.error err if err?
| 138678 | loopbackApiTesting = require './utils/loopback-api-testing'
fixtures = require './utils/fixtures'
app = require '../src/server'
url = "http://#{process.env.HOST}:#{process.env.PORT}"
tests = [
method: "GET"
model: "Sprints"
expect: 401
,
method: "GET"
model: "Sprints"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "GET"
model: "Sprints/active"
expect: 401
,
method: "GET"
model: "Sprints/active"
token: "chuckDefinesHisOwnTokens"
expect: 404
,
method: "GET"
model: "Organizations"
expect: 401
,
method: "GET"
model: "Organizations"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "POST"
model: "Organizations"
expect: 401
,
method: "POST"
model: "Organizations"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
name: 'Chuck Academy'
remoteId: '-1'
,
method: "GET"
model: "Feedbacks"
expect: 401
,
method: "GET"
model: "Feedbacks"
token: "chuckDefinesHisOwnTokens"
expect: 403
,
method: "GET"
model: "Feedbacks"
token: "adminToken"
expect: 200
,
method: "POST"
model: "Feedbacks"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
message: 'Yolo'
,
method: "GET"
model: "DailyReportPings"
expect: 401
,
method: "GET"
model: "DailyReportPings"
token: "chuckDefinesHisOwnTokens"
expect: 403
,
method: "GET"
model: "DailyReportPings"
token: "adminToken"
expect: 200
,
method: "POST"
model: "DailyReportPings"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
name: '<NAME>'
,
method: "POST"
model: "DailyReportPings"
expect: 401
withData:
name: '<NAME>'
,
method: "GET"
model: "Problems"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "GET"
model: "Problems"
expect: 401
]
describe 'Status codes', ->
beforeEach = ->
fixtures.loadAll(app)
afterEach = ->
fixtures.deleteAll(app)
loopbackApiTesting.run tests, app, url, beforeEach, afterEach, (err) ->
console.error err if err?
| true | loopbackApiTesting = require './utils/loopback-api-testing'
fixtures = require './utils/fixtures'
app = require '../src/server'
url = "http://#{process.env.HOST}:#{process.env.PORT}"
tests = [
method: "GET"
model: "Sprints"
expect: 401
,
method: "GET"
model: "Sprints"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "GET"
model: "Sprints/active"
expect: 401
,
method: "GET"
model: "Sprints/active"
token: "chuckDefinesHisOwnTokens"
expect: 404
,
method: "GET"
model: "Organizations"
expect: 401
,
method: "GET"
model: "Organizations"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "POST"
model: "Organizations"
expect: 401
,
method: "POST"
model: "Organizations"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
name: 'Chuck Academy'
remoteId: '-1'
,
method: "GET"
model: "Feedbacks"
expect: 401
,
method: "GET"
model: "Feedbacks"
token: "chuckDefinesHisOwnTokens"
expect: 403
,
method: "GET"
model: "Feedbacks"
token: "adminToken"
expect: 200
,
method: "POST"
model: "Feedbacks"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
message: 'Yolo'
,
method: "GET"
model: "DailyReportPings"
expect: 401
,
method: "GET"
model: "DailyReportPings"
token: "chuckDefinesHisOwnTokens"
expect: 403
,
method: "GET"
model: "DailyReportPings"
token: "adminToken"
expect: 200
,
method: "POST"
model: "DailyReportPings"
token: "chuckDefinesHisOwnTokens"
expect: 200
withData:
name: 'PI:NAME:<NAME>END_PI'
,
method: "POST"
model: "DailyReportPings"
expect: 401
withData:
name: 'PI:NAME:<NAME>END_PI'
,
method: "GET"
model: "Problems"
token: "chuckDefinesHisOwnTokens"
expect: 200
,
method: "GET"
model: "Problems"
expect: 401
]
describe 'Status codes', ->
beforeEach = ->
fixtures.loadAll(app)
afterEach = ->
fixtures.deleteAll(app)
loopbackApiTesting.run tests, app, url, beforeEach, afterEach, (err) ->
console.error err if err?
|
[
{
"context": "['Title'] = 'Test Document'\ndoc.info['Author'] = 'Devon Govett'\n\n# Register a font name for use later\ndoc.regist",
"end": 201,
"score": 0.9998518824577332,
"start": 189,
"tag": "NAME",
"value": "Devon Govett"
}
] | demo/test.coffee | stanfeldman/pdf.js | 1 | PDFDocument = require '../index'
tiger = require './tiger'
# Create a new PDFDocument
doc = new PDFDocument
# Set some meta data
doc.info['Title'] = 'Test Document'
doc.info['Author'] = 'Devon Govett'
# Register a font name for use later
doc.registerFont('Palatino', 'fonts/PalatinoBold.ttf')
# Set the font, draw some text, and embed an image
doc.font('Palatino')
.fontSize(25)
.text('Some text with an embedded font!', 100, 100)
.fontSize(18)
.text('JPEG image:')
.image('images/test.jpeg', 190, 200, height: 300)
# Add another page
doc.addPage()
.fontSize(25)
.text 'Here is some vector graphics...', 100, 100
# Draw a triangle and a circle
doc.save()
.moveTo(100, 150)
.lineTo(100, 250)
.lineTo(200, 250)
.fill("#FF3300")
doc.circle(280, 200, 50)
.fill("#6600FF")
doc.scale(0.6)
.translate(470, -380)
.path('M 250,75 L 323,301 131,161 369,161 177,301 z') # render an SVG path
.fill('red', 'even-odd') # fill using the even-odd winding rule
.restore()
loremIpsum = '''
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in suscipit purus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus nec hendrerit felis. Morbi aliquam facilisis risus eu lacinia. Sed eu leo in turpis fringilla hendrerit. Ut nec accumsan nisl. Suspendisse rhoncus nisl posuere tortor tempus et dapibus elit porta. Cras leo neque, elementum a rhoncus ut, vestibulum non nibh. Phasellus pretium justo turpis. Etiam vulputate, odio vitae tincidunt ultricies, eros odio dapibus nisi, ut tincidunt lacus arcu eu elit. Aenean velit erat, vehicula eget lacinia ut, dignissim non tellus. Aliquam nec lacus mi, sed vestibulum nunc. Suspendisse potenti. Curabitur vitae sem turpis. Vestibulum sed neque eget dolor dapibus porttitor at sit amet sem. Fusce a turpis lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
Mauris at ante tellus. Vestibulum a metus lectus. Praesent tempor purus a lacus blandit eget gravida ante hendrerit. Cras et eros metus. Sed commodo malesuada eros, vitae interdum augue semper quis. Fusce id magna nunc. Curabitur sollicitudin placerat semper. Cras et mi neque, a dignissim risus. Nulla venenatis porta lacus, vel rhoncus lectus tempor vitae. Duis sagittis venenatis rutrum. Curabitur tempor massa tortor.
'''
# Draw some text wrapped to 412 points wide
doc.text('And here is some wrapped text...', 100, 300)
.font('Helvetica', 13)
.moveDown() # move down 1 line
.text(loremIpsum, width: 412, align: 'justify', indent: 30, paragraphGap: 5)
# Add another page, and set the font back
doc.addPage()
.font('Palatino', 25)
.text('Rendering some SVG paths...', 100, 100)
.translate(220, 300)
# Render each path that makes up the tiger image
for part in tiger
doc.save()
doc.path(part.path) # render an SVG path
if part['stroke-width']
doc.lineWidth part['stroke-width']
if part.fill isnt 'none' and part.stroke isnt 'none'
doc.fillAndStroke(part.fill, part.stroke)
else
unless part.fill is 'none'
doc.fill(part.fill)
unless part.stroke is 'none'
doc.stroke(part.stroke)
doc.restore()
# Add some text with annotations
doc.addPage()
.fillColor("blue")
.text('Here is a link!', 100, 100)
.underline(100, 100, 160, 27, color: "#0000FF")
.link(100, 100, 160, 27, 'http://google.com/')
# Add a list with a font loaded from a TrueType collection file
doc.fillColor('#000')
.font('fonts/Chalkboard.ttc', 'Chalkboard', 16)
.list(['One', 'Two', 'Three'], 100, 150)
doc.write 'out.pdf'
| 29567 | PDFDocument = require '../index'
tiger = require './tiger'
# Create a new PDFDocument
doc = new PDFDocument
# Set some meta data
doc.info['Title'] = 'Test Document'
doc.info['Author'] = '<NAME>'
# Register a font name for use later
doc.registerFont('Palatino', 'fonts/PalatinoBold.ttf')
# Set the font, draw some text, and embed an image
doc.font('Palatino')
.fontSize(25)
.text('Some text with an embedded font!', 100, 100)
.fontSize(18)
.text('JPEG image:')
.image('images/test.jpeg', 190, 200, height: 300)
# Add another page
doc.addPage()
.fontSize(25)
.text 'Here is some vector graphics...', 100, 100
# Draw a triangle and a circle
doc.save()
.moveTo(100, 150)
.lineTo(100, 250)
.lineTo(200, 250)
.fill("#FF3300")
doc.circle(280, 200, 50)
.fill("#6600FF")
doc.scale(0.6)
.translate(470, -380)
.path('M 250,75 L 323,301 131,161 369,161 177,301 z') # render an SVG path
.fill('red', 'even-odd') # fill using the even-odd winding rule
.restore()
loremIpsum = '''
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in suscipit purus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus nec hendrerit felis. Morbi aliquam facilisis risus eu lacinia. Sed eu leo in turpis fringilla hendrerit. Ut nec accumsan nisl. Suspendisse rhoncus nisl posuere tortor tempus et dapibus elit porta. Cras leo neque, elementum a rhoncus ut, vestibulum non nibh. Phasellus pretium justo turpis. Etiam vulputate, odio vitae tincidunt ultricies, eros odio dapibus nisi, ut tincidunt lacus arcu eu elit. Aenean velit erat, vehicula eget lacinia ut, dignissim non tellus. Aliquam nec lacus mi, sed vestibulum nunc. Suspendisse potenti. Curabitur vitae sem turpis. Vestibulum sed neque eget dolor dapibus porttitor at sit amet sem. Fusce a turpis lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
Mauris at ante tellus. Vestibulum a metus lectus. Praesent tempor purus a lacus blandit eget gravida ante hendrerit. Cras et eros metus. Sed commodo malesuada eros, vitae interdum augue semper quis. Fusce id magna nunc. Curabitur sollicitudin placerat semper. Cras et mi neque, a dignissim risus. Nulla venenatis porta lacus, vel rhoncus lectus tempor vitae. Duis sagittis venenatis rutrum. Curabitur tempor massa tortor.
'''
# Draw some text wrapped to 412 points wide
doc.text('And here is some wrapped text...', 100, 300)
.font('Helvetica', 13)
.moveDown() # move down 1 line
.text(loremIpsum, width: 412, align: 'justify', indent: 30, paragraphGap: 5)
# Add another page, and set the font back
doc.addPage()
.font('Palatino', 25)
.text('Rendering some SVG paths...', 100, 100)
.translate(220, 300)
# Render each path that makes up the tiger image
for part in tiger
doc.save()
doc.path(part.path) # render an SVG path
if part['stroke-width']
doc.lineWidth part['stroke-width']
if part.fill isnt 'none' and part.stroke isnt 'none'
doc.fillAndStroke(part.fill, part.stroke)
else
unless part.fill is 'none'
doc.fill(part.fill)
unless part.stroke is 'none'
doc.stroke(part.stroke)
doc.restore()
# Add some text with annotations
doc.addPage()
.fillColor("blue")
.text('Here is a link!', 100, 100)
.underline(100, 100, 160, 27, color: "#0000FF")
.link(100, 100, 160, 27, 'http://google.com/')
# Add a list with a font loaded from a TrueType collection file
doc.fillColor('#000')
.font('fonts/Chalkboard.ttc', 'Chalkboard', 16)
.list(['One', 'Two', 'Three'], 100, 150)
doc.write 'out.pdf'
| true | PDFDocument = require '../index'
tiger = require './tiger'
# Create a new PDFDocument
doc = new PDFDocument
# Set some meta data
doc.info['Title'] = 'Test Document'
doc.info['Author'] = 'PI:NAME:<NAME>END_PI'
# Register a font name for use later
doc.registerFont('Palatino', 'fonts/PalatinoBold.ttf')
# Set the font, draw some text, and embed an image
doc.font('Palatino')
.fontSize(25)
.text('Some text with an embedded font!', 100, 100)
.fontSize(18)
.text('JPEG image:')
.image('images/test.jpeg', 190, 200, height: 300)
# Add another page
doc.addPage()
.fontSize(25)
.text 'Here is some vector graphics...', 100, 100
# Draw a triangle and a circle
doc.save()
.moveTo(100, 150)
.lineTo(100, 250)
.lineTo(200, 250)
.fill("#FF3300")
doc.circle(280, 200, 50)
.fill("#6600FF")
doc.scale(0.6)
.translate(470, -380)
.path('M 250,75 L 323,301 131,161 369,161 177,301 z') # render an SVG path
.fill('red', 'even-odd') # fill using the even-odd winding rule
.restore()
loremIpsum = '''
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in suscipit purus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus nec hendrerit felis. Morbi aliquam facilisis risus eu lacinia. Sed eu leo in turpis fringilla hendrerit. Ut nec accumsan nisl. Suspendisse rhoncus nisl posuere tortor tempus et dapibus elit porta. Cras leo neque, elementum a rhoncus ut, vestibulum non nibh. Phasellus pretium justo turpis. Etiam vulputate, odio vitae tincidunt ultricies, eros odio dapibus nisi, ut tincidunt lacus arcu eu elit. Aenean velit erat, vehicula eget lacinia ut, dignissim non tellus. Aliquam nec lacus mi, sed vestibulum nunc. Suspendisse potenti. Curabitur vitae sem turpis. Vestibulum sed neque eget dolor dapibus porttitor at sit amet sem. Fusce a turpis lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
Mauris at ante tellus. Vestibulum a metus lectus. Praesent tempor purus a lacus blandit eget gravida ante hendrerit. Cras et eros metus. Sed commodo malesuada eros, vitae interdum augue semper quis. Fusce id magna nunc. Curabitur sollicitudin placerat semper. Cras et mi neque, a dignissim risus. Nulla venenatis porta lacus, vel rhoncus lectus tempor vitae. Duis sagittis venenatis rutrum. Curabitur tempor massa tortor.
'''
# Draw some text wrapped to 412 points wide
doc.text('And here is some wrapped text...', 100, 300)
.font('Helvetica', 13)
.moveDown() # move down 1 line
.text(loremIpsum, width: 412, align: 'justify', indent: 30, paragraphGap: 5)
# Add another page, and set the font back
doc.addPage()
.font('Palatino', 25)
.text('Rendering some SVG paths...', 100, 100)
.translate(220, 300)
# Render each path that makes up the tiger image
for part in tiger
doc.save()
doc.path(part.path) # render an SVG path
if part['stroke-width']
doc.lineWidth part['stroke-width']
if part.fill isnt 'none' and part.stroke isnt 'none'
doc.fillAndStroke(part.fill, part.stroke)
else
unless part.fill is 'none'
doc.fill(part.fill)
unless part.stroke is 'none'
doc.stroke(part.stroke)
doc.restore()
# Add some text with annotations
doc.addPage()
.fillColor("blue")
.text('Here is a link!', 100, 100)
.underline(100, 100, 160, 27, color: "#0000FF")
.link(100, 100, 160, 27, 'http://google.com/')
# Add a list with a font loaded from a TrueType collection file
doc.fillColor('#000')
.font('fonts/Chalkboard.ttc', 'Chalkboard', 16)
.list(['One', 'Two', 'Three'], 100, 150)
doc.write 'out.pdf'
|
[
{
"context": " 31878,\n \"version\": 2,\n \"merkle_root\": \"66a49b2597da0db93df384c735f0029c2d0b115234a94b6f54ed313820475cc1\",\n \"time\": \"2014-11-19T20:38:15.000Z\",\n ",
"end": 433,
"score": 0.9738450646400452,
"start": 369,
"tag": "KEY",
"value": "66a49b2597da0db93d... | app/spec/fixtures/fixtures_blocks.coffee | romanornr/ledger-wallet-crw | 173 | ledger.specs.fixtures ?= {}
_.extend ledger.specs.fixtures,
dongle1_blocks:
blockTx1:
"hash": "000000000000000006c18384552d198dc53dcdd63964d9887693f684ca0aeeb6",
"previous_block_hash": "00000000000000000efa2551c14534c385ed1af3edffc8f276f13c0ddd0b5afe",
"height": 330760,
"confirmations": 31878,
"version": 2,
"merkle_root": "66a49b2597da0db93df384c735f0029c2d0b115234a94b6f54ed313820475cc1",
"time": "2014-11-19T20:38:15.000Z",
"nonce": 2609822097,
"difficulty": 40300030327.8914,
"bits": "181b4861",
"transaction_hashes": [
"141cfa11f5e6c8633230986559173ab47b2744407dd7f74c01f8c007bb65fba5",
"3f59869d1f798c1ec29270c00ef3d7feea5d1a2a54b009f416335d7701469a2e",
"ef3e27162e370d3cb4ad5941ba592476c9ab99acb11c6c2366d167d830f85a89",
"702c4cd44113cc9fc2a90aeb8fd7966970cff7c1ad5a42f52648a17ed5419fd0",
"f2e49c94fd0f7a5acde30c667d927bb9af693d9b886dd13b1e741b8bc8be2713",
"fd7d1fe781b4c9af4eee3141abdd28cd3fae2fdb46e978c12663f5d21151a327",
"85c6d951c62b95cdc473b8c301efe129d501a2b889c823de1ba1fece055d86aa",
"2c13d2abdcb2909870fc81aa3473a9e81fa18b25a64b94600c09c25b730aa306",
"0b0fe1fe9b50109056f578f6f206af89af900382976a231d98b63adbcfd8d07c",
"9c712fe478643520056eca08af66a6ada93fcffea6e73c2d5c41a7f9cfe3e403",
"33a0c99c444db99873ef089208a4f5cdee5667a99ec85378be8b91a3f8e24966",
"e05a2967e9fbc31b9eb29b6ecf68755dfe6f711725ee8ec8bdb17a692731a399",
"99f6193e94f38ea3e0db8e92c42734aee0311420d4da4778de822b6e28228191",
"4b56737bd27006e1ce36bf971b48e939ca9d9b66d1d3d03d955987bc33c34352",
"6d319ec3ab2dc6cdb531e3719d023d0b44c6c992ff5197a46be85ac0b8cb150a",
"c48ba05888387290cbd564459e1c73ee401b15d6413c19354fb40bcd3581f5f2",
"acaaa17753081fefbf5294f8f8c747e29661db2103a4162cc08bca15156c9a4d",
"a45ff90188dcd3c8b916bf1dc57e7550edb7ca6b91ed96ae3f97af5446a2eca0",
"9805b8d90c761aacbfb67d74f9c04746ce708ed4eea911912f1536ce0b0e10e5",
"e2ed38096da06c49c9545ad57884327a80f6b265a86e12175d2c66c1634cd49e",
"dc7d4b06ddd89da3d767ff1f9cbbbb0efcd5c9919979ef5943c51887394b905c",
"1628ae0e2eef54117457876c6ca6fb71766e2b11645e0fd2e0bcc9006416f1c7",
"aef8bf817414e8746b9e9e5a5b5c5104ed2d550afa777579f32690070c8145d6",
"b6552ff5537ef7011a1aaa9518b00cf31a274ad6af961e756afe0f3ec47ccce6",
"7ba6eec6804e1fc4546f59e9d8621a46c62434b43091ffe6eceb57108af6861d",
"82f762853346f230e8c2d67c29995cc15b4dfe834bcc4548b0b2b7ff0f0d8802",
"ed6cf77552fea28c4ae9415433f88b09fe5a7673e629441a231e1ea0128ed5d8",
"9cf7f5c51e35cd5ef48aefef36ce725d122b1f6e7ec09f7ead1ae203e265f234",
"2aa4ce56044b3da146ae82bd834430c29adcd6413231b4d5941c31fbdd64777c",
"578762e1f4f322392e9440419955a79264471f53e6da06f7b3d664cb04762f0a",
"28ff583dd5c11153de55e216584a79301970434b46b93926039bd3eb23dda2fb",
"26ccdab63a990ec477deaa0dec1f6f3be38c805894dc26dd55d6fb00e09e7f9f",
"9a7869b8e5cb2338f7107bda4dde1667ec0e56daaa3960891719ae6392044cb4",
"36f1c39755721f8e8cfdcf8ebe0fe848f6eb7eecc72d9717961bac98e08b0d62",
"a947a01d1760f918f26e27c80e5dd9ca7a23ebbc5993e1aa7698b44403e0c865",
"553b03fa3bfdea1820d45198fa2ce7084bcb949db4fa12c440fe658f9ddf7737",
"29f3d57c9e66d6090576736acf7a3a1dc755a36ea41d4bc82f74067cd27b675e",
"fa1c375b8a02e85a3457016c33ba00f973fe396777462979013fdf89d2c1ff4a",
"e2fb4ff51dcde0bf093d7bf03bfcd0e9c7d2db236e5cef8cab40b1941fc7fc54",
"69d30f08b43d4a232084c4a5c1d3a06af4e490583cf28aa993a715028b389976",
"297c42a6d315477e356417170a392629e69d1a91b4a1d2b4adda02eef334df62",
"dfe4f3b25e140584f4b0ee94c37b7c62a40e203cf88a408a04d3f837904d9039",
"1207d2e6fca445a055c48aa069904e2e30e51614b2704af778ab57b9ca8a475e",
"4c29345e95af98a66216d436e7d8f4d05c3d1e97961683ecffa6061f8501514c",
"3c34824ea3cd340e370d4e348181fe9bbdae5bea3176c6872af44dd561c7cfd7",
"546e9eaeddba59b837b9346e48bfc3c431e6c0575e7c49e26ed859f9e969e017",
"d391f233a80672db80d8cea0b7e1ed70ed9ce36e288a3902c274be6f19ad3987",
"490dd83dbd0bfeba777ffcd533063f9a6b6ced1504d50b6d883c2a0dc9756740",
"947f04dc06573591fe8b498b8b286e97a3f2126eeb5c3885c3e5e539e10fbdc1",
"8bfd5ad031e4975bc7c3f8c05c096405d031347923d0f157a6a7692abead975c",
"798dd73ebbeec086cb799f4275408cc970450f252e1b155a41f5ca85059bbfae",
"63c650a4558b9d8900d96e3199f6d8aa0d173b3717513305dd6025d13ed6929e",
"abf7af274de6d6b5f8b12199dd9a8bec44ecd03a0f5f9d4d8fc8cfa411c19b5f",
"e6115694a1f4b083bd6bb1b9debcb9c701b9bd6feb6a29941407ff9f712fe9d4",
"f8d209634615d0b76f7c4df316561b307a5eca14078a4dd33015f608754fc7a7",
"bc092d4a3441541db59d53a13fec1bc61dbbebe075ccf05aef14ff009981f345",
"e5a656dc5f19b8da9b879bfae5b1d75a7ac0d41418808ceba8e3120cf4a61a0d",
"00a9d3cb453119dd56607d6506939df366a0ef855521e7c212f36478a86043f4",
"b79671b36b23ce81668280a30f0a95c5fc787a7b40d8b88703539a256a44b83c",
"457ec2f4599cd39e97f2ddfac01e897c4d7b802e57c6fbd263884b679874582f",
"b2938e06eac22f962aa214d2edddd36d6dcf5218d3523bace54c5993ce969768",
"2de38d4e431fd34e47cd36520d5c59e5ba286037c5276cedd47fcc7933814df6",
"0b127c7876345604bae9de8d98674ceb1cf89c922cd7aa88c61b91bcf74b3e3e",
"7aac275cee30440ed1898e502edd2119aa137a2c7c44108ca43a14364bcb8819",
"f49a411796bfea6b9d45cd6a74d97387fcf4be26b1b556392011fe969387f1ef",
"5f756ab3e0f03b5f86abbe3bccf3b78eb8db052c0956937653da9cd1b490b933",
"6059fa4ebc9e0c569a2747d65f7e9fc4fbdc7895a5c000111b69e8812dc80d85",
"0aa9c27efd037160e4754a4808bd8f59338a4e250ff96f84dcbbe25adbc83530",
"0d58c907e35a20846e37f12ade5fa98c7735cf6d53ad552de1e60af946cabe3c",
"e12d86f5974c6b3244ad424f1954228eca71d5a10bb1b5b4c19c74740648c2ab",
"a804d56c3dbccd846fddcf8cb7b091ca34132853a9381fb98a510b2f09dcaf33",
"f5715849319df1ceff4301a249921906ad33407a2540c2e769fb9db9aa561c36",
"76503816c7a5c49bbbb2b1546d7deb7cd4c70d8eda493a5a0b3d2562b8d9a8cc",
"612fc9008f770d8ae8347ee131235d34db3ec89c8b0e1e500d737393e666c6df",
"c634fa072e469fd6835a4be92a071b894219179815681f73c0cd79078cc4d13d",
"8d3ca6b27ba58658df6df748efdb5db8d625f17e8ec81be5b875d17683f0c1d2",
"3c7d0f3eea77613c0d4631c92387225919e6fd21c99d1522ddea0bd1c8e13d58",
"4b705166e246752846011874b48616d51b1adfd27fef955c5d846b2ce2a5a680",
"859ab04f398dec1cc370185c9190a8e4ef68cb065578765578a7d3e37b8414b0",
"83a3c44cd5650b9fcd3f7ad21ce66c53b72dd6326a53d34a165cc7751015c319",
"7d81606e97cdd92c25052305ab3090476ae445c05048f98f2b7a045f3a77016e",
"6f34b028d306e351999c309b0d75e2888b26c077212661f165fb4f1fef78e437",
"462830a6ba7aebd7dd750af60fd5444f7d02f99e06cd26da1c6ef42c9e4d96ea",
"3baa7c91c9554a0eb35dbfa23228c7861a107b1d5c2885c0c8641a4865a041bb",
"90e8198bd89b365b78e294fa16d79e5a15bc810a16438a97a20e2707f209f32a",
"362c16e203b3f86d68183fb63ad8f4c2cf2db59fa93378663b2cd26b0bb20d03",
"3a5daae19ba2f8620f77406a291007184868b5a0476ce1cee2747e3591752cb3",
"12bffb0f684ab385720ef1dda62df7edad59bafe2e14884ce3d0bd3ec33a4538",
"3ef1ad90444a6a1d0ce1bc86ead639ef9e9cac14d3cf2aaddffb22d0b251e54d",
"02b0d9e6ab52d7e754af1e4bb4a887195ca93bbe10c3e62e35c45c3b1bceea7a",
"fe66332427fd4caafd5d7ff89be224127ebd0893bebb2ad4811b3a860330b1d5",
"b42ab110c9e80275ca3063575a71141f3c00d245e1e937b54f1bfc6a97d76f35",
"a67233958653ca94d030c5c0d04a4802634e1bd0492e7d5ca8acc226d9fb48f8",
"ce3c1fb484710cf310b90bbd6dfbe699ece0aed3ed7f5fd5727e59fce6f279bb",
"9b22cba6a1ef422230a7e52a4837c1336dc29ba34385226060d670636399ba66",
"01ea40c04be975c62074a110c5c0ef6c637f1692a175fea8bd359811345142b9",
"b61d27174f940a350d3bd3f8f3b13b97d1fca6a31c93ec1c1c7305d124c29f3d",
"7e26cece264c20e81f5e1b95338f5390bca4722abeabbfa5c876e633fbc4e1a9",
"681340230c1a3e61c4e4a5c8c578dd2229dc498be8621b3683aa7d37df9b86b4",
"cc7e579fb1ac798171e1de2809aee85acba3f7e7ca0e37a294486ec2f2b1b0e5",
"c5e5f4897bdf6572bc19d53649822b50ea916bebf1a314448716548f5a11dc24",
"0d4a9db255cf3fd3292f55eb10c4555e24d44052e7307a12945098dd9101933b",
"91fc0b2fc240300469c04da3c0d19a656ec0638aa8597bc68c5ed3aae838ead7",
"961c71e4485db95edb86df0a7327a9ce3c2753d0011bdc3101a1d09db619cde1",
"6d42ae942c87cb1283a65b74c3b1c679128e59cd6fe1ab96b1c17fc8053ed5c0",
"b070aeb60d7c10de16c5d0f7bf8ad14398c3596d5a215f1703ad370dafdd6f52",
"27f7c75f4f6bd9a2915fb506b8f735d71f804c0782ffce081a27763a1f0f2aba",
"6b3a852d128e841687cfe9a5acc667bf8f021f692b99f1e58f8dd394b384ef3f",
"62bc9d162477d5607c420a309794e75600575560146ad95eee5a0db7e7dfa8ba",
"ea7c8f7ff3103e90b2d3d80d8e148b750a564c9827b1b1b0babc0528aa01b87c",
"14427db61559c27aa81e67f0279fc16a26cabee3223277baa6e7c7a3c32a4d97",
"d8adb44f00534207ee6ff4a65af10238945c99004510454393671d72ee1f903d",
"681a2945366743f8bdcb14e6425a8bb4f911cdf83a1ce9485c5bc452a3e4bea5",
"b3db08f56af0df0577b02ee6fc9e1d346ae8d54b7b1c1b1df413fb25297cf31b",
"fb662828a055676a9fa7fa2f842836a07b7c9e9f0101a09a2e310bb0d5bba1dc",
"4597c2dfb48f3162d7bbfbd6982ebd27529711b8fd4f91062eff211585bb72ee",
"8525670dc0854b624d84e9c8fe91b848b8813e971627bab91acfa2620ee216ea",
"8bf0764b4b3520283d302850f4d6e21d82a7ce2e63d5e48cd214ec1bcb4f81a2",
"6199ed9a98e090fc48fe67f65e6150d7282573cd85ae253855a727b9cdf0f83e",
"744192c24fd6b1ce824ea35e2eb623ff5a9e1f98d6687f30c34a8aa31e828942",
"743fe6a54bb5c56ded4d539357c0e3e7151b21df1f44a99aeec01dceec96b81f",
"64c892db54f0156bcc62195f58f6664c3e8605ffda7f187c0db5dc765a279868",
"221cbbe5e9c94e30afa60d338b5233dfe96b0887193611cf2dd95ee48eadad41",
"719f8d965e733d2fb3642755563356302dd793fc9c6521b0e70c7ce638be1bb7",
"980beabe3987d823945c7c83fdd37b0420e5d8b18bc055705e0201d7096c96e6",
"136bc45dbfb27216efff1833ec75898adde34786d7741949b96d691e365ec98c",
"3610129053d6e9e75fdfa7586bd572e50e5159883121704272323b2a5cf1279a",
"8a366e6c01f9850361451742edfb865a15a5689162d7e8b4029c291c04a9e3f2",
"d0da297eead55c69fee7a4222fd8b9116ba675917a07dc9c10df568d2c665cd8",
"1a6a2a3127258beddb5f7c7cf7103438d08b66756406208b9a6091015291ee84",
"477e5508304fcffb1a547e0605979bb671407fb646708a2360f9925851e6cfe0",
"f94c1f3b2b3e3d74dac022ae514cedba8fc15611a370b543ed823265c652c147",
"09e9dd5bbde26662d8fee6851035e6bb03aff41a7e70c2e9f5e1ffaed0bd982a",
"2e6e65542b1c1c0475c721480c4e5bb4934e221d14b9f4012828dd335a830350",
"203efc4dc726789638810f9ff7cf013ca6b71d2c2156f664ffcccd9c35f4320d",
"e610941b817092d0213dfab1b01190178710ea4d1ef5466df6dbc08c58e59e94",
"1b089314924c8d1746b5e87d9f1353a59f689d9155a54ee178f89bd5c8ec19d1",
"fc412b37c2e00bfe3f50a3286533f8b31f4d30e6986465ee516b715fae9a281f",
"77d3517fd0c4836536bc609cbb322970df31d829b0f3de69d7eff93b09776f0c",
"e00474afbab6bd2b3ba1c11ae6252deb818e805feec2c2a58208131513957c15",
"c332881fcb21131c3e9271fbf24b243d98a00e5c71bfdcc2b68a8ecd4cf8b354",
"aed4189836c9b04a7cf7c1e39075a07ac8830780bb116403e8966a7f30fa0dfd",
"e7b14c473725a8a505c4050a4c1436e315364cd7848194dbe7af671a5c92680b",
"da3d7a147358a96a322dbeb984142c8f6dd8c631ff33de20a255191211d1b467",
"925cdce8da7d5754634b85110a315cb0d466d4e866015277c1d26a7299cc99b2",
"ee5719785081dc6255cedd0b1ab114cd771a349f814dee0e2f3f8cd8bf1ec323",
"3094b14d80c28fc532552d4906958a3e60d1118537d1768e5e23f7366cea8b38",
"453884d92c5cbdef7e06d0e872279de0ae561bf81ef92581bc6ef79e73ea0963",
"4960c41987eef627de6dc973deafde8c0525ba877067761d9af62229991ac739",
"e6862e18d81852a47b9b47ed442106807823fbba537f80ea5be5045397065226",
"d903546431f9703320dccc447bb812e14bf82b15322fe6d310470fb461a43552",
"e538ac8622f04bb0107bbdd84ec4f4f8e42621bfba2e0c2dbfd6d477e01284b4",
"a90919a7441cf68324f1af403b305b6184e1cc55077b97f32720089583aa0055",
"ce4897268e8829d2092576c6b4d2ea561150e819f68b6cd93bdc5a548e5d1b09",
"ffa9ac50d1607f89e4e4d3f657869e775f24bf85e7eea108ea8122d789391884",
"c4f33a3289229de7a53cc3f7ecacb2c438fa7aeb04346a86020e4fd441eef48b",
"d2dc014f4fa4363f64c57dd8c0bd3a26d3088c3aff15b246d28c5a1f996697a8",
"60e392fc967e1ebf4228723ad91ab91c318a2b6f78908cdd1341089aaa00e143",
"091102575e67ffc8736425a5aa83e74a6ca933585d480194f86bf75492477d2c",
"23e37c554487ba32840a97d9803fbd95e8822684854b5705ec307bc42e598bc5",
"f726f27ae78a9e93d70fcacb4df5ca8ae4e31bc0e12bb042dd19d3e8e47bf527",
"125bd094b0ad103d504654a89fc087f7af6b6414d4ee2dd661ee34a322167223",
"b72998864f42e20a55c7efb95bbe394f9ab2973c25c94d70ef59d53be7557d25",
"77c5d442da8b5115c05e0de34098eee83a6624355d1c1d0f67d14e0bf319d9ca",
"ac41f2022d313c42eda36dd4a69dd3a58ccab1e80bfc4cb14374cba417d99f86",
"235ab97f801f7eda80ee84a5e6b0363a8cf2072f28a7fabb2429a82908f61aa9",
"9ea1c5d0bd6818b1d370e594a525f7087e76d8cbf7c5564e40be329bca7a7634",
"813dbed0acea888b836a19f83f2b3f44ce3f28b5214540cbcdffdccf90d712f9",
"d4e77ff32f6340b3954f5746e395292f05f125f2fe422fef9c17d27addd0e107",
"4534f0a0b62076192d9a1f81170aed045768dc2b5c56433fa52455faa9d2e215",
"b0ce1f972325a07c2304211345948ef918cd8af4fe58296d3a808dafb77eee3c",
"ee352fff21c4635b3bb4986c9f291176c1e2e8178e982f3daa9c216ee6072f3b",
"9708b0dbd24bdf3bb49790ed2bfd0a4d709c3cab9c65a7772ad5474056023ba4",
"ccf628dfb662a44b4e8950ba680e9c304f165d9849b1c95674610625ecfdaca1",
"e3ceb5195f8d65824110f47a4ea2665cc151cca7c5fd395a29ca5c4ada7b4ebf",
"0e3c18415765d59e27f81d14014a4d924e4f2c2f79d031afb4815a61d0c10e14",
"393f713890d5a230baeb850a7723bcae9da1ba1487a9f67224786f4465e5c4e2",
"8a5642ab466f5749a877d274d75492442b4eac6357f0ba26e343ad20b3ba9a3b",
"1312f4f33b685e9cdb34e5d3e2ba61f342afe2e1b2f8dd6b4ca4477d229d13ba",
"30b52d6a89eae187b1ae97fa73a0fbbc64bdded33bb187f87afadf74fb833dc1",
"3ca1db2b047ca7a16b8d20ac65b188d411b16c67bde1e2e7415586e0f70d95b9",
"1cc3a656e27fbabbc24596fd06a21315c71059d2ed3ad486a7b5481366f351d2",
"29f616081e2ab23a4673f770c30df5a80bc7a756715825ef26453fea5c34a53b",
"79c62370c38f5601d26cbb7e312a370b6e89b91407d1bc71bda0a1357f68d5d3",
"e43640a36f4ec2e16c659ace3651cd75b5113fdffd2d7f491631a7acba0d9521",
"25dffb11825bb9b9c244264653b554d3672869be4c4f6dcf3f9401e463af3efd",
"c43eb40bed860d49b8a14238428f94d391c2d7e801db8b0229c3dfa64de4edba",
"220114cada6854488b2a77361b5d0114578a48ca810e121641a35e403b5406b8",
"297976db704a34243c1054e71351a2b3a1a324987ba65415e1e367c378e8836b",
"e97dc76de7042d4f1dc37aa63e0fad471ca83c1d019801f2c78a7abe83de78a9",
"c6074f25accbf2700c6bf46e3ab9a5847ae3a57beffe2974761681f9bd79cc2c",
"9b44183cb82e2d05e6a3a173e1f63499e15cd9b3a00cf68ae0d72e5fa22e6fb2",
"13bfecf16b86cd1d307c5047e0c9b010e34666f0e3ab07e5e59ba54b1826797b",
"7138dbac0a89b26d21b05b9ab88ee5fe82f79d82ce48c534793057a48058230a",
"106840f4e022d16e080e81dcec0dfe2bcb4c27661348d7102b180a9d307c689f",
"8723f4a665183b470a1fbc0ab9796b5f923573e46faacf7683a247bfb6656392",
"a933e8a9a71ce4a64f294a04e09f61ac9f8e6b6826030c51d37c25772307a3a7",
"170e2ece8d38fcb7fc81a07d57719d3e96fee9f5cac93b030752eb1f1acc584f",
"5217ebd586385a7d25347057a70e525245d815e27a99cd1719c877ee91cba2a3",
"1907444757c1dda2b370a034317b6b5877451ade7dd87a8abff190dda0f65113",
"ec744c7c5d9c32a681e59c1ba5806d4821cb23b0fbf37285e51279984bb6885f",
"dd453c9db68f4889b59befe12d88f9ab2dfb16261e5992d0b8539fbdc4641e6b",
"5ed50d43f13a9243af7fab5c2d1a40c5ef3f49100d61651c28e607322dbddc3f",
"5848f7f7e3a42d87a8b929a896d6878ef0b5b964d0152557d05290f658f7ca48",
"c5be3fd9dbbbe2a228bb36ec765a56c9429c26fba450bba09b1fa322a9a7e2bd",
"99dd416abab8adbbd8ed7720c6c83d5c9a1bc0b2a3c3ac63d5f2e8ec9d5738f6",
"7ba301ecfd694c7d6843323f7c13d3e054f1a148f8968d6b926a226215b35178",
"7b25a40af721f13ba6e647efaa0863f00bcd06fdc15287ff3cf1922a9428ca80",
"95a0ea809f7f3250f9f76a82ed22e3f62fd8d7a4d7baa4de48062e961ef468e7",
"72cf98ec2eb0a77961a9322028a49675f07738d89f0b566d921e864028a4449a",
"039f2fafad820fa9e82db3a74ca235276a3b0ef98ce7ea3d6c7cb37230e49546",
"d91ccc9c49a91d8e661523ff27f83da185671499f4ea2249bcfcf8292cbfe779",
"df79e5b1e2fcc3fac3d9bb9ec1a97ff7435d67f6f3f9bf50f4bb4ed8dfe46768",
"90d87249947627d79c653197ac3aa4c12f33681d7f2cc1120bb8daee50c4f3fb",
"f6585b1562163a17ddb29569fb613ea3587761eef15d105bda1ae9da640a2a92",
"f353968ae9f5057bd52b22f8eeccb1166d30902fdd6209c18f11aa60825d0207",
"1ee6420382974d03df3453aa0226aab04e69147f676feedddd9fa0e60dc50d7f",
"e1484da3bcf33de7926e0df334b9c7d07d86684bbd0b633f9b16fe728432110a",
"7dd99abf62e95daeaf204a9e999ac9683276df8659fc6b8809ff04b854c20dc6",
"4b410c2983940044a950a332c34fc8c6e43e797e7ca63831f9b2559f64d3d46f",
"3d439a643d783418a8da877e705de2aacf3605eaf334236579bb5ad858a86911",
"db713ab2c6cf82ba1914f065224724de5188a831175351cb71a87217d365af45",
"6b3332b093fbded288424d318c7de5d716e36a04d4e19dbbde11f26ec35da1e7",
"17bedf2b7c96cd0053899d01453185965948e1102fe9c1e46d467a9f67c1fff1",
"9025b49045a04163f4d7a771b2b5ff61f619008eb52f96b469c741070f365219",
"2559c2e7f68e16e551373c4c2a3a6a5dfd47f655e6fd793d513b9beddfdd5115",
"9ba8b6e490940ec768a134a458a9903716a204e4f473036820980a794ceef769",
"2c9befc13835f38927133f16308337f867d250fbb70491475823fee9f0ab5934",
"1a0daf48e6318ad83d1bb2af77c7918ac18069df3aba4e7f1aadd480967e6069",
"28e4d10d1f3c757b9583659f64837f74eb38278f7167fc4e1c94a9ec669391b3",
"050e47ebeab9201844873dd5694891ee437d6b16d89a7d74e4a97185a8d0c307",
"8c845c3c68f699f92268b27e3c7fe22991e759acaf225cd4b7851318a0a1f621",
"9af9377223242bcdb4aa7c276b81203f21779a3beb86ccbd8531b5432a1c57b1",
"880bbeecf10bc0d9f92764d4d5b08143cbc194dbc27aba4c9b5bf530c6b53121",
"d62605d2eed939c68ecf57454df756c5fc69c2653fbbe76bdec677dd231b8e03",
"e82a21da00be5714caa0dcbdc9c7f8f854fd00c6a15395b41981eda961dcca0c",
"0c91e25e10781f61d33d1ebaa34095ca83b8b5941764eb86ffc8271e529bb135",
"fb79963edce68b6726b2b3f881d835ae78a863f07297b5dbaf0968cd94560672",
"e435f0749c6ed7e0fbceeb7b3b70095cb38f1f143e4dd84eab0af56a1422b5ee",
"763800ac2d20cf5ced81ff1630249f42a72b5c13cd7edf43a9e306b76dd6252d",
"1cc07db5e1109b0f089bc59ce5fded953429791f321c8879825e596a70ec4f5b",
"3dd0b2f4363a008237dd76a8073143ff296a79f74082cb6fa63bcff27acdf71f",
"0690ebd41c44bb3125a6dce684eb660f4351a6033fa3261e71b79aee1d1f3eb1",
"4e3602c85da1fa03bca70b085723e455b8c0e6804fc2372c18314d8daa80f31b",
"1d543d671ee1450aac5f341439a38543ca0f09dc85d48c8546c3e6086b848d7e",
"c5259ad5f808fbf5fb89b0ae2cd0b3f644badc28d10c1a212ab3c2dab00e1b01",
"04e5e03fd5db0863386f5b61320299a084e2e4c1cc90b6fae682834ca547d976",
"209b109d2248f50906d645d8b672950c45f7f8112e8370478c7573a00738af4f",
"f0e26f8f585b882da79fdca1c63e7871e48132c6f4bfa3def5be1709cd001a47",
"f0be38f1d6563c5a47bc0e74ae0d3325bc88b92c1a4fb39ffd2dfbe1a60dab20",
"8c0ff652a018d5122ee1df2a07c95d53f9a04caabb1329a57b66638cdf6e6fdf",
"4e327f0966875148b07993b091f465f0a644fb6390ec6a63a17808aeba67201a",
"4e3703691385a128389fb5ecb6479a893549c32f995f0266d153b336fb8a418e",
"3a9bd5f1c484441f2bbf05454829f3ed6abb0eab991384a612f832049f3d9bc3",
"d7fbff41d6a744c3c431ab19e42717f3ce271f3c03843689a509151a9fe19141",
"2f2de4ce1eb400026835c29de849e15cdd534da94d5c1d25132160af8f0f7230",
"e958200544d377a6912c419199a3b5b088b7301d1edfb738660e7969aabb5622",
"feedceb4644c64a726c8565528b4b967a27772f70388793d094e7d393bba0d1b",
"eac585fcfb82d307b1fa5be40dbacfef61f40bfff51f0d3a0fc8f9345701dd66",
"2929e80ac748e55930bcf806497b24aa92e28ca58a54f5b43a07ef52bb74d455",
"f856255cc0cebc031af7780d5374fdc2fa404895835ba1cf563332fbf7feac8e",
"b6a97aafa66af2558c67f294cf234dd604904822f64614124e91bb432a380806",
"2453278d0de87a675778799ea03a9f63cc7737f8825ce20ae943f05d2210bdda",
"5177c1090882a8af6437db8ec57f915c1077443c67755aa2e1144f27ef0cbbbc",
"e4ef7f69da927ce64c285b894b08bfbb6d31b76b8f8492af9d58ab92a514d4f7",
"d9e3cd540d1a3d51e7ae0842204e9cf03316682cf68e6d10a3d0b636b940aa92",
"990dc02464289f204062a0b2bc247579ce9666af79e072b9182f10865ded00bc",
"02c13684fbbfdd84fbd4fe5f96cc628b983fd962c96fe441adf345d084e261b9",
"424828d006def7d512da6ce6195c954e46f987b7012ff49356f025670687210a",
"deb95fcc9ec34616b55c087d01298f8700d9217e579a0e82421ac17bdfb7cc9a",
"7a927953c2cc9f8eda9a562d5631849c74f63bdccbfefcb0f7b0688bb5af946a",
"fecfcd0bc46d1c573846d778bca2d448fc0a5554cd014897d0623b0dd56e7de0",
"1f35413567b5c1cb23131a528bb88ba58c613ae30e4df1d6504f3c791b0d5ae3",
"6d6a25051256d1ad585b5d95794a310ef584df695539ac5609de85a3208249de",
"facc895969cbefdfe7e71202553eebf01102ad0ba6aea607574d111b393d2b0d",
"6a5a6e6e444f294f3b29a45a29a9267159a4c9d08c40dfaed084500b8c813733",
"93a51a3a4a948188ac452d725d25cef78ed440647f827da98e918eea0cb23fde",
"1a619f17ea83542fabca226faf4aa63149ea79243c3fd20a8c5197b5abb0c8d8",
"9bbe0c081c9b1b427d982760648a1ff29a62f953f7607067e95cedcf89ba37f0",
"bf607b159a1b86422963e25f69741c997f2ac83e4ab645a4d95b69a7e19125a7",
"231c3805c70aec65be44e36dcb7660c158ad6ea4ce2a7fb4172c67200e6fa27b",
"b3c2ea5e99d7afb56b7e66ef80f0db1cf57c8f5ba84689b9bebd09ea9f7cba45",
"acc594c6615cf4928cd7761dad7c7d50b4cccff6ee235959922cc5d00b0e6139",
"811ad8ed505347232eb9b0341695997b563f497c1a0a3a4743fa61b6bcafc0e8",
"fefc5fceae10b166d841fc42777b55deb853990822737408236f0eec161a472f",
"7481ccca2b90076f9e4a9e66d9e11d535b17bbc012ff9c0f4ebe9a77bfa03d83",
"65cefa327312199ddf5c523b16df75796e0ba8aec3bbea94240d9f5223891853",
"60b3ef74d372664afb762df06252c8f214e73bf18d5462025f6495f25c36c538",
"d31a6c55bc1ee4d415f4e0a86e57417ecaa95f8f9bcc1b998c23ec3ff6cc362d",
"7b4dd3983e4ae73056e4c39b1889467a7acc978520b76c7aab9ddac503612cf4",
"8940d3143ca65d2fc6c12ff8a5a592fe69af72e816eab509fec32989484efa2a",
"2462c3fd96a8d5a09764aaa1f303d522bb66b44532d9bfb451e79359c8b5634b",
"f7e256bdcd0f70fa93d4863982deadcd80a83aaccd9eead7d1d40d6cb03a4712",
"771c64d35c23d712924c6f73f766ce69c871f651706421e67976b413cc511f6e",
"891c90eeeba93b2a30e6de2b9e9d4f742ff9295f8f7365ca465d541aa83434bb",
"c22a2d0ab23356b9f911daa8941ea2eceff3cc0a50d97ac79d826910be84c1be",
"0fbd1ad08c62a8485ef2aa7662c15aa78d521d646c34a502d89249344138dd4b",
"36d51385cc82689069c27528db92107a69c71001f82b1ebe8a5b77022d15988e",
"07c841eb469f4dbb15898b881f1c591230b58d67498e9189830f6e8826a08719",
"778c60cdc53216a67665dca10cad41cd11ed23e9f8dae95525de2545dcb175b9",
"e0864b4ac3af59a9f3f42e904eab96db151740e94ae420452db3dd739e3caaa9",
"9c69446810be697877412ae9851622199c0d92d4ad26478a063b9bb6db9e764a",
"38f8b391afd1ad22a146c9919bdacb6c037240e3c66c2006e9bf1d388f3606dd",
"adb689cb1c098049c80978fb976ef7e0b0b3b34fea7b3d0b7344776a9ca848ff",
"d7a3b62f146dd4786fe1890b15f6dca1a82bbf349e8e523a762fc82dc2bf7706",
"27e31d445b34a20e9a6225a5c4a72b7a3dbfae4b5e24fd8544193e2ce9b429d4",
"080ff22a7a7922ed7e7bf677e8f016c5df64df3011db5ce0b1ec2004517ba278",
"08eee7da99c9916365ced96450a08ce69c633c34f34fd32c5dc90dadd85525ca",
"1c8b8a96ce05928a9f7fb4b2298aa1456bc07ef8743cf3290aaba2ce0eb3b24b",
"824bd490b5a3feb9afdc53ead5683d8e34aafdef1ac79587a546791b895ea11f",
"13b945ca9a2860b7f64b773273bec9a55864630a94cae8321d479b155d592cfc",
"f721dc58b73a0af614d24467ee851e4c3ffc2bff885e5861adcb338d3c908c9e",
"dfa80870acef8ce5760fe5661cf96b608a7c2d1c68469ec4ce6149c48b1a4aab",
"44ed22a5dc0008e7614812efd724c8e18e259584b409a9b8db5d12f2584a4606",
"1d6d2c1d66f3124d50fdaa952365faba41d8a842b08a62336d9598c36e125674",
"3d04e20b03752ea7842b57b7612ff0a46242c2b4d731ff44e44b8238388ce316",
"f70762abcb2578979b3e45a1e710bacd2efc38857c82277072ec5d5a87d3aa58",
"7574427cc08320fd7243cf5a3cbf0b3b9ad833d7e62c07fb3e934bd9249d0791",
"6a3083de9ba89fd70f38d3d78bb8511c1e5d79e1f052a9109acdb9e4cedb8895",
"98ca0046d9f2442584fc892cd7a00252be4274d50dc3d1ae7de68e36ad6643cc",
"818a8840745ee021d98e972d75d55e6a8303fceb29495081b4754561f4d99419",
"d3beb861ca3e87afa68a76fb394d5595072190336aa1e7cb79c6d582e81775e5",
"5b1923d7b2ed4c6c08e0b552837418516e9457265ce2a177a9dd617e8ccc51cf",
"9451d755cda65fb116317901b74039dc644fa52c29936135e224bdc1517fdc06",
"9233d451a1db9639b976b03a0ead75d5b280c359b37d55723b73a5ac7b2f666b",
"bba3aa1fae64716d2e644ccba10915b245995be8e5c18b364bdebf342f9a123c",
"a85f357d9919e21d767cb0126c2072e3e3a68122f4aab58721604a7e74ca8ef3",
"976c1237b5fef98fcd4dc122bb31409b7c142f6d72f3625dc02b54580067c225",
"f4affcbbb31b2333904764efe16a26755e2b2736e1c89fe4981357f0184bf6f4",
"8b2faad4541e2421dce75075e3a20e40811d4330518a3e8d4a2d8951a723ed4b",
"dc8fb0dfdd72e22339fe855bac2fdbb8a799ea1d108757c677c06f2da52110f5",
"7a33054e7a5ce841485f2ad7ee66af76c9dfd18adcf9c23c04dc56b1a936a4a5",
"ddd6bc7a8564ef4a78cecd30caebb697a152202cec407b3575876f2971cac8aa",
"02a4cdada2ead64756b7eacbda0f5bd368df150e8d441f7adbb88d7ef9f200f6",
"960117ee8300e61e7eaad2765907fc036aaa8036dfec0d636638419f904c8620",
"d9e3367bb7980ed49b29469e22f95439f5148223df9fd5f6784557e7ef8caca3",
"13674a51c6288975d444970d9e2c8a199f788fcec09ed5ed487959d2d94881b1",
"7909fb3c6934d1d23d0cef5ad92c384065de1fd45338789c8a8fefb5f1203fd2",
"4423891a70c0664328942c22a536639dc6275224e04efd4d03808518a891b9bf",
"414d7bda046dfadb6ed1776fcacc1f78a7a66104f784145c2082372b6fb20ee7",
"39c84dde2a5c0c626b4193178ba946b6e61dc285fbba76ebc75917dd4e379ac6",
"ea4b3c2522920e7c65e6d09022c0bd6d0badd16fc7f1456ce04ee7b467be0b97",
"fd69b3f613090d77eaf31dc2c29b2dc6c05597359467d267a7222e96a29b6c67",
"dbfc205c0ee997c1401fe54bd28756637421fca1a25e00db9e00e89d64a3482e",
"361fc42752cb1e1c7b3a54ad418fc1bf3ecbee172b89b7cb52d1956820dfc247",
"9611e19614c351e3f85df9510e47cc5ad6d16141fc49b9aa066ed0507c343622",
"71d2e2dd14cb017af7b55fc29a0be3e589dff28dab5fb712f0b53e7efaa3d7d6",
"bd81941135830ad8e3c8199e1bc83e329a3303dfa6200a74e50bc3f387b3df68",
"109886c8ffe37ccf4ebd8abbe8c9cb6094ea5cbba48f42052d0718271635dea6",
"eacfb34de88e51ec28378ae5e4108a6a250f10ad9217fe553b9d021f1d62292a",
"43910ed783bcbeeda182737eace7ef280d87ee4b50cdd1515baf92190402b8f4",
"7d7f618dc0bf2a0436da1e8b5aafbe5a37eb07c57cdd815241635d22785eda2a",
"7b965da239755ade6315983afdeff836fb034c9e5b4c34c4afe72aac9488b29b",
"25fc6d40e0b1426f6b5fa5d35ae9602d05d05786104899829f6ecdf00573e68f",
"9f3a94c1b7a9105cb882715d4c381b83518c76e57712d4ddad7e45a076346e9c",
"7aec8af86e08b0ff7454e70b37b45672b0a6948caac5b010faa375e897554ca5",
"047e8c1e5c7c713a42a632119eb8a4dc91e98286415530852866acef39a1c9e6",
"61a86e24c44aec0c5c3652db941de536e30dc62d7506163f6e85b0a4184a84e8",
"968654c2bc1a8ee7bec875287902be1e17d919ac04ba2cc16c2251d318f1a1ea",
"fd44b45d70bafb87f4335a7df754e6c2b903e229fbe6021d76701e9580757945",
"95e129d490b382e852236423a889c980109858fadce8110f613029d681953032",
"7ee700d4c59442b3719997ce15efe5abeb1d03a02e00a65bd59c9ffbf0ede8c1",
"938c19697f38175c2adacf827a4dab63497444cbcbe85044c6fa64bfe4308d69",
"bcda20f1e96033c976a98e6afa3d4089d32b7a079cde9f55f453daa05bb7d815",
"394385ae1ae091fe51649d96ae4088b5b01f429f6b910bcaafa146eb91e27ab7",
"0e1653a47cfc4807ad80af30fe8754df1d0b01e6226a00952c0ef022eec1887f",
"17f4db4865e736fb554ecb9f90a9d03611d884d8cc610685dd3dbbee7579f320",
"6e7da60e5fe48f71e66e75b1daf8eb281cd59a433e745113f810a74d5b684346",
"f86967ccb6788cf24e85d2b092f0672b012a4175e422195864dc38ddd72bb5c6",
"f825992fdd5b688ef9f54ed5b6988908b6abc3e99d4d56574ecf6cd58b274d26",
"c5feb4980f5cdce86066ed6092c86ac2bf278cd6ac951f18f9f76b6f1c70765c",
"894b793607e5bb40db56aef6150e63b133bd79053d05fac00e81441f219fc75f",
"a19d38cd0ed7e9941a6f5cc80066e7219e5e8c31322ed49bc62ea3e3a08e807c",
"59879f39e7965bcb9c9808590ed0fb9e9d5ec0999d37fe27e68cee558a01cb4a",
"5cc25c3ed8ecefe89499acf6d4dc5b779ea7e2cf705de04b6e3ff2f1e7b3466d",
"b1aa45a7200e4d4c5dedfbdc6104ecfc92d69bc866cd687fdc10ecdcc01882d1",
"11d12214eb483a5d2823d1d66dae709b83afba99a72feaf44c616e924e9e7133",
"d9d6a9a384192fd96df93ee9ec45e2df417935727e429ef745ee1656c36c30cb",
"0290b426e09e4f20ada60f202c5f9c72092328de4b9d0328e0bc648ee7af440e",
"a75cb215249bc8590bca32d0d9c67be8b5872e1e7c2ada6d09756c0c488643c9",
"fa8d8b86eb2f3bd3e13db3449e76e5c9ea0f8038e1a51abb8f57f7ec9e1d98cc",
"6a754413378af603f5f1872e273704b0593666ec45b01e769190c4da2ce33107",
"0d682a825ad61b48d8c5f7cdb358622b586ec0278550cf194ca31a557b02c98d",
"e11ee2d7a7e915cc9daa6a5e2623c13c0f76a0032aabaaed65473e1612fe04dd",
"d7cc6cf33a3034938f8b516266943a7f06a60925a67311ab5f25e59129459e2d",
"6a8cf78191d4e96763f460d7b75c267ec80eb70b18fa25470e96206a51d34668",
"7b42937008ab3634dd455f912b640dcade62c4896e87e31e8411b204bd43a0cf",
"8181105804546a0e6984db87712df8f91e7a4d7b257acf4ad91408b7520a5c71",
"d67f73265422cdceaf52c7c0f756e5584b913f412843948dc55ef5796102cce3",
"a3be947673b936cd79ff245d8ffedffb14ffa7ff25bc4902a007762e84dc7e43",
"8d2669842634187c565dc36d2aeb66d9e8a6ed8514d3d67440183d5a010d6e37",
"43a61f18d69d0ca98a61b9f46986aa24e5664aa39db9984e75d9e2e135c40dd3",
"e22da9a2ae035efbd078e15e88aebe65b7807ee4ebde0549a12458ab91214f87",
"3a352c7c7a14bd9a4f7ca322dc69c7872c715643709919564903a6c3fb87cf3c",
"133396bdfa926cdd94a04a9d4f9ddea15b826b1ed81cd20341e19d824b315787",
"d2f2333f2e6c414291460c8773307a938dfe1ac106c5edebbf5cb21fa82a2a31",
"8f3e38f126d7bc3d0db868af28dc8fb54da459557a91d267ee1c14936cabef83",
"a0994de79184743ecbfd93ac3756373b248121217d94bd3a4ea94d962c4f6355",
"d33d1d69535f864e069ea82f956fa3570761e952664bc1b25a3f7a6df61814f0",
"99bad4e888e2784bd099359f56e0f0b876479abed3d57e9eaa19fea225af81b8",
"a57762692bd86e286e6424d0f96b7b86e85253488c9db184349a14d4d3136b08",
"f4c134eb40f5c06682d33a1e46f032ab1b4177479680f6907a61d265df4c8d45",
"cc2ecf6b837216836ee09e2ded3ed1b8c563625eab186e5e91849d26176df180",
"fa410c13bd93736c1f1a9ef9aa9f77de068e4ae67ec403bff81f8d1590713051",
"85fa25c778ab932e0443b90903512b64949a758c82d1eb3a6d731d167e71fb1d",
"de2b73a4bc1f1d4c9d1958a877aff6523c77bf27938a5cf10a961f5e188785b2",
"81eb996437547bbfa2b13e0da140f81127b8131f986ce3e14079ea56afd911c8",
"a4ea58ef299da80655185cc0583ae3a41baee84e94a38b58cd958336bea83a3c",
"3b396965bbb8af6106c7e92866aff442b1fea840dbed8714b1d59667b8565c02",
"3fe822f16f9d17e9d52efd1cf87d9bd6916860614cc558e749fda757471667ba",
"f7b62d5f72fae47e04856f14246c710a88ebdd886446e3b5da32f9d519316ad9",
"8ee24927a1cf142b977f0883697d31e6480e1e8881e21146e94364fe6531e192",
"69b9dd1fd77ac944ce91296ff3b8cfed3146dbafe3e290d9dd9aa33408c4ced4",
"977d1dfdbc2fd33939ad8d4da6c76de573517efb051d6b4f75c6ddfb68325fb0",
"0c93b4497d90fc6a96fa923aa0bd51acab8ecc188a539fa09fe1bb89a91c9e6b",
"0fb0725014c559c3d0a6f728497de1b486fadef53947c2dbac9b48847b23f96a",
"9c7299e91b2fc0daabc56ca3436dbb87dad1c2f7fe65ae2f35215a8399c35f15",
"4f47060cff708296ea4a5ce534978a4f68e551182c4a962a211d5b252570e3e7",
"bdb960a576d54c4af31b5ee031590b6e322bd4964a31f1f960efe0e32b2e5f6e",
"5432a60017bb2454ad4a5ec56af3b378cfb7df5d6e21e8bf1eb1aa6f25fb164e",
"9429c91b07ef8ff3a351f799d9f64093268729302694ebc1447d02acf2f1ccf0",
"029c00559e163078acbb2451661c39bef39502c14ec2436d1ae2a060a20edb4d",
"6c33b09ed1d15c9733c2d7a40616505dbe0da76cf8bd2467d0e5e626837da6ce",
"62b0572601f7e72874098256e7a4c562dfff9a4a865fefb53f7b79d2346aed3b",
"964735dc82b3ac66115b61e67d837f4f63c3aaabd9c49a84b7830128a481e8be",
"26df089e3d8dfa24542f2396096cd4aa5226cab4c3af47e65fcce76f1e414bd3",
"1674db2da4e6f463f91997f827626d68d6d4426a893fd30763d87b2d9faae868",
"ffbf284b810b85ef96226f37e77751c12cfdb2c3d2c8771c330154878f50c58b",
"e9cc5b14f41453cc7acf8f648f3fe098fe0571596f2df09f1b42209c14102925",
"37c9c92cb072eb07b53905c24d24de63cdc291782fc4989e772ab80c9d12f1f8",
"82910dfc2a5b6e89d36b3a7a5f42ed688518e4779dffa7bce7300d5ce79d21be",
"2829dd8009730219124425cb0e6252e7e5a54549f8efba9da95c9f6398a197d4",
"7dfe790355a93884116f2f779878df75a0aa305c2f4af5c39c5305de11b6d9fc",
"7e52efa1988b504a1c216c5b65b3364c68d69ede7a69daf7f2841528dca8a871",
"02d2f7034774e0bcad3070df6c6ad066f39b7fd6a7139a207c36d54832aa3fc8",
"3498c99d782ec9c97d2a923d01f6211c9f0f8b3f80d27d83f734de35d9ae89c5",
"e272bdb0a0fc3125b4ad766d2573a96ba91e0b7fd6bfc99b283fc35b453421e9",
"1b2722d5d4ffc6744292543d916d9c5f24b9348a83238728d23357a57c0489f8",
"1a9358f03b1f04ce829e5a5a6e1c0988792bbfad82a8b8e4f982608e331bbf2b",
"5b84f431c0b459ff9a7980274676cca8345bb65fe7a5d7279a1147ed684cc87c",
"b492a4d00ef44971936b943c99c11ee4d95f19f53d5f99686ddf48b87ead3912",
"10030c258f1c17bb1e045802b3884a870086d4d453a63221ad1746390d68f5e0",
"de68cf7ddfd9a816aefbfb89cb6da631ea25ae9727aa35f695d9b8f2b1476d46",
"b14d11b38d0cab33eb8a3fa5e27a6ea965d34419c577d029f641126c459ec629",
"3e35fb789b06bfd1b82e267473f8a59075f9123f6f8207de440a1b0c6f9ff02c",
"619af17fde2056671dc59f5aa1486ea8eda6cd332abfebbd0c193802bfa66d71",
"126772abae01f905b41621cfdcbc7aa49350a03d0bb654add6d9adffb25c335d",
"2bafe5ab6c2e3569e587b3f991b2fda513b40da8b86408ac2b84e4eebc6718ba",
"10b2bd77a42da1cc9862243e4f276a3d00af03f2e98e52e26ff5bc96713fc222",
"44ea99c6ce8da767ce9b662f61c9a35d4828a241cae940af28aa35ce7179b424",
"4a62c7dce36af4c4380f6984ae7655ef9f03d21fffdaaf2eb43159f5872d095e",
"7c844a8922f7ae07dbf727b90cca5dc563c3f41e5522599c88ee6d39543663a8",
"e089bed6f05559e82eb26b481a19a2e2fa3d808a68bdf94218bda7061f388dc1",
"79940c6907a9223cf27f3a6b6f29d50c06dbe1218dc20b5b322ec24795da872d",
"999c2ffdd30db3f3ddb8bd0747489b04a120b07662cb7b281304965c829bb36d",
"b4c96b2e31315afe96e2a77baa8fc60691c46e263e55b8d7a0cf7d830a811e0d",
"b8e1fe2d753a2f3e819d18ec6dca8c6172a4451bcedd657dae781f5d0d27e5a1",
"7173757d96357548b69d1bd96baa1edd2fc3ccf160f70f054ca7dd43c2a6f7e5",
"3bfb2222a3128ba909f744bf06078ce5b806bea665c69fc96f8cbb3de66180be",
"3878170d14c9149486ee73617cfb8d18edc0fdb3a143b824f12807b2aebf88ae",
"18929c2349b8f25cb657dae468b8fa7c87210e8bd0a9d75cddc761ba5215faab",
"9e5ad5ee12e5ad850db3ac5120f6be9194778fd9dfec5dec6c404e19d1c643b3",
"deaf470095deacdaa13df228e34c5f28d6beabf0bd212961276cc4155e0b8c7a",
"7e370a5adeff1cd7dece2eb3460e631c756f68e260e1fce9b320c7d639646c93",
"3bc32569ef20ab77044606e26d009780f930fb921c42e5c9692b32177114c1a2",
"1953191d3613989f0750ad444fb0f091fefc67f55af69f8329720915acb74651",
"a3a5fb94d1d43c0b27d0610fd50ac4ef84006b27a710e7a013ec14eda8a5ce9b",
"84d34addf63dab4596e84ab167aaac2321b2de5df54cb216bc4f6e61526efe80",
"35b6f61e16f30af44ec6a25c9e9466219c3b2682d0887b8a3d76ca67b1b8a7bb",
"7914a6526c3fda4e9964a0d4e9ea64ce10904515cf206ca6d65fe1a076f31b75",
"88982edda8a4b5c64ca470203e317a6deb563b7cff9e1ccc3fd49950e95fdfed",
"f298670b5d075bbfdd3d7235eeb95d1dc0c2ef1cdfa18022a8d47ecc3b3bbe52",
"a6f8d0034a8a274e731c36532e0a93048ffdabe63951782c39faf4297aaa8505",
"0b9a529d56394f13dbbb116006bd64825dbec14e346979898dd9891762d5e13c",
"0ee56981de8370a1b4b8f2966f2813ddee379c7a771b7e1a1da71a4b88853ca6",
"ca28e86ea8f984093aa12f0a4b9726ae068df5376c858e5292918e4ad4d90ae2",
"d9248d250e96b4e0580eff866a9d38170aeb241e8040dca061904547ee0f3ede",
"c69dd9a33dcada6310f26353112a24d13ff6c8bee282d80c4b99f3d79c4a39e3",
"f8856ac274711c5def16f2c0a25cf1aaab4b8d086485d2a86e19f54d5da3147b",
"118fe8952e796d369f62b0e557e79d034749e9a5782ec324cd57030d18d75f8b",
"196c84e9b3ed981d6050594e041d6c0606a03902624824dc1fea5f45bc02e374",
"0a7e5f1c15a3ebf79fc53b4385203831dd2260e66ed1dbf4517f927739fc9d20",
"2544e5d727a98eb4bbc9f997aa8528d5fe72c181aa213c6cc8fc9c524cf1b80a",
"9f32cdace597f83cc96d032c0ed597c14c7c9cb2783b72f3aa26eb8677291056",
"c0635250a16fc251f2a5c9f339b02b1e597f498bfbc6bc8efc4f84bf4c60f7e8",
"13fcb7b163a0af3228b54b5b19b732e2c491278ec820bee673405427bccc4ddb",
"88c638370616fc250ae19a120d6ad438983c1ddea227d14ded40ca6447c27f4b",
"477ddac58ba177114cd2915f5bd3af46ef0e0ec207f62cbe808a42ea2dedd3d6",
"31a6a58ba8504395f903b4a6201c99d643c9022c2b405d15eed98e3e5b5337e0",
"84fefe06b586a1bec043fae51e0f4dfe51aead2966b95d01171985c94e6247ba",
"b06d054a3f59ae8aebfcc355da329cf7d7b171e9551010bf68c2d8b595f01c80",
"6eb0e4c141fcb918ad2f0fc4ce00e0744c6c11f657a62386c9d0462439d6d41e",
"3eb296c45c30be682273e4a56946901a26034c31c3903c332ab1f2fdd5ba4b78",
"b46aa3f86be33c1afa2a05a8d7cec5a23143554d6a6a3bb4b71a07a60f29a2f2",
"d05b11b40f09b004e257c54a309f161db967840ace8960b7e41a37149b625040",
"eee8ce35c2b264ae155d7d2d23f5bddb4b889029f83a26746e70c4166286f8fe",
"b71064c9b121d5f74d927473e5e152f109fcf3f69610c65c68d5b8c1b376b01b",
"95aad4e4218cb6b5812a3f394a5f13bc697e22b90e81fac508e066c7cbc4f681",
"5d0699409e073c792b7bfa9a4ed10e3991cf612500666cbf725c52bab465653e",
"13461970ae73914857ce8c7c5b1af4a9f9d28f8a2c15f2c6b9356aa11d79fd4a",
"144632a37747593a4bd50a1b24c52050335f887d67150da89bc596717f0dc884",
"3ca3dc4b634eaeebee69c5bba4047bed5a1a1c362539368cfe9b37e608820d81",
"16a6af846ec4ad628fd35584cb77226e8d3bb114b1d97325d8e7d738c23be1bc",
"dac41ba44621f1f52090b8cde4dc61716a0a58665cf295d4bad9ebe5db34d8fb",
"37aa0fc3993e4f36345532a1c230d8c09ebda6c7e8c6fd081ab794806fc3a006",
"d716997df495cde0205a461dbef7817c2f47175e8e1abdcaec1d11dfe8f7f2f3",
"41dddc93b4c1ccbcfd36c821acd497eb2a32798cd715961e6232c868629a2988",
"9749a64ed8423c3d52da3d6e4656b253fbee73a610d052a2f0176728a7af7083",
"d9d39663b8d8a2a842a274e86ad0459a854e95fb3893510e8590c5fb9c0aeb2a",
"0c3fd3fb5ffceb9232f5438cc8928c1bdf1d276bdc55034f9dea5859e94e9c60",
"490e7d15e8e9037745827b02e6b32ad6674995a317f2d0b6f83b50c22e8323dd",
"a3917d2da43598a91e42f5630806f3b2eb0c30099a481a2ba7dbe4e059a7ad4d",
"2dc5c2a29bc03a4a454d23c052be2cf7a18f020f7719699ed03fc5fe86c9c71c",
"8598d15a723839a01b37330d7703c0594f6284fd4aec638d1f096e7f6b811637",
"8e61c38c7809e5c72d73eb524dca478ab07a83cc815585f353417779718a13a3",
"4ef82c341003f1b2341e21894fccc9999454fd5aacf683311a6288e5cc8a82a6",
"06627b2b76bb77ae9a70a43967303f3071a95dc3bd48542087f0a2fbe8bc77c3",
"cf879b77f95746e5aac855d158f9b2411d15627d1d7789bbe1daba771d36f1fb",
"a98677ed16d7b6f1527c9cd1b1d1f4d3977c1c347af6c1f0a5fb556c89cbe0fd",
"5c5ac6740f44c4b1b8e830f0c9bb4be4bd880be9cf7c6810791026f6201c2c87",
"0566ccd8a67d3a2b5bf94c7172d0051496b7dd47397f8dc37968ea4141bc85dd",
"a9136108946acd91b22ff58382c8c1b559e6e7e32582091ac2cba72cfbd2288f",
"3d6c265826bdf3150caed1342694830cdeaff0928ac0675aae679f3441bb32b8",
"1b71a5518a7255818039a7912a07a36815b366a88390f2681f0f20e203182cc6",
"f17d2bce966f24824c99cbb057ddc0a35592a0538365ff932c7da9ab8a82c8d6",
"d809bc5833b32920ad18f2f3edfde56e8ca8745866c88229464d62d20d4ca4a4",
"7ef878fb9a43370319056c36c8497a9450f1ba392cec369349bd511baee66878",
"cb37fa62968e6f48726e67409e4de6f70c7b8bd379d918d77e1c092f2d75855f",
"fdd4887916026359361d30411d32e702fef891a3e812f6d93c0005c25617626f",
"5dcf78017a3904438298502eee9da13baf80cac3f6797db73ff541aa5ade4618",
"b44a956fce3ede4c83ae6d705488c6204bf047bf96ddca2eae15b468b767767a",
"5e46a0e8ed9ab1e2b8600ccc9a9fea5dbdf257ff41416e2d2cd503f5d2045d9c",
"59394e0c9d8701651db7494e4120af78f69bb80540327da6bef74f7115e17b18",
"2f628fe6e8974e03be8788c5f6faf7ee82f5d4578eadff5cc20684fbce5e3bda",
"425568457c24df2550c3e7ddd31577793d8a688380f90109edc9e3026328606a",
"4d97267d00fbd0c6ca1e7fd251f24e2dcd4f01c131c068928cda3434f9ffcb6c",
"af1f6ca2c8dd2f23ef68da537300eca32bcf6c06c120e4ee6a47784dba07eafd",
"14e9614705298129ca7152ff4f8dc9761311cf7d6f1ae03dec32ee593d7bc06e",
"da1a246addd8d5c6ad6624fb4022fecc12df1c00ad1b93bba89e3783a0d6e991",
"81330dc744fc16c8c1a214aab01571b4317e625c351ae9aad59d87160a354d6b",
"3596a9d4c9f6a99e54822f88783d70b2f36c0d151870057d24b5beef945f2bc3",
"7a67cacdc5838404610d1fd333bda0915af6cc9ba9e4c3108fa0e82206fbecbe",
"322af22b47aa7f96f8a15334e1d72f36367b5b04b166ea6cdbaeb66f339335e9",
"40d461127760a5c113c0f6043308fed38f77740a9b8a9fd1a40703a015151c95",
"ee3a41db53deb02743aa8185cc4ac23fa7824c8270835f60814bd49f1e752efc",
"32b111393e5d769d7744313a2bc0145c13474742acaaf544a64ca67d58b5ea79",
"230f8dfed6d96d946cd8f4be4914bfc4b882057e20535e0725dbe2254ac2971f",
"e46094f0e8e8788a70cb9bd518355b72a1ef7749d2859ea01c68b4b9cbb3d0c0",
"eae7292ea7c9661b047227a05345a00269492f29fb7dffc711c8afcf44fc7733",
"ec570a10c57aece6a17e4f20628934bc167a7766be11b170813a5adbb724fd95",
"e49f8a0e33c3aab94bc731ec81d30a882c5d59eaa661fb40d6db6839672df707",
"f1228aa5f9cd1b15c11b25ae64683a04b4c040785d1c3f251a7491ec7a500d0c",
"46a897252fca324e6a0d66ebfccb1b22c895bef843c03615b1fe7877e6fb799c",
"91cff10cbb7407d2ab57690199d12763af1395c2045e36489d487fedc2ff0d78",
"e0cb6baae636c0a9fe9d537ad03fc9e47e143fa39be34a5c28b72f829594fa85",
"cd5fb77f04cb3efd791ed97ecbf0365d6152551c4d69b7b943240086d9b676d1",
"f601de357f11065c9b02c5fbc5c36741e07996b7df2f45433b7cf43a5ad41c81",
"095141ef2210e5583f37dff995557de1d7af2fa6898f2cb782663c5a95fa16ef",
"c9ca061f74aa0f357b5056cd4fa309ee21a286b054e71e27ca565ea79529ad97",
"d10e37e9b4fcf638cc7a971786778d1e49094a2e23fe45fe44ddc58d0b61c475",
"01ba06a2c0fc5a4e343da3713f9ab3e53f024e0e4a072467f847758bff5f43b0",
"c0310bf0ba97905314444b1142964932cbe0b1dee9cb16088b0ce4b9eda6b79f",
"bf100cf5b170dab33b7efa10daab81237394818a58868d48951438eb0b69c855",
"7d9ef7d24440e31236963a73e50bfe50db6953b5f46ab1a731e704bf4e79597a",
"efbe044d7f4af0a8007c3b59c132a5a3816cf46faa51211cff187b745f4db5d3",
"6f37db7aeb25232de26585168fcc36277931b849716d488a1fe376b2090b3673",
"7a67e65212f43b01843f1ef93dfec4a4979b6d72b2613469f6eee61de3302c6a",
"577829d3677e20acd28babcc144cf34193d3ffc6e0234995b2d82c086b208b39",
"683ca69c82e9444bf19097c348c8bddcecb89ce2d5fd8d65b6af111f0ed51165",
"75fc5fee95b8a8d883e441564a0318d1fcf319330d66c4909f2e6f0ba7858dfd",
"da0180a44d99ccba91494effbf4525199d4b2bd1f406fe707d2dff7e9129f36b",
"aae69084393800379fb1f713318fe4a076573d40199890693ac3ece32acecc52",
"14c74a90a588f6041272456fc2b3159e06d91772faa688df421481576151c7f9",
"e7f8105b15bd934f6f353f52b225f6bed311ecdedaed077f04fea10f5b1809b7",
"5990df70114da16a6df99a80ca89baa61c3ec129eda3f36ae70ae600ed7c8929",
"499bce4a3151fcb1ac02cdd2f35a6776a26c00ceb1435ad44359a74540d2c029",
"797060aba10a3b530ff4f32463256a522d522c8d27fac3ba2d7ccddedeb6a5dd",
"4e6b1494646f208de47c52b6d2a74c24018cbc966e92a948e6b4ac1b089e8576",
"be6db418772adbbe7ab6c4d1f492310e460285d2c36e8897e50c1217b2d6dba7",
"39f8abfec09f6c4daaa5f4506b16d4b64cdb1b7d3c5e6dca7227311bf8771e35",
"b403a448c61e1a2b263ab10c0c4d47edf17f7add29fff541d5437f34d4c91f39",
"a34e61ae78b1501db1a1f9f8fa4bd49ea60d129846c03767b24ec1891f068054",
"565bd3ce5606e31a0a73c566fa0f0626a39c2a147e70f4d88522f936be9ea0f8",
"9c100c68e1e85ce077ff71fa541d0973872000312524f1e61c937df314e16041",
"7cd003b22afd71e562e0d51b0b8a41fa7a914a5c09a4e3e2ced9e984eff28b20",
"03a4af0e3e0de193bf25cecf0f3ee125d1ee9ae398e80ed823ba6a51689b5ba6",
"17c44c3d8b0f25c9da217d9a3ef10f4585c163b8f9dcb91ca7f8ad83d8b35bbd",
"9e385630e1292126124fdc9d18bd4b37d4bd226ec2e2d6201c41e7c8e326ad27",
"979e1b6f14ae1855334f19a97bfcc8b685301b8a3cdf887b655913c4e9620efd",
"d6a6fdf84e567f5ca7fc92d75a2cc6e061c8f7f8e64de7a0be421a0bbfa1b738",
"1684c566b9284c20d0f8d0b0c98347ec2b47bfc7f4a2bc175662be23c8ed82a6",
"1514e7f9e012d03e07948557500aa693d202fc17112be0fdb256f6d5ab49c1cc",
"28f060c4c4e34488fb8888253a74b830a00d307e8b41217117f11b79accb93fa",
"1592d1a10ed99d5568223281f3108915f89e80d922b7960a14b801ff3e36458e",
"517cfcd10b564f0bf30a7fcf294d89efeafc5e071a56e8fb172f1cb828e550fc",
"299f19190f1902e02a024ed1992bbd90fd3e12316dc1df6a4a68c01830cf4144",
"736a70c8886c9f2d628655577f43e32fc19d812984fc4d24214619c5384ee286",
"7cec8231990ed3b7e876749dd4fb8f1f59ce921a17845ccf3f58cb2a54b6c294",
"00af74a165dea5e6824386fdeb52aa079e9de7e852c738f935b54fe1cbe45e8c",
"d1135ab4464cde0e87d86ab640ec0b4a951a3da2c2cc49b826f7d205ee830cd6",
"55cdd32da33175d8a626af632169e2b5b6997124688c14886d0bc656425cc2bd",
"40a107d4dfb31ab2b55553ce3848ac209854a536298125806875ad7f0b671897",
"9357af855ddce8fad671abcd8e5b72c9052388fabe9e760be239b38107b79e97",
"71b017aedcf63fd4f2849c4e5d6ac3144e283976201ed5b647bdd7aaa8690945",
"1f60353a9667f796731cdf9abbc15437858c7d17d87da42c19fcf56baab07187",
"b4fe5510e2f026c6cc64f123fb0823d50abcfc6b7b5b52379023f67a5b748d71",
"6344975dd4c897543027eb338aece8bfbf1dc391608cc37956d8344aa7571fcd",
"4876ab861f9be3e308d9a3cabbafbc491cf3c8214a81fbfd289874716c3ca6dc",
"8e165929b270121ad1a70728839816417b9cee3b9b4e50865e2e2c71cd1a8790",
"77650532964006b8d75fa0e09663615bfc166075716cabca380122fc460f5c79",
"8c514d39cc4fbc7a9faef806a58dffbf0ce0e9b7c5e2d41dc23e64309b6d7726",
"68e13052ff8257e59006a99c78b52d21e8f272c48bbbf900b1673a1150f3fe0f",
"e603d3f6273a58f7c2fc503621919c6854a8a7af0cb0a966128f5aa47b12edd6",
"11c4e71ea6899a20f5c032139e756b23454452598251b6f1b3e393a4090797a4",
"962980c2efe9b17273d9ecf569b5a943bac637f03fd3261b42b3d7da8b4284bf",
"7869b529db385c291326c7e4b3667275d4d867fa4a89ec87b2497b061e11fb65",
"9c59f7d63cace21147a80bd7c97db197e7986cc0c7a871abf67354ba17f49223",
"a718cea8979ad6e76022ae9a4822b311ebf3c97f3c6d0f14e1c51a9f82ced6e2",
"be0da199f9df9c94059faf2f16a32b72cb1d39bfa2822b3e36410bb4d6176d02",
"cf5aadf5f61d80794f768e9dc9367528834fba39061a3055c4ec3611b5d319f0",
"73f0daab63c69385855f438b52a89782527058b4c7c55a81d32cf2a62a4ce560",
"7d4a31713443159bd43cf4b3c4c5045dbcaa16604a76d6b361d280df5a5ac795",
"332e838b4a02c4974d8cb9ea74d1344c1cb2627642125aae197b756d4a95d3cb",
"ba4a96f6a6dc15230036d8fd99ab7ba85f5cd5fc67d4428a03ea43a65291c2ce",
"a3ba676c5972ffb3a70046e65efe34c7ab57240513f385269f91b1ce84a0bd83",
"5e7f69be4f66ebfae0039bec00e5609279644b9ceaaeedfe23ce5e52ae47d44d",
"b9a3903165258e80e45c20c558685e6d2d080f038d2f4c656f386bf46811b3e1",
"a51a0adfdc56f5b043a330fc69631ff57b38b71002379e85bcf240dad1b8d1b6",
"ecd43ff10c91acae4f6f8a207bed67f1357d8f4921632105ccc1835c468499cb",
"2b720ee410a8de47601c574de517bb6309a6e313d0c5bde3e7c7cfd9d870559b",
"d084b1522e4f9f777a3bdb0efdcc0d4a7ab37f91c36c9b758d04ef03a00432ea",
"fdb37762e87ead4d525e64490c1cffaacac39b3a7fdff6ddb2c54ab9839bfb5e",
"1ba744573d00e9ce9081f74af0bccc72406d841996c5e1d39d5a6a64974c8797",
"83070a77b3916f1ac65c5ec899c794f3aa72feaa4164cc0ef967cacb7bf952af",
"572774d3e25c541dbcc369329d8ec715de51b7188579f4f26808c18ff2822be5",
"037c415b2e6a25e3e073c7b5e49ec5268c96fd6a606093f199dc6676ae74c72f",
"2add1c47cccca7d18a55980705b96da9ad1f2ab6212d2e4a28a620b0b52b06b7",
"d244e500fa43e36cca37c6432b6fa67eb3a8d82a75ae6daeb8b23c73931a33db",
"1170ff5f2dffcd91feeeb20e5c096e5d0c564209d5cac22819e50e724394d508",
"435ab8ba59700e29becbccf2cab92ab8a475dc37a5054185d531c3e5497a0b73",
"3e95fcf4ef53f040e2234213ae78388efe2f2ee8fdf8b849ab228168786e7747",
"41eafe5f4010708f5d9b0ed00d008fcd4165ad12fcaf9da793ccce96de45919e",
"c8c7f662915bdb29335369717f6574b1d5dca47249203586d55b49de1b0e9cb2",
"c02c93eba96a4caafb5230d3fbfbb21bb0e30b83e3ba723d69969c8ce22ac061",
"1d084ed9e24a483dc6eb709a35e2b13f17e0af68f9e6ad70d2ec45aa4e53154c",
"1f0b201a98761aa62c2a82ec7b3c61ac54b64445a096751fd14574d6612775d1",
"77c032a8220045355290fd16c747939f0214e815d22f4997fa4909d9a34d8558",
"e49d85ba13fb06dcabf3f5fc50ffc6d2a8889bd6789b04aab6bfe32d8ef504a9",
"b75ef9b79976cbf1dba0b013ae0444ea718c7dc6248b74b4a15145595c5aa3d7",
"b1970f4a050e9117adab59e929c9f19fb2451d7b971e1b4cad612ef5eccc09e1",
"11c0b440cdf13b9c7a8506f65c3d36544a7205d55849bc1dd3cb15c83ccd655a",
"9a765fbfafbc415c1cc111b270257cacb65cfe62a63714c6b9f938bfee5f08a0",
"6666b54eff374669939c7f29fe75e04aba282165b979fe98534402480d5010aa",
"67c0309da2478252dc3a947caa00ff9a11f539acc3e429b7c2eceb91212112bd",
"a4c16f87d3e3e64ea5bce953a3f1dd3a8212b5fca7c5d8d7d1132496b2163985",
"af769be65ec292a3331e8fc52ffadfa81043694bd9dafc1a739adcd39335420c",
"16d03bf07cf91faef7f0823dd55ea0836562f402195559222e9253a5a66e989b",
"70c7779bb108989e3cb93127331ae413fa1d06734318000d7d0a2d678b966911",
"dbcb62a66b30b0fa04b323eba90d876fc51d0c758bda6870b1c83ba781ce725b",
"272862bf792d6598778edf2826e2109329d81e16bd5ab93a5d3e38a2a639cbe0",
"d28fd89af2d75d9eec60b089fb6249c6f908cbc0843ca74785aeca3ab708c347",
"4ad5eea13e59780ae0ffb0c829455e14c6c79e8e205845e14b3ed108a59d1bcb",
"0f6514497ad7ff181771c83d7eb588368d2712c76d81849e895bed4f794d0da0",
"77b521afc25a30c01a5e1ee34bc06babc286c5c706c7e871473c081371981c5b",
"9301ec9e09f0724a87b9fa22206d22ff86032ec17715cb719f053d0fdf43b779",
"230454c99e8323b1a4919e08831f24f07d355243e80c59a96a7da32374e535ba",
"a889b43c735a52d310ecfbe45faa407b805abd86729acf0538c9c6feb015b569",
"7dd94810d15d970d8ae12692f86824688a0addf12c48f056745ce577cfad99b3",
"9299d294630c8e3369a12be7629713e088b818c377063d7976b3b06e5d933634",
"78418f5fe4e71b7c213e49aaea5c640784e00af44503dbae20be48afb99a180f",
"d079a0bb10dae0015c28cb990579bb9b692aa9d03fbc2488530f47eb3a6bf522",
"378d3e801c52ee465e0c1a403c2ea9efd058e3b8d3b4c94dc8076cd6f1cef6f9",
"e1117aaab373d67776a7098d99ae3717e3c3d53d17f3ac8730ac6f3fe29091a6",
"064600e30e1e17a5f2dd740657a1425ab9b9cb22acdfa25f3a4cec023b57b58d",
"6260e3791b659a00185685b41d58762bab3e474181eb6a98419065c3a6aa08c1",
"67c777f5e3fde898d0b1245870ef2ecce1b9b8112ce0a004bf9dbbe9c6228ce6",
"80a1da400b8fbdf79d062742e38ad937a2b52651b395ab9a1eb3c2a47a13bbc7",
"b009ee1928cde88e2057c87e1095b8e2a288f5f2cd3871ace142170de11573b9",
"10b11ef86a51feefc5f8699fb1e87ac65e2ff10dd99477768ecce04fa10ec25a",
"0a8ed44cb81aa9554ef6a2651ebc755f27774dc2f4050d92d95dc9da2d075592",
"99543dad9d522181c7e95e94e1590f25a6bf1797594667abbab6dc20b63eec2b",
"ace8bafe181bb5464fd8ed19f99a96f05649a812dab87d7f02edf39b218f23d1",
"ede3fcbd84f5e6889231578e5480ea0c520381986734c67aa745cd813a4dc23b",
"ae5b0ae8897aa08c5596ec47c6356ffa2b74c445d1de971faa85ff0e8c08d61d",
"5aeb06eda1954cfd45ecda2346a457b423f7ac41feb650df2c5665bd73726199",
"dc17d24f4b07bc3c6cc62b170dc985fd037e838cac8978cafccc88d2d7451061",
"b0eebc1c5eb427b1669ed6a8ca1c350a4f6c96e5088d110525fb972a9c47af45",
"27ea74b76e37abbfbf86aa54fcb4bd68873b592c3c7bbf1ee755b837674a176d",
"eea989a684a4d74d290cdbd1e68d3790bdbc1752a9fdfe3bd5fbb098bc59f438",
"655f54063af84da34be8e27591f0dffe08bc122c17e94abea6705b6eb08d3fb0",
"015e5fcb2816dbe2106329046c185f9f4ad7133f4809462c9eb82b2550108836",
"deae664671aebad2c106cb48db19cfdfb446f66d39ad5eff8b3c072875b0fe62",
"6b464669dcc22566847b5f016245b68a06dc371c3bbb0ba4a279d26869013e84",
"e64bbca7f7cf04b3b482a9c9ea1a8189b76b1f43c507f8fada42b4320e3ed07a",
"ac7d6638881c46d03f352fec753e1f78427ae27a21bb41c108ba6acd37e3894d",
"7bdc88d2f94a03822351a083ccac1611bb097c5a503f4415eace4295fe60e5c0",
"63f96ba5eb894f66a2046f03c154a1ad4b63fe042f72560c8549933d92feff9c",
"f495e329326a008c1f5d6c37e49faaebd0d77dbb7cc0b69f16c4b8787d569b79",
"1133f82e5a0dd8a3eef5e6ad896a4ed891323360120e7eebf63409abf1d21d97",
"397a2cb69d849e47983f780bc1831a04f9677c641b1cf95b58c37bad2c837709",
"2e3a8fdcd94dbd145c00cf9afa336d42e74809aca57c4377b1c3d2dee2b4f2d7",
"aa5bbf894fd39a88af8cfed85902ccbdb98213ff76842da1180927bb9c829622",
"e0e61bc0aa883b1c450911aa43855a78ce7464eaf33992b580333c9f4ddc7e47",
"00e771ea884e863b0485778dc6a83e3a9837b8bac15905b9aa5f191f0a388e55",
"e1e8069a2577f56c24e788ef537d33ad7aff254fd4c1053c74544453485e619b",
"c6816e680e9f284b1c924dc72fcff546af8bfba361acee3d4f47c0ebb6954ee1",
"658af392a5ddb43a68d2318f7c8a973ffcf65681995d2d45f4baaec8ed3a4cac",
"75e22dfb80bad85e67d0e31af62b25fea86566c7b4cf2d97a721301bb17e55a8",
"60f5ac36609804c11c792719248e12984c7be31f60e03df70bbb6783e319c93e",
"95717fd912d82c734c09f8ccf50a6f423e7dbc1f948e83d7fa0b6fc28b3facd9",
"acced6ba5662c083c13a65d5bd9c1f3355c6da2dc68c93de3aad91d1b6effd75",
"01e86299edf1d75b86a5692dd993608c5843090fd96fa4633ad787159beaa66f",
"7fadcab0998568f098926587202cca70fce63ff6914affa18965e8765f959615",
"c0a0e42cc3a52c730c17ec2e629438aa204a8c215e78f763561ef520d8218fe6",
"f6dab2ddbf295b5dab11ebe3b0d1e66d2612eab9785b556125fa6ee8e11104dd",
"86a084dcae9a8867ce44b007fb3cde436a01e5ba0748adfb6b93d12b9e8bed7d",
"4ca2728a7a8c1d44741c91a57819b3d300097bd664d045a4aa8494a8335b7681",
"65c81be5b286ed58f71bdede584c8605580b80db25fa2a2a2d81b8864fa5ff22",
"13125c47f36caa635e40a2302be888ab82ec29a371a236d059c799fc04c292f7",
"0725a396003fa57c9b2f4132c57e38ea7362cadfa564023b8ba0074c510d300d",
"442fb8f5b7e865c461b12fe168046e03b2aed77b21cc0396ed21e3f1f8db0b57",
"5985de5457f0403de83cffbd9ddfd3277928463ea8b45081a319881119781576",
"0d6806cdb36a7ce8de8a8182deb0312c2d79746a954d4e4e7558b3fff1a3ac98",
"a425fac05dcc3e1992ae16373e409db210cca3ba51a42deeaf877504cb332628",
"f795f1fa219d18a97993f06c88ab300689ca9c3872924d79812e742ec0f9e8b9",
"cc42afb4bcebf262b1bc6e829170f86567f5a5bda6c69d2f0b73e25aade1b10e",
"e15b87e31f83844859cfa796758b1e41bfb1fc7cfd245955ff3819c62d953f8a",
"4318ce994c4cbbb8192b5de213b1218ec34189ef89b8f1536276ea9138ad5387",
"d6107c905bfaea8907596b92acc423f0e27c6e9992748475badcc414e0f13ae1",
"f8264b81f82e5e5f8181cfb49f2b0be75d433cc8affa8ebd1b5df30c39b58bc3",
"4c70698e3cbf80c424ce1b89f0cc06f17f22ef2a70ba553d55a5841ef69d5279",
"7e8cd3acf2422eb56c89d5dc7423b694695a5b12bb33648bb0b6e801e46082d8",
"0916108cfad330b29fd56c7d2e23372c675e3743e34c5d8ec1dab5f64f92514e",
"f57bf57643c249d7f6563ad4d86d3200976d2f9d4f5708b0771685d85007d730",
"165343f2b50dc3c8384eb630b1bfae51c686c476047612b75221f374985b733d",
"29f980b931476fc09b52bc6939d2b982297b45559d34b0ae45384cf7c89118fb",
"756c5c4ea0b713db8ec7bd35bd1715597b9a38cbd83f6260413e3830980da1a0",
"50a7d5373e96e889411bd13655fe802cde2714eab17291104b96a1eac608a9ac",
"09999ac1061f33435f04b446790208bb0b2272d57afe61a89ff0281cef7e0dbd",
"8f141313cc07d52d7c87cc5a509b880271b2452ba73780b4080ae4fd8589c697",
"9bfc495dd94e55361cc67e3ae1cbe88b5677d6ceb356d8e7b6c29c67ca4ad726",
"efdb2df592b9161c1394577a6ec1a76cbeaa5f65a2e6b27cb839c92908df561e",
"a2dd9e5a021ecfae96ab79a7794cf44f75e9fb74b34efb525b8a911c0976ac17",
"b5ad79d83bf00d04cc4f948763d6d4f49fa261c21d8d44ee14ff8e93fb29982e",
"dff8b1481eb6d6b510371dd24f9f8df95c726a51842df01e306aae0f7fdea1e5",
"33e9d0d86bd0dd165baaac398e97d767bdc5a54a52f7b49ebe9dee668c95c7e4",
"4313e31ff8c1a8b6850006ab37f902f106847c7985c3832a469ab868238d3437",
"528fcef5e94e5f9b773068871ce3b015ad4048e08ec2123d022b341e4a85d9a6",
"27a68d51ed271279e09e08e0cd414c054997efee1a084e2f8b820a9cba013610",
"648da15529e7e65922e6b03c2b6aef0ce622875cd991318f4451654ddfa6749c",
"5384e8cb774ee0f4f3406e4a5265e7c92ee7267e9805d9230218dffcc167a333",
"5249c8faef3a3f871665b6c80c7c7d07e90a59ecafdc1f8d41dc16889dfe0536",
"7ad8486b4933f47e3b923ea22d0271e0e5486ed3f0fb084a2a44f50ac6530aa5",
"0c49bca880dfb4f84537bcc07ff96badf99962099ec5b71674b7c24705b4132e",
"13b5929d84d381f96bc015ddce73c5a9081cca4a7e920159d4317f003fb9bf86",
"386b0c65e2c178505ec27cd6ace45de42123ee5ef2275342cfa6fe1a39b6e1bf",
"d196a8e7ef9c28f24babe688c1a4b4079daf249fe711358929ab6a6ff5c6fc8c",
"091674f68a1f4086b99a37cf8e81a875abd94d72227e78bb2be78179e92a505f",
"5fc17519426b0ce3692a415185f96ef32d5330ffc8650b12aa62ea2f4f00c296",
"3948838d16c5a1d1336bef5befe2eae080d6c09c15e6a4ba6485873af076a561",
"685777fa76a468218d031515a139e26b36d9b15731bfe203636906b7ebd7b4d8",
"88cd2b30a6f79e956af37170df3baf028a71c4f203eaa6d62c12f8ae067158e2",
"42217ae923973fbf1a05d9821b74840e6f70789e646a84530bc12e590a8d2bb1",
"620624bfb7e23022dddfca85525527620d608334d177a245177376cbd5e97e83",
"138477d461dbd8038dd9aba11749ab6f82781a8bb9403e4a5142fc502e96fd7c",
"818d5f0c9af6d72845a0498377393dc844019146007a6581be495cb29616afec",
"2437989a49f74a419c9ffe69ce824902ed2dae09aa55e8675574b2d45106b14d",
"f672fe7a6b4decc13abfa9b8509222f75bae1ebbb0f88f8919be8224c4e9fb1f",
"01e7b63b7f1e542fe43faa850485297106551624ba87943a7de160456336f144",
"dd8e655cbc14af83487388771943e1fbc7d634b7413743f19cc813274d3218d6",
"99b262d441a1d4b5f359ba43a9d2f083f87f1d58bf4bff5e6fe5d12e7c88778d",
"cad2c06bdacb4271003df7e95f72133b96861ba59c9dcd721980f1526eb624f0",
"da20c17228bee2b03a87ca067e37fb065517635e7d899dd0960b7d2619d34500",
"f8ed57a7b3daf275ba2f2a2f6225d158447c83707a793cb8bb8f50008b0adbaf",
"5ff96d3a180c525b505da70821c76807d359cff4217f7ace604698b153f815e9",
"bbc247b5d7e2b2ca2925bedd837177129c1d073f7606c5fa5483a4865901208d",
"ac44967af62ff34f9c02e47cf9cee7ddcf1c0924998d7151c952daf4f0f30f84",
"9ffe4260e6e13b30ec0c267b725aac98fd77df849cd180427efb19a1474b4cbe",
"81ef16c8af4f9e5e80839f5c322f56a5d05fe41d08a2b19f319f0deb1cb49f94",
"f0fa22dd0848ac79448d852e3c28c0307c9a5b21b686fd57fb1c404ad46d6a75",
"78e7e5482a9da56f5fd5cbcf0c85d47fa1c031657175ac1bf02004ede8de9b1a",
"f62c56333fdabbdeac44e49ff8e73e563334f25197f7c2c83222dd82aa883286",
"918d987cb5f30824197b2af5ebe3effc784cee092134b036760809b0ec753f03",
"8796b524d8e062a830b263eabb5e5c38d62723ce63892d8ef2c757cb3c2220c3",
"8b3d76e79abaf6e1adb09a7dd590b67b9622380e864fd6856f1a910ca9be5855",
"b4ba9b40e938f9083a1448e9576dd68f02c7ec6512f2797d75785b84fc032c2b",
"3213cb78ebb42b1cdc9ffde6a85da5eb86e5e49442b88535745a84c1b147cc01",
"f7d6a4302b3b2cdfa2a8028902b24bd8e18ce17230d071278ad9a55a38798159",
"0a527443b9e2b40799aa5567f7741a31540ec894164241dc7ae6eed763428db5",
"b55fe19082470b37179e874ac23d380c54e1a72fa56ad5e2d58b454672f13c55",
"78f499a7358f82ea8f5f5aa6ff73e88e53b0bbca28d357eeefd867af38d8e3ba",
"b986ed95e7e0fe50b9eadd7125a878b2ae1f00bef1d0b8bb61b3a0a092b0291a",
"6aea074c88b063e14251ae5ad3464c8a9cf534793dbc5b6242c141db83d8e2e5",
"564220cbcd3da4a49254e82163ac037fcbd8ff9492defd2ff13e72ba12c6d2b8",
"a55fc9ed43106bbedce9dc2fd5a34cb76ae0485088fd34b4eb5e2f3ac9a5cf9f",
"22078147313cf76729bcb114db586b1712c244c930140f0562085aac79828a0a",
"46f5fde79e01009a2eaf534b86a0cf975b2ad4208bd55414bef1ac38f08283d7",
"65a7b917181b992a6f5732fac460775aa24b5a8c1b5da0444beaefc38b3af255",
"e87a67e9e88c1b50a27feabec8f6ef8ce950a1d819f61893198d91f048245d81",
"6effcfaec0895fcee831a3d3ab4379753b1e39231c425dd6241fed862d8838d0",
"1ab7d57ec6445c987abb642b80a9eb201688a4bfa49c5eddc4ea55451b92eabf",
"5e34df99816f0c807cfcec02c275e8037d4c0949b7a351fd5240dced6473382e",
"39bd8dd239fd0b8815aa71d854bb5232eae1af7ca7c86f9e206e14b100f71903",
"c535ddeb203c64c2fbb00d61c3a8d8b0fb49ba586f77f90155f0c6b724b21b2f",
"11245439ceb04406be432bf1eeb287ce0e44557234a5b1034703d71e3dd02cc4",
"387c69c3b54a17929c7dd0f42de31570d7bb9e1a18058c0aa68259bb3e933d14",
"9bc45da86d860343ba0800283b80f5be5309be85253a87756a512f65973d1e83",
"9d8edcc0c57f581142c502f69bbd82b22114f2477c241a3e482876afa7d4be2a",
"7b6fd527c44969e6da94d350e930c3b244e85ff1fc1b994dfc58cec5cd365ff6",
"c620df72c6cf81258008e2039e6619ac6d0152b861fe3ada8192829a18a08662",
"24eaf4705ec1d53103f18103d390560637c2594b99606f8740b6bbfbd514dffa",
"14391c80efe6e3005c1606b7b8b31bdf724b0ce553ffe0f79fe30b144b65b3a7",
"d673bf5ceaaa94e1ccb38b622d4da6951f206435adcd74a71cc9d9abfbc26cf1",
"5ae7bb97932ef53d5aeb056c7b1fb320c78cae324f8145194bcf9b76274cbc23",
"bbe8db15e1b3f6f2b38b66df035479abcd1b849544066917a09a491eed304651",
"5de214240723226ec22d0d964ffb8f9f7ebdcbb36b460957fb86f1ead763f2bf",
"24991671d408b185725394d25d09f0e1cff1b557b21e5bf7fd7af8abaab73e91",
"a61a4f01bf624d4adc9f92ebe8d455a851a3c46a5248918a4f8ee14be3c092b9",
"ae5a1edeca538932b07627c72b8b184db6fa4d86751ace9a20cb6c87a7666a28",
"2e553a5f2d250a38b78debac6cbda93d732c02400de45e182f126a69a7f65db1",
"e0721f1be9241c85929a5bf173512b2615e854a4370443a6df33dc6930c540e4",
"5c0b1e70e13e7dfeb9db4b11ae84edff51f072388d00318421c217dccdf5a641",
"89464ea679beef69879ef477712987a935318a863638f4e12ab4216824f9bcbb",
"9c048da3065c7496730a575bcbf9127e64ea6b0b10542ef97ef48c729aa2dbbf",
"4e740a0be4f1d7a245666c02145ab4a9f3fb8dc5ca3b90ca41fa896943f6c632",
"69d051176669140c76b92e94d13eadcf202cf1b92180e2ef41b4416a90825530",
"2cd8bac6fe16ce011b06b74b4977c0223ec2a3171ba2849ce2c91aa2b3cf3769",
"a6138a9ed9c7c45dab31b315a839127c6c43ead8eb317c8951688536b2cd037f",
"0c24c1b5d281bbcb4f8077439653747b93c724db63bf649bbde1c9bd3d7cfc47",
"52d2c85f539971811331b7df122247e7399e78f2895181117469a596253cbbbd",
"76e9e24aabaac5c7e8c861da7b07c735f3286924d551e7ded40ef4fddaecb8c4",
"7a855f678648b9b35a0fc4c7c72a5f7cc43190372b60500dcdd6b608ef37dd53",
"7da1b715a9ac88e9b97755ad7de8228f5d20bb8761e983174ebe10e7bfa9555a",
"3f2875319cde529f845bd40a17bee9ade879c13422950f02f9fcdfa75de55ac7",
"c170449703e4046a5634f70f136ffca774372368f79c6194603a69afbad5a033",
"a6b0230f58e2b2c0ca3cb239954c078c9a95decc037cb4d52293d874402b4c4f",
"be20d729f4969dded91efc004839b3052df7548cf27e776bde97ac964ed7b8e3",
"89020c84fe18533c5dec1c0a2b218875b16719ad0edb31b6a8d9289ce63c0f70",
"f7a90a2b981f2da24b62064384b5ca149525a0e3236cab8c52aefe4c72a5e1fb",
"8df305cacb61c30997742a610d513704aeacfd193382849a1e63706ff3c2d0dd",
"a6151f94603f7e681883fb29e8db54e9fe408a5a51f1f5c15506fa0b845441d6",
"8e75f4f68b6f8be2763902d477e350a72c69b9e53a5ebe6c73bd6f5a96872702",
"b98a01cfb85ab2f4fe752628953d3f91b7dd8b16f11b0491fa8a0bfffaacbc14",
"ab7d7d2b97c58ab866af7421c3fff03ac9f84a0a8d0c08e51933b5896dbf2553",
"00731ac2c7dec3623854f9ee0386ac61971245695a89a713dd56ccec7b7d17d7",
"3d6a876828c201f48e0f093404ce91e82657a62e4acc8c314af8fda264ed9711",
"c247767c3723f04ce67387ffe1d833e8e1c17a52befdb8ceced446de1e3c9be8",
"65c100c70457684cb4393200f74ec8684f117d8e571d280dd02837ad93409123",
"d32a654a8f9f163dd9beefda556e8743c850b9c34fa748ab32a8418d0198b039",
"daac0dd38a184442422d760dc9746a1f9459e5213480efca76846795b103e485",
"f77f808084bbae04be30d1fbe81ba9e12d0f56926388dc8dd4d2bee952483373",
"4e5643a4a38f3d036037eda57094952fe0d3c3c44c4266aa51ae0b97d380639d",
"0a5747d70ba224c4d43746ef45d84a07521a9965fbeeda83135f025485eacf4b",
"541ce94c0d8014ac9629d83ebb6d55d07750af771335343f0962695d82b548c6",
"c3ed0a35470c8af1d8ad64f253e2d9856d553482c3ddab09c380afd0124b1482",
"e7bbb9a6434e11c198b8a842274d8df1244bdf33acb34946cdf27614ca1d449a",
"7dc676e8fddb3d46f9e6dbcdc3dacfbf0edeff66a20f8edcf21504cbf39fe56c",
"31200c1cd7603c7034631094737a47fe41ded7e2445340d92744f5c2ae2bb2f6",
"408c10e90b0babdcc735bcddd356b9f267bb52e0c5023fbb1f0adcae63950576",
"cc117feb5d79e68eaedfd7e196c5b192ae88b977954c2460db23da17af02ca67",
"ee2c4331f6fc0f747a0a3107ff196378dd2d767ff7e82d73c2d999c7aeaf8308",
"1495a9b81d64f01196897c19d76601480a068aa616a3fedf3a217ce4a1640746",
"8c596bee765b690324e5f794c3bf7cadbf22f5d4973db644f961fa19f59a6bf3",
"070b25a76a138b7edbb807f399c2c390331afaa02e27435ce0da39420cc90460",
"f1c3b149e9680318f4f4349e25984d317626daca5f8a0d388b831d5e53139d50",
"24f48a92acd2aaec4bd766c902c45dce6e1365aeeb33eb3c5e9554ae21916e80",
"7c6fa5e9c00b606e766bf567ae02fa45c6f3bbfbd3989188434cfb2e923a4a52",
"c22d74bd8964f5db787ad3e21b321d0e8eadeac35e6d6dfca63b012a3be459bd",
"fad5e714a37df2a3dad960a3e25bcd698a0c529e6b0eb279611079e817862fbc",
"a85e99de78860a1b6b3d9e90c784d287b2957c45c68686ea6af8bd5b1ae07e84",
"08e66ca129cbf9962be1aec8eb32adaaaa8c49c6ea12f8883b27d9acc747a16e",
"b55a5639a098b042f1d2f80b2a3ce8f6870180f6a18eb306481c4a9b4a2b3d01",
"bd9619dd55faab227a0db8720b3d43d7170257d67e389950987daf143d3dd7f2",
"6838eaf21620c4b85bbb4f1726d3585b75d3c124377d57fb55346084615af69b",
"f86a012e0a1f9dc4a7b6f051767a16f28b8c154356db677c9015d47ce5c2d600",
"3acbf5e25cdd5ad15605a043afa563c1d298e084caaa0e808c2ada1e66bdf46b",
"541a75947976d2031ca3aac1d459397482e57df24c413077fddc6df33db0aeed",
"7219591b02904a37fc21d51c09538f94b682c37308ec243642ec7e9aded2d3a5",
"0a86804194a58b1b058dffc11f791fc19470e52d7917e2b4b31ef45637b921df",
"d4d869659652dbf59779ea551d1d0b0182e180bb477f690abf0a58eafc02d033",
"170579527d526401498f5091821afa8112c2247fa778882ab408dbb18a0de1b9",
"61bfb0c52d51ad26cb3722d8e026cd82aa5691f233bb6497958ac7c27469d619",
"959bc4fefc7e353854ff98b113d11d79f6ab1adff8ff86d1dc92dce1f74ccac0",
"f3b41df5ac0118d1858c9a12a539a81dd96a8b417f1190f903f2f9e4e4954e92",
"47b82e0d4fc6bf2800891bf2027606d9e950b3d79c566fb14d92497677ba1007",
"cf56a0fa2923a3c69a801ba9a801e2d28da24f12af98ce9ca0f6e223641a9f94",
"c03151cb52288483caa89aae90f2b303faa010cb8529f12ed258b569ae45fd36",
"17ac2b735de45a13b9b830acf49b415ef947fb2d7798f1423e8cb6fd7d5f0987",
"7eb8c06e85ead8f53992ed75a5b2b2aaf9788c4e933775de1c017a2a97f191d2",
"791a80c1840abbc56935b1384644ecafbc8f3e669e5133eff0a908f545d79546",
"24152b421aa3f011989c001f4c30b8c81fa6fdf0d2c4cd7086d1f45792291e34",
"1916dbc51783a84a667bff75f4359861ce6c79e125bfdfb4879d6facb72135ea",
"a5690c99b30704a6e41e8035dd3c6e73e8ef5e855f3a56c296fce6ce8826e78f",
"6c971eed99ecfc4a4eb638912ad1352ba990104b709d8be7823f81dbeaa2fab7",
"9a4e300d30067aeaae5afea9b3417f242d821acc61d43e24ba6f5f054267b8e1",
"ff93d0d7571f18ef2915271d132c3bf73110e5a37ea83e352c72b43ba87accc3",
"ada94b6d80225b0fad0f692cf3f778e7ec77a671c2863240b09b4eada2f86c2a",
"02ac2fbfdda4333a20375269640151a27886091484145866d5fefc286e263f88",
"0e086d870e82286112d05611331b1aaf3330048efc668d21e3a29c2e347e5d56",
"5a6007dd21986b835334003089cfebc9fd0dc147bd4ab5a543a73c3e91e8c4cb",
"714207f726a62ea1d3ccf328bf31f61b668a83e4297729be2fecb642c87e28fe",
"8bb3f09ed47201596f18326018cab290445ce1020dcce4d7de2ce807e374a562",
"c236b2e4e34495d0770aca22ad683970604bdfcbdfe0aa979bdaac095bbf9a05",
"0d15711c5aba4e5ab3e2803d875fd2651cf34e3a89e42240ecc5e9e7e83a75dc",
"cb43db28522edab91b401d4b79e505de672a6ee3de0588b36e70bc20c6af375a",
"54730a8b8c55357f55f855891848cafdcaf98a03ea4565909f75a70e19f064c8",
"44d23b9ecf3f84c1f1cf5ff458c108d304cbe52633d5286f1f048363a60073db",
"451623b5f543139d52ffb4c20535c11da68622c6839a3e073318ab714dd949ce",
"d69569f21bff584247976b5aed5268e400f414f834e92ebd2393663ef8fc3b7b",
"93200f29ae5e61cd3dc913a17fa09cd69f56856e0fb9cd883166c84e4a6b600d",
"c4df55fd21c63289c27a4f6200f373843327bf451c35dc283d57ea068a2b8c93",
"a7f2bc6ab2a59f04633444efa473bd822df04e4dc92189f4cbfa04604170b1f7",
"eeb1d9f545e0dde0c3fd50ddf8b2158252dd3eeb204dcdf55b83efb5bbbaeb0b",
"144d15f555884d51097d78dac5dfc9d4a609763c606fe3fb9fd43e1af50b0f6e",
"ea72b5d862941ae84ffa28dd37a76208be0f75e71eb07bc3e392bde5d66bb010",
"0ed0d73482e8b22db07ece3dbd3b86c48b3a72832e4ee2105d5132e1cea3284c",
"e611cd02d55604202865d143e387a4cc4792ad9cf248ad2c0a402d017e4d9262",
"ea7187d483f66c7f1d987489deb3094e65e5d88f7497d30e13ea891c6d1ca82a",
"a6485e9cfe466dd5b179c79c445199fab2e8b6490b438d751dd6561fe7343fed",
"26563fc389fe9103ea9fdce7410c6fc861ef031a30eda16ba6a0f4e474365f37",
"da320be5f7cee30b212378049eedabde911ec379f02a85c7f7f88adbca1d89b0",
"ab9ef4df3e5e7938c0ff40b2c37e0d73eea48dbd599e77d454ca89aef8cae5b3",
"f9eeb2c6defd73d5bad9eeab1ded559d34e8445d0ee970a7d991dc6085658524",
"f62be479d31b0b803fbf87857299486014937d89d848efe2dd27847a57fc192d",
"d04632e5c45b951878820db4dc6b6386ddcae9463496a0251c59c79fb55cac03",
"471bc789579bfb1c3782860a5d19be962ab747fabf54dc1c78b7050b78ce8216",
"c2842d4f5697373082db72007bb0efe49725bad186d36457507f3aa613f3abae",
"fe46acd47fb01076a41f2110ea8e350c622489b3b9bd7912ed1f73a298272d89",
"94b233800a91c2a96d67eaf7fad9f861317cef9ca4e84246faf13c61ee636f61",
"159be8ccc2391af6350d379a58d7ce679952fa61b236aaef353e4b34afec301c",
"fdbf1ba0a61304a1fd2fe9e0028342b98d61503b27e58c85eea83fa6a4c10b9c",
"f77a689142fef454ad242c3c1bb2d0a696a5ed190123ea6c70ac33d64a498891",
"b472f0a2c35a990cb7c9752626a4875d58507be8d2972a7a7e190a25ad113101",
"e26dfde4040ed1bd07e881f5838e99a7a0eeb91c885fa8c83aa510e7310a9972",
"a1edf6716e1b4178e1b22facb214ce0a5e8e4a567e0f230180c58055bdcb1147",
"ef9a54dadda6ef2a5420c9cb663b4b57c8124df26ae80a1a59649c836fe5a2b6",
"cd44a7f20c23982732de79b6cb1fadc9aecfff475d8ae18f8cabe93f8dd17338",
"235d0d25c07fbb3d7f702d77bcc8d4a9aeba1cd981fefdb6773bcab5158f3709",
"beab9251a2e65f7636e08d6d6d4610a6920c15e6e9a0af190b1e47139cc2ce12",
"9f49c3482c17109120c1302264f0f968fdedccacb4ec9364bd969706d5b40303",
"6293f372cb600b5a0077b73fb9b010229b257519001f7992c9b8dc6a3ba31b98",
"2e5d7bbb4d112545f25c39341aa5e7d37834f14370ccd5d5fa70e4fbb40a191e",
"887958eda555715c4cba2e774a5905999ca2b10f04b1c83be4e802cea38b5c74",
"376a246e512a630842fca37fea8f1b39a6316686285c8c43548086d239429a0c",
"a8b67f472194f7930ed0a0fe74d28ff90692901f21e5af0973bef5b61a9b3e24",
"e4dc1f42c9e6fe812b933641acc870e295f4ef6899728c643d66af16ac078ccd",
"ff871cef5b50222b19ed1d557843d4b592cb2d9365568df641fe368a07ee715b",
"dce5b4ca7265ac7034c407d9ffb43db4b0e1c3ceead192835e9705f5ddc18955",
"f31e865d5781f639c665634a1fb1ff43b4ec67d4243b5b2918a96d63d555c685",
"d627f904bbe0220b641b236ba3bae4d73861401895171550eb065249fdb7fab8",
"4f48b5ca3dfa4c46e5defb732b7af8e64bb8f20eab488612dff4f468c78270ed",
"352e9c5fec09a5f28b7f1f266a2c7e2d24da2d18237db6cb6b9160b76293843e",
"caceb638d3f6027aec30c8f565e52c12eef175be343865a09128ffbafce11479",
"e05d78b4a8a5ab85c288e11b23dcf157c92d6d8951e431115a82b31883d1ef0d",
"2820654593cb3141b0fd0a7cfb9b9831d76a8471ccf5b1ba40fc6dd049e6cc5f",
"835a909e1c75b403fb7943fc27b491d1d1b7a51b17bff1c612e07f62da0ac5c8",
"eb5c5466b3474fb26c0ade1db94546a5ba1fbfdc5f92dd7c1afe673a77535957",
"0f7d1facdeaf1a8bd848387983e46db2e0727a02cae85ae465d187995a53999b",
"a674469afc127813d126c7a87964f9c9f9be3856781c80ad8fd178842c9da13a",
"30eb29428ce5def458c6fe26151a5e14033bb0634ac6e425be2a7d9bcea0289a",
"254856684720d3821791f1f2b48c4f316f0f0047eba7317d409b685ce9bc993d",
"f0b1a3a60c5810ac5f4816defb30f08375e7430ec25540b3e791e586ab971a9b",
"c66d6965bb55c0855dd3eac337882c51cb8a0bd041c1780db6befe7a1a7838e1",
"c36141dbf3588c404c3a44a5caf40844f212ad8fa857ff5f69012469d144e670",
"437ab493b85dfc227de441248960f4ae13b6d68bf0b7b4c09d1f2500aae0b8fb",
"0f49c6a654711a7b0f39103292fa43fb4d19f1544c1c5b1ab535191a4021e0b5",
"979547bfbf0161caa4951a645d31a7278751f74eb17816820402946a74238b6f",
"744886b22ad1d63fd5878156b421b0fa7466005cdbe05e5be73debd751078dca",
"9ebf2c5de3ad9b5956bb1840070c3e500869c78238c4489387466698a01b1655",
"d0adaa5709b98f1620e49d4874f476bd4ed0df3f9ee66c188f15babfb43f8833",
"af59c3e3cdd9955a5c83ce021a9c98abed883dc8eb8838ae3a4c2163278a5c13",
"e39c97ff4ffe7f9ebdc7752516dd3c57cd9e4dd26d1447d6dabb672aa47e661e",
"cc460d832165921c8f12224e10e71e53265e59c4ab9836461b3f80eb5b99ed4c",
"0200835eaf45a49b5014da3f1eb91f9e8ca87044536a777f5ad59eaa09b74de3",
"d7ac4645829a34eac1e94f9226eddf7122f5744054c432e10bf5345d5ee33167",
"524a3432faf7b0a998bb0a6533dab757666728f7047482acf50b82fe041a2478",
"a314f153d7b457696d72f75abae1caf08a1304b069f3df44cbb2fa6771a48ad3",
"f9c735c8f3c981c8b7464b7820407d934b92a02a3295c656e95b649f885992da",
"4a3f51f68387ca64dc3cfecf4ebe18d071d82e13e0e7504d69f76e1c5441eff9",
"5f8a63e10eeffd6f69104ac91086aec5100b53a428872f55520263aeb49f95ca",
"f3084981809275d8598383dc5523c13151533454f90b0ddf70954c88dc736a73",
"3f6bffd45759b1bd1f2103ccbf8898fbdd6ff58409013bfb46ca16592bd8407b",
"d30b902e111b619414563f1cae79680eae1fd48115482f4f123d76d94237c570",
"3917178948227bcb018149e7d3b484cf27e3f0880f7e4938ec105e1c59416abe",
"6ac60723987091751b29c26e6fc924c24031d7fbf2935e1dede96b2288f05042",
"a955db75fa1fd77feea1a7b90d1ecb75dd678ba8390438b31572cb48340ad2b3",
"70b6153c8dc5648bae480372d847c9a158a7001e8a5f5fb229e151808f1eae86",
"b3f1f6c0bcb6ab7de194436a14c1efe2ebf8e23bb993a0a951c34e46154dbfc7",
"1c969bad0c3b343ad06d58a48321deb28d297f7d27809d94239ab6fda366ae47",
"86b53dc1f3f7871ce1665ec1dea5e9cd0778d76fd40301ab0cf35f8821d91bd6",
"4f843d77b72ea7ba2723646b6d6e81bbb4cfad5f8d500d95057d4adf95b2f6f8",
"1a72da408cfb636b23b1278efd5553f7aaee6285fdff676f08aebb1e3558f398",
"924dcd7e31e7f308082715ec3780f2caffc739a117f7cd28f6bb96e3c4719860",
"4d4d5ed1ccedf901cf6a47be39c64ac66b8ed2a9cf090629b7f4241710e9a2e6",
"a3545bd34c2e819889296cbbf86af6580154745790fe6ae2528bf6ff43189444",
"ebd40e6c3a9b8264dec69474acabb442ae9dca944841e7f2835b3b2c1f6ba43e",
"6bcf9ae195b26efa19dc595a4a23132977c961d21325180e0c887e4146974096",
"40273375f511c7c94de29526c0c446e0d361d275d7151a014049551c231db487",
"268a015aeae379a8c3c443d3485d0426bba58f4daaeeb5959c93fc8e97ebfa81",
"edec49bcc80199eef2ad5def5e891b2514fbd7b3c2e4c276bd24d1f7c12a9d04",
"fdaac907047ba5bb3fa06e7d44da271a297c3bbcce1c610224ab8a503d157aa7",
"85ab3efaf2b4c3c350d1b07894125ad8ba2f38a8ef6b106788f8002d703f1ed4",
"245a7bdb478a9dbd76eab1e7ecb2738e88875180bb88d29ab122dc47d5243436",
"19b6f1950666f96deb8c4fdd505c8928572600872ae92ef00ebb06d757d27631",
"9066d256b54ce6a9828c741bdf17925d1187621155f1d8a36f8fff1e95e27ebb",
"f4fd0b0ab33665565151238edb167427cbf9f756aceb7536530957b68ef07bb0",
"f31f22bae93fcd33f676367d522862fd6816071e0540656d5d51507884eeebf6",
"3c73671650ba8391d2c06c0331404adfbcd9fc7146827859ba739ee896ffcedd",
"79b4a58ab109cf428527ae7897300e4636583d2bfa1d22cc157849db2a3888f0",
"9ed7bed49e9d218336de4c0d5ea586186e3a46d5973631f47b10498c9bbff5e7",
"1127a86fc8a65ccfe5e4b79669b0cfe0e16bc4afea3a2f50c63c0e0b03be95a5",
"c410b29c812bff975da0ba4828bcf6796fd308466691f83a9d1b1b1cc214a8ba",
"5bcf99fb84a0417864d2bcb548410039430bdf363c2d3e200a95bc9a3c394b5f",
"bf46ee64ba35888920e17015f00cceed12485ffd18c23ebc709a88e121a06b9c",
"e852fa9c374bd054084c3b0a606830bc1cd9f38a92670e5d64fbe93c0d8011a5",
"17d29921a5c25b296b95aee3548d5b26ef6b3c4dec1e9da4141d507a77930a99",
"b4c8f1a8371edefa86372f607ab0af67375225189935463c2e0bbb5356db3a28",
"124843ff546e5ae2a5b526515e9b6183ecd3d332606d3d91c4dfa4158cb77250",
"aa6eec2bda49de5d99d166dc2c0c75850953fc5297ba4f4a951a5393bd9610bd",
"882b91d7852bd534e5241dae7639ed8733abcb1e42d260feada4b1decd3a02b0",
"6e146903849f59da9418272926589041e9e7571efaea55db2644f507801f432e",
"f69fff8797c9384ece548766baf2fa25fe8b4443f7c0679833bca647c49dac77",
"7497e056559eb887e88ad7f7e914a42d717796f96d94162f2453f0ca52b37324",
"c6dea9f888174bdb5877075344b4e7a0c4cbf8dddfaf693b4fff465aa3afcd48",
"45ad03fd1ebb895eda6f3056b6ca0f61aff60e10dba49f379958e85650ce2abd",
"78a09395a435c49482037293d7067d6438265623bdf1e0165057cf040e4de3c8",
"fd957b691494982b74ddc5fdc3e7779252f55e868492253ed127468773320e57",
"ed59defa8ecc6e43755be03682563ac974c6740b3b83322e1b333c09cb507f56",
"70e281c0c2ab3acdcff273cc194b9d8981ab3cce97a19f4f2193a347dbab8ef3",
"0d07e6262dc3d431c850fab399f6967fdacb2f278cce1bd8a6f98859637d11e8",
"81273860064dca67a06dcbe8e6e0a904cd49774daf9c81f5fb6ae4abde509e87",
"e5072372c2c7ae717511d22452ba2ebf3eaae8bd332b279ec2f07bc0f3121f7e",
"db8a798bbb8094f101ff8b10d924ef022a965f381e59e394fac0fb6ac9433136",
"18770c69acee10f5d24988240763ad93f8bb43df8ccbf3f981ddfbe30369bc79",
"fa063f8d1d39bfe71fcf8853fcb6b59ce7fdeaa1b1cd92a9650a5d125d561a99",
"8bffc163adfacbc01230b0a86f84d164afc61b7daa68357f06533c36c9dc9d4f",
"b87b98ba3619ecf17cffe7fd4603152a29e7f51cbb8959e50967879518c902bb",
"303de05aed991674bd107c1b8bf364ab2dee0567093e20aeffb54164a4cd83d9",
"0a1096c60f0b1f3cdef6c2adf14817a42106261d360ba885c59d0b15e3fb5cc9",
"27b373ad34904efbe4ad51cd8828dce76bff5a2724a6a88862d46e08e597630c",
"f18d8dedf63062061ea345fc224ebcb6d0d4c6a854a2978c00aea30bd8c1a27a",
"fa66e6b486724ffab5fcde4ddfac982705f809adce7f909853c76fcb91c4d642",
"8b4edc9efb01013d6d1da65795a3e554c8e78fc84c82103c3370da7a60901742",
"7764599aab03a5c93caa5cab487f05d9f4e45cc0195d10bdc6d5d7c4d240a0fa",
"0842208b671f638d4c8cbd7895de1bad51bdf1840779baa3dafa17de3fd943f9",
"3f3ad95592a01a4215ba8b77bdc39cbe0eb61c60fd3bbdd0cf77387f036d45da",
"5126a95f3761302d73731ac6c6874ccf0768971c1bf3ad788dcd2393a35829d7",
"82e436dcf707ed4bbcc602bb23c78c009bb4ef86f7c2d777c0fc3a9ef452d472",
"8d7a685ff755aa9c6a3a66664d1a3d5ba69a5d9521ca393d2ad40c1ec6f841bc",
"b9b3682c53ab535976b03839962f0fbc9fd016b89dadc3c763c2c380c5504104",
"85a950416abd15059c9a2507e71f82f7f0cc3a170f2119c66d68f08f64a6c6df",
"57109d61e7be6c6cb02c05a15dc3fed4cdea43df550d21268317ef02f38fd2a0",
"bca79f95a07f119b2809b8ddbef29d28c8f08d1fbc5676d42c4e391e8e4dfec0",
"6a1f4c15270fa04623dcdc7933f87bee11f1c095dc25aee45b261673c52ef34d",
"39ffb6db38103d923f9525ae2d1a9a18460cfcd674756a6bb5a940870a3ffb63",
"0eae5f3ba0546822b188f2b5e9c7061f4a1ba4c2a10d291efc897f42cb37e5c7",
"57b45c6214767b543e900173ef237735934e274198cdc13b35455ee0b43489fc",
"903546805549251fd34ad45dd9394aa896b1e7b3f50737a939aa316e3396c48c",
"1a3544464365a026868823c1ab4ed1a852bf1f037fbf18b2dfae90d7e0bf67a7",
"ce511b8f552eb110e2b4d880e076a1b04b4fb063919eb8f96681196a96fa75ed",
"3af3ede562af9935168bdf63642f81d52c318758ab4bb021753d752c87a6d22f",
"d8f162ba6f85d8ddd7b4591f08fed5242b1d5a47e6a1b03f21cb2a0d5407ca63",
"1513198ec60b68fd9b739c95af057b10a9c266b2515a377b424110d8109a598a",
"3c3884bbd4b4e2e698be2202fb3d43d2bba3d33a765d29e670239099b4b2a072",
"6c3f94c56269c9935d3351b580858df0b64ab9aec4a281d1ceeb54a27710f866",
"a0d29e01241582a6391fac5d35cdc23245b83c920b28ee1b6b16a9743934c35d",
"e4318ddf47c55e5995cf20a05e15462a21c5e3f43cf219f76e731eab53d69fca",
"d82ff716082e80be6bef5c661f0bd7462922672d6609a3a08e0741e4a549861d",
"b9164d9636e24f7c1c25f43a910ac15fbce35948bf2245ddae704d2fdc70526d",
"6d7d919d3590119471ac1f1327365b0999d68f1793bc3bafbd99ee50c415e7eb",
"7892216e2620921b445ec478d73bfa0b1bf7eb4b8c8e316f77995fa237f52433",
"d5334bff430c6c1e4f708029ad77d22e898bb79ed896d70ffaaff29d19b68275",
"aae63ff7813ee7ba9a4f4f164778544e1c1c6bf696c322c755d22b60c3774203",
"bcb17646adf001b0dbcb60861aefebfb77e4a383f380cfcbe5569af6663a8825",
"21355c1c60fb05d59fc711455fc45137cc616877b4b07cadc6b456f2b512aed0",
"7aa8a3cfec26a76a5887c9ff2d0e75f81dae0f4bcaf7a999c1187b96926e2388",
"9075342aca2019b1c6389090b737d8bdafa1943158c258da3092a0eb8d7f4dc9",
"11531a2fffa79cda9089beee6958e611fbcdb81d49b737de8476d7e2195c0446",
"31f0ad296f3d75a92132c1a40f228cb2c4706a781ea0fcc23d8c3b19b97bc444",
"6d8632f6dbc19f9f4cb12477fb8494376bd2beb1d2d9667a489b87177ba8e7ca",
"8440f6f09c7e8bd2a69fe6cae2f8375e01cd02c610ead4da738eda130b3b53c8",
"47f5381e8d1aad2dfa42593c5e5b83350d572c37d2e63c377757388d289adc4f",
"6642f7b270b06631bb8c35e36da0eff8ea0387dacf2794c49eebf305956d1110",
"eb075072ccc7c7bfbef1820f9c58d6e6a5772be54d9ba4e18afaf23a30c144f4",
"ff7811476a1588cfe98b79df36e5fdf23a1df98615f33194f2932e968e00fdf3",
"eb81b9f9e715d6a03695f307ef7149b1b87c73315dfeb2268d85b490f71d5a0d",
"b2807280674c02d7140f214b0654a7119b820f8c2a1108f0e5a08e2ef7cff619",
"e2e57d9026c5c04361163992f4111646848eab387085f30e2e411b40afeb308b",
"86eeea94ea2fc924273ca8aa863d236ce49fef3ae336e19b63eaca9a3318ce1b",
"f8ffba4c7558ae72d4be19d56ef139dfd6b762b3dd057cc7b632d1db33a9e2a9",
"27d76971849ae7720af2814c58884ce9c044c603d3573665cbe0676cc667f571",
"657b874ad9fd881b84da7bad3f9ffcaeb33be200b394817adae71d304d4ec4e7",
"1e1c3e004dbbef9e1581228b1444d01926aad809d004a58c8069fb14f4c8f938",
"ec10603cca0a90697942b7cfd7438f39b0dbd0ddf647aee2e5a5f23689764d78",
"9c577b45377b3ab8e550f101834941257d021ceeb2e27ef53029cceae482219a",
"e34a6378ba4840646ec543fbb7c04998ac731949b085721e442e62865d382700",
"a20d8bcef32ea20f947fd7ad9368053c6d8cd572e812cb7af828a77666afeeed",
"0d9be1630920f17c50dbdf52b7fd22703f45d6b05608da0612106477db4f5423",
"d5e0f994199a5f4b3bfb5fa7e0383f01dae9b0ea5052ae60edfc619df08e1b05",
"b86d4601473ee16ca8791bb414c91f796d159b33bf84d249ed5d019d8241aacf",
"3b5ce81eb6a6d19e00c8ba7a4aff623331fc167edd4a6e927a9d5836860003fa",
"6ec220d2060a2512fd471ce6bed91c1b074f926949c165342bd5de66a5829063",
"d615e48f2bc3a1afc9398faf693723708d639198e52b8d1d11beb1cf5de8625b",
"fa7df395005c272b0ed26ce763f6885899d084e4cffee2be24568963f277365a",
"625e3e465e6007c3c8462df8ab2a6151048b4e3af265e7687d760f6335ea46d0",
"9e26804691980354a19366b7de310a7e6693650ebd93fb7737d473691d538ed0",
"df10f32dcc6d733f5c24bc32d0caa5299278afd6c2ec81676e52296e4158dc7a",
"ab3b99b7a60c5e425fb08ba7e94766334446a6ef2467836d24bba8a8364b129d",
"54724dd296c6957c094eaca1e823107407002d6649dfdc28fdb5738e9b1ad75d",
"5a70b2ea0b06d75d8270f15e1ed921d77fe909631bbdf7c39d688fc662cde6a9",
"8ede549b73cb69cf76c8daa4c980df4d3fb3aad4fda2728c547c18bf4d172201",
"380f241c3a1300f517d7601d5a500e5dfc549175a6f1e77b662dc26a7ef8f364",
"b8a032767eb756f5f929cef6d6f5eb399b606dcfe4804779a6668469e424f816",
"bc556033d67382bf7b75a56e01f2795a350d071fd0111e7b781e94379fac013c",
"bab355f4abfe142dd2ddd7ff98b3de4ed4a4726ebc3e8f13bad2a874399054a2",
"6ea49e5031340c68b908f7191bab2454b6d39415680d0b08d872b699f488e2e5",
"239b3c67dd1c20a0194f57fbe44c20e485913a75cb3205f1993c8cb885616323",
"858dba7b6f8d06b6cd8fc3f1da905b885c4b05db50a07ce8a39404a4adfd4ba7",
"6b2a442b9cf34174c235bd814fd198763118b55c08d0d50c039521b9bb3003b1",
"fe840926d601b312d198f93fe5b4e884db12bf2045e01ee3e15ccd5d6e43aba4",
"775212f6c642444f28cdd548ef6ffe9a9c25cb2cd079243579208c008d03be2f",
"07c504df91ba1c44b0ad20edc4833c9492762efc06e86619f5c33e1c71bffb96",
"346a7cdee5872d5c5e9844e2893a0c889cab25743ef1498b215ad84e3d74714b",
"6e563948687e72dd9b40c88d1051f43088ac9e54fa706a1de8da0d5eb5cb8226",
"ef7843d5c6b220a5c418804f7de58b78f7f28076d9b554073ada79eb04afc5f7",
"300cc44240a94227801608c98241f6d42d62bc3716134b0d176be5ef2bb9eda3",
"0964ef0d82187310a268ca77e510e6e57fee05775ac164a211449a93392f1285",
"58604a8a4245769e31bc455d56ce8c2392662907ddadad9feec30ac079b47846",
"772079145c59fa592a5065a367d175d0b549f106786c5b6f30812f01426ae6af",
"9696b24281f4292471a563d5db4c6150e26357d812db442d1d491eddf96947ce",
"8afb5d2d77848ce9c427d66da73ef3721bd28c0bedcc475d0b367d89b112fdc2",
"05de04e335fc86e380d4ace3511839e3c0f2e171c8b767b39c48af8f837a7b7d",
"e73c78654bf203d8aff6edf095674078d8c6039d9edcbc1f574c75dff444b674",
"2abe3c0a7ba0ecbe6f547a065c587acef458afc55e675c2dc167fc10552938d4",
"914fc388b0856b54307c7bd6e773a616492830f3ed9afc57b2692ac674fc75aa",
"f38ef17b3d801e30558ea933efa3670c24160e7d51e83e93fd55a8365a5da63a",
"2cc52b753b89b31de534061ff33bad82e2f9fa8e704641d04591f801efa2ed44",
"6a746a5d997aaaaba871f807f0edb635fba41ecb9816dffa94cd569b67d27a20",
"83fdb7b90349726943e2c1c79e57adc0c2ae49a5335516e632e45aa468cda117",
"0d41e1e22382da531c94aee7e7285bc5f246f76d92a0800f121c789db3c996d4",
"c0148c30c921b4e64df4fbe581a3e6472b82d543e1643b621d44c1311f434d3a",
"b40730bfecb542a0b97bb5ce78e4cc0363b83b2e9e35283834d2cf5972cbe8d8",
"76a9d5af8c67b545c2c960e41fadaf6f9fa092cbeca29d191ce628e9494490ef",
"83f8acd9605f58500050f542a1fe103d93b21c62f9c5d6a0707431e9907dd167",
"0d663b36220e432263b0430be43b2f8fdcc2c2877a9d8f6842c92b2f3047ce74",
"dd6bd81869570b9848dbfe1dfafb3990e0dafad1f3be76466823ce10736d32d8",
"e7a28f50bcf9ec8a6f105302cc3174d569ece7b4c7dc4f0bf2a133219499fbc2",
"5ce4dcbbeffcdf38dc85f735e91f0b18e596e529ba92d72abe760c942ea3e04a",
"ae9b9454fbfbc023efddd2c0763986d8c9d8a41ffdb239c17841f744222bfdb8",
"9c7ef17720b5c2dca04a4d9ddcfee91e7fbceff60691fedbcf4adb9b334af383",
"31957c602058ecc08da4fafeeec99cab2e8535eb34e4361888e780b983fbc2b3",
"3bbe173fd15ddc36fb78eefe30f2696c44221dc9132e638af45146b82ee2c1aa",
"e20ecb7255f800cc79d7327a14f83d4d5e9e5fadfa93df66e90ae8470d3c7bfb",
"7ad9bf49e6e22ef2958c63a4b63adc88abbd6596c7d370246fd13a8d442a616e",
"a13c3e0e4749674f52c1804c426c58e6489ce27866a87946d1494674932a9b0d",
"60bb186f5002b77c3e2f429f9be0c64f431361a63bba552e2041214bc696113d",
"53a793d3fcbd340307dda5f4138d3b33e4dc64d9a1beda1e0a2cc5c9657a0185",
"40f49441a7de7791140f539826e0b8166af0f5cecff35acd32e8df34464a56cb",
"87fa2d7b597c5fbcdc97d12e2b8ffa2c6d01e0c155192fc97683846329afb6e4",
"bebd1ef08c50ddff26ca80ce7ed55742da488ee85103e42e7a377debb82f266a",
"dad6a14dbb1662e762ad9c3748edd572be79820fee72d90439e262e16d8a390f",
"1eb20cb8fe37284b40dcf6e59acee70fdb0e6950e3a9c86bfe1b121ebf6f527d",
"a6be46c853f6554ea8ff265cd67a103c4230dfaddf238d5c4dd002af1a99deac",
"e92c8230e16196eaf1f780df3472a6ecc6a6884bca6238727ec0dc62a569fb11",
"3026aa64ae7ac4a1a007a1932732a3ae0c5a74723413c2382f69366b819a090e",
"c8d12bd9ea44ea2746bf232bc905be1cf45d8d201da9e5cd43eefbad1bc91d81",
"da890b026a02ea009f97c8e1686bd9c050408fa7f0106ca240f541a1c905d0c3",
"43264af06da2bcd38e0df5d97fa78e1337db73deccfb8030ef8c42acf1f1b079",
"f3adaa0d2f8af2ad1456cabde46a52d67d603490dc654764daba69bf4dcb9c71",
"91b45e0835d0cddf765e9ca488eb066149a98ee6c5b71778cf4fc118788cd505",
"3ae5017fcfae5980a6736899117df38f67b0ace076caa844a5bacee280fa475b",
"ae45c4a2a3cbe4743d7517c1d31fa3aa131c4cf05296f03cf337c6767a50db0f",
"74798fa45a22c67840f0c391ecfa3844bd16314560f78e08618bb720dd558631",
"2202cf43c959b9db222d9606d3a1ad35d3ca31dbbed4d9dff1c8e2c5c9ff4fa3",
"c473bcbbaa22a39e02896d6590160b3034486be8c8d1f828e2014a34ca364d81",
"cbfbe8a6f86e0b78f35082ddd64d2d90bdac8111b8553598ad890d38d03a8546",
"ede8b5224af3631d437fe1ee28d63ffd1d11009fd2d7f8d7ae9e129be4e90e6d",
"9747083c323c1e5306b7488cb1c990e830dff2f5fa692ca36847288ea6117d5b",
"81de351b76b691c1e482144d4cafd5ff7fae13e2d52895f8b9d5866f246b7a09",
"e1717ae560f59286e9a99484412ea594cd69251da839d121056c5860d1a2f038",
"43e60f0452b5929ab02912ca09b6be1bf6072867a45114c4411ef2311042ddd1",
"53958eaa85fa4d9d82a15fe2972c1c817809ee5425740ce8c45bd138a67e5319",
"7dfd06042431067d605d473bff2219a4e83ba874007339d2dee8c3210f5c1eee",
"8d27bde7082b8d9bbb909b5987fe8a2af03fe7b17a28baed2cbe0233db6ac2da",
"d4c162791035a88bed59dd1c87e3114cde6f619fab0e0068767782b5fbf0ca20",
"08dd976945eff1a30c7fd2dc4cc4351735b81b21f934316dd87d6f3671030289",
"14af5a6c44c27f1957ef6892907f129488bc1df12a7841b243304bb3f9391ffc",
"898b01cd1466f8c20a76695265fed75c8e208338cf9eed4e7b9db93892100e88",
"7c79561f2f5de2ba0b0d15fb617725eda0afa6001664e1cbc6c0c1c14e2e89da",
"21edc6f15760b370f6c55232a2fc7135c95971e20c8b280020193c08111cdbba",
"b5d30edc0c804ff2384a265bd13331d65c5b4870fcfb1aa3ae5794db383fdf9b",
"6ed17f71e358358715ff89fe54e8aba470ebb35549dfc53d9c53c7ba2450a31d",
"40e47f56b8f40c62ad7a9f6a11584bbc60cf61e66ca3e90126c009f029f39c88",
"abbe49fe930f50b3424df6814e1eeea9444cf40c56f961b14a22e2d35b9b2e77",
"ebc6e42069d288845b7b1bb40533bd0a749c478784a2f90ad622dcd475f8c12a",
"8590f2deb05137cc9a1c0ac536e797fe53ae863a61588cb7f3ef2d0551faa317",
"6c11d66b42f449d24df0b3e1fe1351712c9a3f3d2af3b562fa9dfd177af5fb3e",
"2043498b31e528d67cf626d01508803585e7c9d609b9f166c3866d0723e029b1",
"d84509f61df5bd81d78ca002c475460051abc6af803088b2b9c50faa5769d1e5",
"06d1636e99432defeb3855d6e0f73e810f057605297ed63d1155b4900cd0b22e",
"574ddb338dc4d5794cdd533de8cab95a6d40616c3924b3eb42a2637c23e265fa",
"0b6b867d04c3ee21c0d3144cd19818866c602a0947740decd73967c2b581a426",
"e0f6e272ac69c6b94d97eba9646caee73c1cf5ff6d10ebafd1dca42695f124fd",
"d4867529af95b84b9f6755651158d686b2132e00f8c1e32f86a0ae9894c61845",
"d3006a3eadd7d5e502def3494b71f73d758ce01e6d7304e44c323fcf4ad3047d",
"0877effe0f5dab15195a487ecd8966a475728a1fe9c8469e07a56e6f66b5a92f",
"0d90af22efbe97c159df9422d8287c266b6ee850499396685c2e51fd787c805f",
"b41079e47098d55194d948c0dc0e9be68c306aee23f6981b34f4e56c5fa7e517",
"f4c8c0d75dcbf782ed81992f09a22e4b6ead91d20923c3173ebe21d79afe4e02",
"eddcbbb8294aed2b6e80bef54d30ccab1da51a5ce6a21b9810a27e9e6a04cf56",
"ffc4a4398ad295f33872431ba1ed26537be975cf90cb4f67108fb25ae1bd2714",
"ef32f1c9cce0135819a6c82f9c8641ef188110cbc787521c698ef6ac9547e541",
"6580607cad703def6533320ff45ab7f5e519de20b43868c73f83db96acaca753",
"10d920fdca88de21c8a7aa19e6339954a98853eee524ae127d6ffd37359480dc",
"7ea604b3ae81b3469382c00a9ff9b77a095ba540df6e3817f1bd38a700a68905",
"b1fd41753e97ed94dc572640a12d26cebb35cf3351b33d429b90c29e899497c5",
"ecfeb912e15a42f1847658401d768d395c82edd5c7c7220fac78889ca3691349",
"51e4cd8478cff836149bf7adbf85fa2bdc41e43b9a1a670ca1a999a6832b0887",
"953fa566613a898ca5a5acf59dfca4c2155d0dea87b0aaa42b917a81b0674aac",
"eb2a3500baa0bd1ada35eea60de1829a7e8c3efd4450ba490e7a59a2a1ae2c5d",
"45e692d9a15f165819bfc7b87fa40b10bf158c08a594933a3bcca97c38e54fee",
"6e2b06adfde3c027fd15113e832d1f7e718945ee042eb7fa7932eb85a4f0141a",
"909695cc70e18a743aafc587341749732b2d38fb0e29261c21dd07083519da68",
"1b641720afbd4914ba0c7ebfd1a2a01f45b4da56a9fd8e3684097a6e2cc14292",
"86723b6136544d107facdcb3a70f9cb9d16a8a829970ca8b868f648c123a5dcd",
"e68362ed688ecd4e2cc8ffa5669a40d5a4c51466f7e98d9e6c55d4bb7e61f155",
"da13819da53feaf7fc236f24c0dfb874e711eb7a5ca6b2dd2983250be15ac262",
"3b0d9d9fbdbd3cb281e6984efe92c3499244eb497288da8c6f80157e11d54c35",
"d32b0c9b49d868204978072eba1ea5d7525a467df15fc921c43fdffe27754b6e",
"ed6f85623e5432f66a9796d92e7635eec56a9193fc0aa8881206f3dd9295422b",
"5fb79c9d537ad301983c004d24525f83a20d86b1bb23378c99b1f2ff5bc72f3f",
"b55cad2bf5d6b9b79ea21d1bdbe1000820dd3e80c9c62fe3ab924b4c09066619",
"5601baa1e6e2378e5f162fb6484a3b88806a96a2933333d23d8b4d5d0f949d96",
"33b5820baa477de921796bc4296e37f5a8807128c3b449a9be37cd38a5980c47",
"5de6da3be8c6c3356a1245c1a0e535d2eea7dbeca099995063a839b8f7e69e7d",
"87d27b1140957ce19d32e6db98435fbebca87c279eb2cc70237fc26575137230",
"96e631287c3b359dfbaab61e280c820f9993fba56ab0803ece0d7eeca941b1d3",
"cdc1bbdbe50f030b68342ba02c449fdfeffbf851392d43304993e8247052d918",
"eb5b27d0cbdf7494d5aa41cc5bef9d4f97ca175ea90ac80587eafb46e51c7fcb",
"ddb39a2198d11e0128c40ea9b5dcb9ee0b5b4d3dca7716b40446e318bab781ab",
"1eab02f758dd476cca2a2b64338fa615c8f1b171f79bafaa0b93bbf4260e4a5d",
"17c60b5911503d7d5dfa2fa00110ef0535738cb6e1f1f06702d65aa0d765947c",
"e81dfa6ba7bb97c4df412125b309bd5af27cf333a5f99ff8d3ba3210a104377c",
"2327c27251603d653efc15bc641dc347ef66edb7aee848f62334b7d9eab6a3aa",
"9d8f1179b8ed5d1733b33e33c9fb8a434960690c6586dad126316131c1df95e9",
"6716d4191e718924182c662438d7c1f55531f3e24814bc837cb890ee3407be4f",
"0185bb40e2c76a8b360c20c5116086d4a8cfcb55e0dce463a97d42305dc3daf3",
"51bc94e5495731a8ef7b662dcb8a79c550da0328a9dad862a46f5b635cfa35c2",
"8dd4697ed77d6115384f17f15fac10724c2aa8b52f2f288e2f9e94e9535c02fd",
"420b346b788d863893b51c0613d026eda9cf6d96b09047d70bff9d50a5202729",
"7bddcbde57e7cb76679732ef3523033762ba6dc61fe5f429b0d85699b550825b",
"d552fffeae9e082eaa4c0f4df153924d406a105f3c2de88cbb53aabc75501c9c",
"56ef01541b6b03cba9f2943c39db66b82145158a28fbd69f3d4fa61bf1d220ed",
"effabf0da8841440fd639ccd88047f95d2ae93b4ce68c75b3914502af85e9075",
"3ddff223c4baf50af4b5c4128db4cecf0d2b269b411763af9a6d9d08e4c27b2f",
"ed9e6035d99c25a0b2bad6b0b530489743040f0936d0a01419168dccc42510f4",
"acadf5ba02a8b5b025257c2fe3a9b56f292f4815e267790ada52870d48f9a109",
"a23ca707a33d74e2c5123139bc5bc94823b670f6388c135a804b842006ad2882",
"aa931dff0359b83183d7ed2b99a13813e334f6192b925c4a98796752e96b5773",
"6d8fdd9f4dd6ea18b200fa886c6fa8f9c9182f5b01558b54fef1139d13d5ddfa",
"9e74679eb05d2d3a58f387ea6db38f2cb1d0d7ad588926f8371e9a85a09ac0d0",
"db693114845432a8aab17fdebeea39704480a3730815ace801df91b757aa52a3",
"32836e68bd88d83e10b412e16e66629f13ac21aab48cbd05e21b4838c55ce842",
"dd357e0ab988720955e41cb6c40e7dd1b84775cd2ec51a3875257a27c7f94acc",
"9cc42c2d4f41762f00457e26c1bc3b12c7ae902c843734fe77588946dd9193ab",
"80ac0896543d98b50c7602cdd92609f726673048416a74f4293d802ed0ce859c",
"d80c87f95b2b40f95cdea6c0174560e7176614a5241c177a91e97020c8644fd6",
"28ff9e2dd9448f0cfb1d3f89e101b3316a5788fb5ce5c03a2817c01e7525a218",
"79fc903d78bfbb54a598c2400d206cc29c3248af738b752c3fcf12faec9fb023",
"0e9912da0adf2cc30380b943403ad46fd5d289e6dffba0388778ea32d9a569b8",
"46487d3d677a6c39a3dd5a9aa9d27e80363a2d7104e2326e9b553d00fe2fc41a",
"8a01f620933562011f6391586aebc107d49145c3ea35ed9d83439b691cb3ba20",
"d1a090ed512c796d6761ac054e18ea90ddb79967d475408579cdb84bdb6c9a58",
"e809beaee512d40d237fe2d32d21b6c7d7c3dba0cbb64143dcfc1f06922e71c2",
"c771d0a498951bde83324b1106051245a99368da240c838cdb6c3f7273b708d7",
"46d0637e2622b0ceeaaffa671d34ecf334a4ca42d57e85191706ee28ba84fbda",
"e1ae83c58610f7affd02de9dbae6d8cde96f733148625cbffef3ae9e1731932e",
"88ac7a8cb5c4f8f0249e65f46438dd2488ee29d9fcb9f223edad95cb8d434deb",
"02baad791a5d8604001fcb0dcd32560c77e0d20aa0cfe55bbf93fd2706d6f122",
"970ae2c6b1544f91159fddd3a02220bb2a0202fcf3f7d21fe615476cc4523104",
"251ef10c85e25c0a53080c1933fb6f3fe0bf42bafab7b3aa940fbcb7f9d78094",
"aa1a80314f077bd2c0e335464f983eef56dfeb0eb65c99464a0e5dbe2c25b7dc",
"ea97c74415cec8bec2add5ed26151059ca557aa1f98955a8a66830702f9f459c",
"60d2a8710abff2e540f5ecb04a12059952bb509c09eb551848251142fc03cb27",
"78816f4c59608ee742984a33088165fad1d8df355d94af464bfa8de51972e95a",
"b2a212553ed7eff6c6093c97c173cc96fa22fa6d8ebf4566e3d8db67593922c2",
"1150a95396e69972b8a3b3683ffbdee93c5ad477990cff5bb1ce57f6df8ce69f",
"d923904c9d92d49582cfcbe08b985d85aa343f7b2afec59436b47816a0e0238a",
"fc2d3a0a67472f6a8c91d1df7fc841ce0fc22ed9df446aa572c1ae0246da2244",
"6e8dded8bc33d0f0bba830879e1b20f49f56b3559ce9d37debf7d08c8bbd8763",
"38c20f02547f5776e1122472be7f4dac01c486c9972012cfd4bcc32f454251f9",
"15ece9b647c27f5bb968ca25789650efa1f91b8b9fbe1efab9349c10c0a122dc",
"bc226a71a0e53b8d52d14c8bdace5f9908176ef092ecd809e6be18f68d9d4177",
"0e9e169e4e70aa682f4a219301ae04e702f9e109c0425492eb4906a5ece4406c",
"e1aad8264cc99fa1e894a968eb51bef9a0465b7323a6e5d6fe6f8beaad07a9b9",
"372884adc5393587b3dd227ee03a0b6e2cde1d8daf22a7742e75c039f297a2c6",
"3a46bf57668e17250f8c87541229eb07e1478b16cd91d56cbffa74a040d08998",
"a5988ad3d9bfd7fe69225da508106c915f826e4cd2aac9c5ae06257193024f05",
"75c593ab84c684f34873a2805bde953e59e4546f46135df7fdbfebf7697df903",
"0e6a11a89c881fd5fb8f56d19c61ff72ad60aeeaa1503d987fb6d8be072b487e",
"517d85e0ce96b0990a9670002f95bc25b7a8063eda79a2bfb36ede4eb26b25fb",
"e3d0937d7b4daef4a7dca0e9ee453efd5ce43d4ffc56636cc532aeff9ccda42b",
"7c82dd9d3774ad6f84ea6ddef2f4afe52bd6ea41cf09dc2315a84e154d17d645",
"6d5d177ea80f7659bd56cb3b6e3cf43219681c053b0a984f67619d0d3b6740df",
"a3912a0368b0889b761dde553c5e762ff74b865ad8c3062a3dfa3b2af19eb2de",
"c991d20aa343cd24e7247b474d911ccc8bf1b9fd1fbc009aa8528f5775380dec",
"98159a6dee24ef1158dc23cb87c9abb0cb743c4494e3dc6fdb4a9da1cb8b3768",
"43d0d61773a830999d8b6249e7c78272acafd901c9e758d6b29e2f35f97e65d7",
"863156433c52524e8e1ff12bdcb96f7008fa2483112e6ad269ff7a0acb267b87",
"2018d5504b8982469d916d80a19b993553e7dd2f3f05d07233e7e856b7524410",
"4ef8fd1a4bbce2f9c5e38d430e03dc13a52e112adbe93eeeb49a6dc58562072a",
"b4a3bbf8f68bfaf07c21171344c152c1a54aa0a5fae5a721f90c4ba40eaadc98",
"17b2e09de5c47cff57d3371bf174ee8769c621861787f7ba117bf397e2a1b7a2",
"ccbc5c3c337835681a2babe8512815391b0f7810ce349c14dd90c60c6e5e29c4",
"e6738eeaa91cad4c554cfb5809bff308a2fae73c50f3d16e518ff7c5c35c34fc",
"e3eeeb4628a87523fa287dd8f7b284e642e682839725c3b49bebb2094c993760",
"1c2af59b0d27a7b3f3fcd83932fb0faebb106f9458650283d1d1c3b6b208e6ca",
"a4841721794f7d90a06377fa956dac674b46b748b414652676a0af2321911adc",
"f860e0129e0f57fb2b19231f877612b429e9a4f7eefe8bfed6d161c755da51f3",
"fe104c09974b514c1d948cb721f1a9e257fd5d55a590c2261968520995163e07",
"c87719790d73aeb624ab9edccc44e170b6e82df14c84e7804d164d44da131bf1",
"3159fa37199858b77028d6360887d011c2f864ee0fa3a7f80e04d0476848d114",
"81bc5ac9b1d27f3052b39d2778ded79332caf365d957a6d0bb2f72a4d3279f46",
"169efecb6af28f07acbfee0dbeba3abf7f077d5530493adf124312bf0086b31c",
"d0f9f95b6384cb5ba56571e5f9940f08e58e8f5d8c575251932b83f7693933e7",
"7b02f766a99ad8bf7213dbc0832a3f59e111e2f60c1776e6952a61a6e2811e65",
"104faf4847d8f17849ae86dba571b81908688f93553e1eff0cd84ab48ee98c63",
"602b2b739edc6d423325dc67414ce8249b84c0c5ffa5d5037da9f37eb4560399",
"5002da288e78384865469d929c90441d641d58b07ba3301bb3e20c6222e81680",
"615e3db2130f7a0511262b02225947e4783f5c6ac5bdeeee5d28c3ec7f6b88bd",
"0194bf7351b6ab176ba4a59d47038eee7ab75cc868b0a7ab692b8895a16bfd22",
"26914b2723661c4d825853093e40616ef21d6ca9439c9011302c7ba197c35c67",
"c169a199eaa6687f53ebb7c32b772a879e1fd18e85ed21b1928c9a910c2d4dfe",
"93f4821bf2d5f067ce2b43c1fc6d5d542fbf66b7ad5e53b48023c4008faf314d",
"fbd6acd7ad872a04d08dbbd00fc8010e87fe90e745f6fee9e9342049d7c509d1",
"9193b332a67c4b0257d2358cbbdfe5392661f22abc0342b9d0081c4d9834492d",
"e543d99885665369ed1f02d84fde5686e8a46369830afda5bab4a86fd8a668bb",
"26c905fb13a473610386dd8ed4128ae87bc5e8bb1dbce9e3a572e5fd0aae1522",
"825d2de2188bc8a2b0549913e5496b71eb6c955668b5498ab3c3f57d8d7a64ea",
"e64b87e22578812898d8fadcaa5280c0ba6944010b0832aef6ff2a60fb7a3e17",
"c5c4c58b4396d79f421b2faa61b610a2fce9465ca97da5625404dc3e054e1461",
"d1c90810c08827e26e33a9a7e5a37703d3cb55b155f3c6900f88743fe9e91421",
"d9650bd9e3209a87c2f2a328ada2989834dc00f4600d22d9879b59572d2e67b9",
"88d946cf230b486be6b07e1d2a40e8cd9f63074af26f130ed456d5b28b1c131c",
"5461a804300da17290bd0e40e411200648f671247996ca59c17a6361e36ccde4",
"41b961f740f2577d8a489dc1ab34ae985e6b0f17e790705e3bc33a7d94dbb248",
"655636fe8d36af2b082a8656bd2d15332a1fc4e5109aaf7f322b8ff250c84edc",
"1cb013db58c896d9ddb919c3938ae6be6672ed47a9c69a1b56375c2a62be1d03",
"ce376dfdef709fc1efea41f63289550478034aa5e1de9723a05231c5bf692e8c",
"74bd17191c9c917bd0e5bfcc1915e614ce25d11c69d9b446d8166611944d8544",
"2d6fb9726b9b10ebd199063373e0aaee210064935dea82cba608e62c28bdae8c",
"5b991a834d4d697955fc396ab922a3b3dd99def505c81c7b04b1f0d6ee8d88a9"
] | 29927 | ledger.specs.fixtures ?= {}
_.extend ledger.specs.fixtures,
dongle1_blocks:
blockTx1:
"hash": "000000000000000006c18384552d198dc53dcdd63964d9887693f684ca0aeeb6",
"previous_block_hash": "00000000000000000efa2551c14534c385ed1af3edffc8f276f13c0ddd0b5afe",
"height": 330760,
"confirmations": 31878,
"version": 2,
"merkle_root": "<KEY>",
"time": "2014-11-19T20:38:15.000Z",
"nonce": 2609822097,
"difficulty": 40300030327.8914,
"bits": "181b4861",
"transaction_hashes": [
"141cfa11f5e6c8633230986559173ab47b2744407dd7f74c01f8c007bb65fba5",
"3f59869d1f798c1ec29270c00ef3d7feea5d1a2a54b009f416335d7701469a2e",
"ef3e27162e370d3cb4ad5941ba592476c9ab99acb11c6c236<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>db<KEY>0d8cea0b7e1ed70ed9ce36e288a3902c274be6f19ad3987",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"980beabe3987d<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>2<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"e089bed6f05559e82eb26b<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>d<KEY>890693ac3ece32acecc52",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>4<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"138477<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"3d6a876828c201f48e0f093404ce91e82657a62e4acc8c314af8fda264ed9711",
"c247767c3723f04ce67387ffe1d833e8e1c17a52befdb8ceced446de1e3c9be8",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>e<KEY>14a3<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"30eb29428ce5def458c6fe26151a5e14033bb0634ac6e425be2a7d9bcea0289a",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"bebd1ef08c50ddff26ca80ce7ed55742da488ee85103e42e7a377debb82f266a",
"dad6a14dbb1662e762ad9c3748edd572be79820fee72d90439e262e16d8a390f",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>",
"<KEY>"
] | true | ledger.specs.fixtures ?= {}
_.extend ledger.specs.fixtures,
dongle1_blocks:
blockTx1:
"hash": "000000000000000006c18384552d198dc53dcdd63964d9887693f684ca0aeeb6",
"previous_block_hash": "00000000000000000efa2551c14534c385ed1af3edffc8f276f13c0ddd0b5afe",
"height": 330760,
"confirmations": 31878,
"version": 2,
"merkle_root": "PI:KEY:<KEY>END_PI",
"time": "2014-11-19T20:38:15.000Z",
"nonce": 2609822097,
"difficulty": 40300030327.8914,
"bits": "181b4861",
"transaction_hashes": [
"141cfa11f5e6c8633230986559173ab47b2744407dd7f74c01f8c007bb65fba5",
"3f59869d1f798c1ec29270c00ef3d7feea5d1a2a54b009f416335d7701469a2e",
"ef3e27162e370d3cb4ad5941ba592476c9ab99acb11c6c236PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PIdbPI:KEY:<KEY>END_PI0d8cea0b7e1ed70ed9ce36e288a3902c274be6f19ad3987",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"980beabe3987dPI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI2PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"e089bed6f05559e82eb26bPI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PIdPI:KEY:<KEY>END_PI890693ac3ece32acecc52",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI4PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"138477PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"3d6a876828c201f48e0f093404ce91e82657a62e4acc8c314af8fda264ed9711",
"c247767c3723f04ce67387ffe1d833e8e1c17a52befdb8ceced446de1e3c9be8",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PIePI:KEY:<KEY>END_PI14a3PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"30eb29428ce5def458c6fe26151a5e14033bb0634ac6e425be2a7d9bcea0289a",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"bebd1ef08c50ddff26ca80ce7ed55742da488ee85103e42e7a377debb82f266a",
"dad6a14dbb1662e762ad9c3748edd572be79820fee72d90439e262e16d8a390f",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI",
"PI:KEY:<KEY>END_PI"
] |
[
{
"context": "rt: { name: 1 }} )\n test.equal mutants[0].name, \"Professor Xavier\"\n\nTinytest.add 'all - descending sort', (test) ->",
"end": 1353,
"score": 0.9936054944992065,
"start": 1337,
"tag": "NAME",
"value": "Professor Xavier"
},
{
"context": "ame: 1 }})\n test.equal muta... | tests/tests.coffee | peterclark/tinymodel | 1 | # Relationships
Tinytest.add 'has a - mutant has a team', (test) ->
test.equal wolverine.team()._id, xmen._id
Tinytest.add 'has a - team has a leader', (test) ->
test.equal xmen.leader()._id, xavier._id
Tinytest.add 'has many - team has many mutants', (test) ->
xmen_mutant_ids = (mutant._id for mutant in xmen.mutants())
mutant_ids = (mutant._id for mutant in [xavier, wolverine, storm])
test.equal xmen_mutant_ids, mutant_ids
Tinytest.add 'has an_embedded - team has an embedded headquarter', (test) ->
test.equal xmen.headquarter.name, xmansion.name
Tinytest.add 'has many_embedded - team has many embedded vehicles', (test) ->
xmen_vehicle_names = (vehicle.name for vehicle in xmen.vehicles)
vehicle_names = (vehicle.name for vehicle in [blackbird, aston])
test.equal xmen_vehicle_names, vehicle_names
# all
Tinytest.add 'all - returns an array', (test) ->
mutants = Mutant.all()
test.instanceOf mutants, Array
Tinytest.add 'all - returns array of Mutants', (test) ->
mutants = Mutant.all()
test.instanceOf mutants[0], Mutant
Tinytest.add 'all (with query) - returns subset', (test) ->
mutants = Mutant.all( name: /to/ )
test.length mutants, 1
# all with options
Tinytest.add 'all - ascending sort', (test) ->
mutants = Mutant.all( {}, { sort: { name: 1 }} )
test.equal mutants[0].name, "Professor Xavier"
Tinytest.add 'all - descending sort', (test) ->
mutants = Mutant.all( {}, { sort: { name: -1 }} )
test.equal mutants[0].name, "Wolverine"
# find
Tinytest.add 'find - returns a cursor', (test) ->
mutants = Mutant.find( {} )
test.equal mutants._cursorDescription.collectionName, 'mutants'
Tinytest.add 'find - returns all', (test) ->
mutants = Mutant.find( {} )
test.equal mutants.fetch().length, 3
Tinytest.add 'find - returns subset', (test) ->
mutants = Mutant.find( name: /Xa/ )
test.equal mutants.fetch().length, 1
Tinytest.add 'find - transforms to Mutant', (test) ->
mutants = Mutant.find( {} )
test.instanceOf mutants.fetch()[0], Mutant
# find with options
Tinytest.add 'find - ascending sort', (test) ->
mutants = Mutant.find( {}, { sort: { name: 1 }})
test.equal mutants.fetch()[0].name, "Professor Xavier"
Tinytest.add 'find - descending sort', (test) ->
mutants = Mutant.find( {}, { sort: { name: -1 }})
test.equal mutants.fetch()[0].name, "Wolverine"
# insert
Tinytest.add 'insert - sets name', (test) ->
test.equal storm.name, 'Storm'
Tinytest.add 'insert - adds createdAt', (test) ->
test.instanceOf storm.createdAt, Date
Tinytest.add 'insert - adds updatedAt', (test) ->
test.instanceOf storm.updatedAt, Date
Tinytest.add 'insert - is valid', (test) ->
test.isTrue storm.isValid()
Tinytest.add 'insert - returns a Mutant', (test) ->
test.instanceOf storm, Mutant
Tinytest.add 'insert - assigns an id', (test) ->
test.isNotNull storm._id
test.notEqual storm._id, undefined
test.length storm._id, 17
Tinytest.add 'insert - has no errors', (test) ->
test.isFalse storm.hasErrors()
Tinytest.add 'insert - has no error messages', (test) ->
test.length storm.errorMessages(), 0
Tinytest.add 'insert (invalid) - is invalid', (test) ->
bo = Mutant.insert name: 'Bo'
test.isFalse bo.isValid()
Tinytest.add 'insert (invalid) - does not insert', (test) ->
bo = Mutant.insert name: 'Bo'
test.isUndefined Mutant.findOne(name: 'Bo')
Tinytest.add 'insert (invalid) - does not assign an id', (test) ->
bo = Mutant.insert name: 'Bo'
test.equal bo._id, undefined
Tinytest.add 'insert (invalid) - returns a Mutant', (test) ->
bo = Mutant.insert name: 'Bo'
test.instanceOf bo, Mutant
Tinytest.add 'insert (invalid) - has errors', (test) ->
bo = Mutant.insert name: 'Bo'
test.isTrue bo.hasErrors()
Tinytest.add 'insert (invalid) - has 1 error message', (test) ->
bo = Mutant.insert name: 'Bo'
test.equal bo.errorMessages(), "length of name must be between 5 and 50, gender is invalid"
# findOne
Tinytest.add 'findOne - returns a Mutant', (test) ->
mutant = Mutant.findOne()
test.instanceOf mutant, Mutant
Tinytest.add 'findOne (not found) - returns undefined', (test) ->
mutant = Mutant.findOne( name: 'Larry' )
test.isUndefined mutant
# count
Tinytest.add 'count - returns count', (test) ->
count = Mutant.count()
test.equal count, 3
Tinytest.add 'count (with query) - returns count', (test) ->
count = Mutant.count( name: /to/ )
test.equal count, 1
# toString
Tinytest.add 'toString - returns the collection name', (test) ->
name = Mutant.toString()
test.equal name, 'mutants'
# clone
Tinytest.add 'clone - returns a clone of Mutant', (test) ->
copy = Mutant.clone( storm )
test.equal copy.name, storm.name
test.equal copy.createdAt, storm.createdAt
test.equal copy.updatedAt, storm.updatedAt
Tinytest.add 'clone - is not persisted', (test) ->
copy = Mutant.clone( storm )
test.isUndefined copy._id
test.isFalse copy.persisted()
# remove
Tinytest.add 'remove - destroys the Mutant', (test) ->
mutant = Mutant.insert( name: 'Magento', gender: 'male' )
test.isTrue mutant.persisted()
Mutant.remove( name: 'Magneto' )
test.isUndefined Mutant.findOne( name: 'Magneto' )
# model.insert
Tinytest.add 'model.insert - inserts a Mutant', (test) ->
colossus = new Mutant( name: 'Colossus', gender: 'male' )
colossus.insert()
mutant = Mutant.findOne( name: 'Colossus' )
test.equal mutant.name, colossus.name
test.matches mutant._id, /\S{17,}/
test.instanceOf mutant.createdAt, Date
test.instanceOf mutant.updatedAt, Date
Tinytest.add 'model.insert (invalid) - returns false', (test) ->
mutant = new Mutant( name: '' )
id = mutant.insert()
test.isFalse id
Tinytest.add 'model.insert (invalid) - does not set timestamps', (test) ->
mutant = new Mutant( name: '' )
mutant.insert()
test.isUndefined mutant.createdAt
test.isUndefined mutant.updatedAt
Tinytest.add 'model.insert (persisted) - updates document', (test) ->
mutant = new Mutant( name: 'NightCrawler', gender: 'male' )
id = mutant.insert()
mutant.name = 'Gambit'
mutant.insert()
test.equal Mutant.findOne( _id: id ).name, 'Gambit'
Tinytest.add 'model.insert (persisted, invalid) - fails', (test) ->
mutant = new Mutant( name: 'Cyclops', gender: 'male' )
id = mutant.insert()
mutant.name = ''
test.isFalse mutant.insert()
test.equal Mutant.findOne( _id: id ).name, 'Cyclops'
# model.update
Tinytest.add 'model.update (not persisted) - return false', (test) ->
gambit = new Mutant
gambit.name = 'Gambit'
test.isFalse gambit.update()
Tinytest.add 'model.update (persisted, invalid) - returns false', (test) ->
rogue = Mutant.insert( name: 'Rogue', gender: 'female' )
rogue.name = ''
test.isFalse rogue.update()
Tinytest.add 'model.update (persisted, valid) - updates document', (test) ->
ragnar = Mutant.insert( name: 'Ragnar', gender: 'male' )
ragnar.name = 'Clown'
ragnar.update()
test.equal Mutant.findOne( _id: ragnar._id ).name, 'Clown'
# model.remove
Tinytest.add 'model.remove (persisted) - removes the document', (test) ->
spiderman = Mutant.insert( name: 'Spiderman', gender: 'male' )
result = spiderman.remove()
test.isUndefined Mutant.findOne( _id: spiderman._id )
test.equal result, 1
Tinytest.add 'model.remove (not persisted) - returns false', (test) ->
mutant = new Mutant( name: 'Robert' )
test.isFalse mutant.remove()
# model.persisted
Tinytest.add 'persisted - returns true', (test) ->
mutant = Mutant.findOne()
test.isTrue mutant.persisted()
Tinytest.add 'persisted (new) - returns false', (test) ->
mutant = new Mutant( name: 'Alexander' )
test.isFalse mutant.persisted()
# model.isValid
Tinytest.add 'isValid (valid) - returns true', (test) ->
mutant = new Mutant( name: 'Tobias', gender: 'male' )
test.isTrue mutant.isValid()
Tinytest.add 'isValid (invalid) - returns false', (test) ->
mutant = new Mutant( name: 'Z' )
test.isFalse mutant.isValid()
# model.attributes
Tinytest.add 'attributes - returns attributes', (test) ->
mutant = Mutant.findOne( name: 'Wolverine' )
test.equal mutant.attributes().name, 'Wolverine'
test.equal mutant.attributes().gender, 'male'
# model.hasErrors
Tinytest.add 'hasErrors (invalid) - returns true', (test) ->
mutant = new Mutant
mutant.isValid()
test.isTrue mutant.hasErrors()
Tinytest.add 'hasErrors (valid) - returns false', (test) ->
mutant = new Mutant( name: 'George', gender: 'male' )
test.isFalse mutant.hasErrors()
# model.errorMessages
Tinytest.add 'errorMessages (invalid) - returns error', (test) ->
mutant = new Mutant
mutant.isValid()
test.equal mutant.errorMessages(), 'name is missing, length of name must be between 5 and 50, gender is invalid'
Tinytest.add 'errorMessages (valid) - returns empty string', (test) ->
mutant = new Mutant( name: 'Gregory', gender: 'female' )
mutant.isValid()
test.equal mutant.errorMessages(), ''
| 23611 | # Relationships
Tinytest.add 'has a - mutant has a team', (test) ->
test.equal wolverine.team()._id, xmen._id
Tinytest.add 'has a - team has a leader', (test) ->
test.equal xmen.leader()._id, xavier._id
Tinytest.add 'has many - team has many mutants', (test) ->
xmen_mutant_ids = (mutant._id for mutant in xmen.mutants())
mutant_ids = (mutant._id for mutant in [xavier, wolverine, storm])
test.equal xmen_mutant_ids, mutant_ids
Tinytest.add 'has an_embedded - team has an embedded headquarter', (test) ->
test.equal xmen.headquarter.name, xmansion.name
Tinytest.add 'has many_embedded - team has many embedded vehicles', (test) ->
xmen_vehicle_names = (vehicle.name for vehicle in xmen.vehicles)
vehicle_names = (vehicle.name for vehicle in [blackbird, aston])
test.equal xmen_vehicle_names, vehicle_names
# all
Tinytest.add 'all - returns an array', (test) ->
mutants = Mutant.all()
test.instanceOf mutants, Array
Tinytest.add 'all - returns array of Mutants', (test) ->
mutants = Mutant.all()
test.instanceOf mutants[0], Mutant
Tinytest.add 'all (with query) - returns subset', (test) ->
mutants = Mutant.all( name: /to/ )
test.length mutants, 1
# all with options
Tinytest.add 'all - ascending sort', (test) ->
mutants = Mutant.all( {}, { sort: { name: 1 }} )
test.equal mutants[0].name, "<NAME>"
Tinytest.add 'all - descending sort', (test) ->
mutants = Mutant.all( {}, { sort: { name: -1 }} )
test.equal mutants[0].name, "Wolverine"
# find
Tinytest.add 'find - returns a cursor', (test) ->
mutants = Mutant.find( {} )
test.equal mutants._cursorDescription.collectionName, 'mutants'
Tinytest.add 'find - returns all', (test) ->
mutants = Mutant.find( {} )
test.equal mutants.fetch().length, 3
Tinytest.add 'find - returns subset', (test) ->
mutants = Mutant.find( name: /Xa/ )
test.equal mutants.fetch().length, 1
Tinytest.add 'find - transforms to Mutant', (test) ->
mutants = Mutant.find( {} )
test.instanceOf mutants.fetch()[0], Mutant
# find with options
Tinytest.add 'find - ascending sort', (test) ->
mutants = Mutant.find( {}, { sort: { name: 1 }})
test.equal mutants.fetch()[0].name, "<NAME>"
Tinytest.add 'find - descending sort', (test) ->
mutants = Mutant.find( {}, { sort: { name: -1 }})
test.equal mutants.fetch()[0].name, "<NAME>"
# insert
Tinytest.add 'insert - sets name', (test) ->
test.equal storm.name, 'Storm'
Tinytest.add 'insert - adds createdAt', (test) ->
test.instanceOf storm.createdAt, Date
Tinytest.add 'insert - adds updatedAt', (test) ->
test.instanceOf storm.updatedAt, Date
Tinytest.add 'insert - is valid', (test) ->
test.isTrue storm.isValid()
Tinytest.add 'insert - returns a Mutant', (test) ->
test.instanceOf storm, Mutant
Tinytest.add 'insert - assigns an id', (test) ->
test.isNotNull storm._id
test.notEqual storm._id, undefined
test.length storm._id, 17
Tinytest.add 'insert - has no errors', (test) ->
test.isFalse storm.hasErrors()
Tinytest.add 'insert - has no error messages', (test) ->
test.length storm.errorMessages(), 0
Tinytest.add 'insert (invalid) - is invalid', (test) ->
bo = Mutant.insert name: '<NAME>'
test.isFalse bo.isValid()
Tinytest.add 'insert (invalid) - does not insert', (test) ->
bo = Mutant.insert name: '<NAME>'
test.isUndefined Mutant.findOne(name: 'Bo')
Tinytest.add 'insert (invalid) - does not assign an id', (test) ->
bo = Mutant.insert name: '<NAME>'
test.equal bo._id, undefined
Tinytest.add 'insert (invalid) - returns a Mutant', (test) ->
bo = Mutant.insert name: '<NAME>'
test.instanceOf bo, Mutant
Tinytest.add 'insert (invalid) - has errors', (test) ->
bo = Mutant.insert name: '<NAME>'
test.isTrue bo.hasErrors()
Tinytest.add 'insert (invalid) - has 1 error message', (test) ->
bo = Mutant.insert name: '<NAME>'
test.equal bo.errorMessages(), "length of name must be between 5 and 50, gender is invalid"
# findOne
Tinytest.add 'findOne - returns a Mutant', (test) ->
mutant = Mutant.findOne()
test.instanceOf mutant, Mutant
Tinytest.add 'findOne (not found) - returns undefined', (test) ->
mutant = Mutant.findOne( name: '<NAME>' )
test.isUndefined mutant
# count
Tinytest.add 'count - returns count', (test) ->
count = Mutant.count()
test.equal count, 3
Tinytest.add 'count (with query) - returns count', (test) ->
count = Mutant.count( name: /to/ )
test.equal count, 1
# toString
Tinytest.add 'toString - returns the collection name', (test) ->
name = Mutant.toString()
test.equal name, 'mutants'
# clone
Tinytest.add 'clone - returns a clone of Mutant', (test) ->
copy = Mutant.clone( storm )
test.equal copy.name, storm.name
test.equal copy.createdAt, storm.createdAt
test.equal copy.updatedAt, storm.updatedAt
Tinytest.add 'clone - is not persisted', (test) ->
copy = Mutant.clone( storm )
test.isUndefined copy._id
test.isFalse copy.persisted()
# remove
Tinytest.add 'remove - destroys the Mutant', (test) ->
mutant = Mutant.insert( name: '<NAME>', gender: 'male' )
test.isTrue mutant.persisted()
Mutant.remove( name: '<NAME>' )
test.isUndefined Mutant.findOne( name: '<NAME>' )
# model.insert
Tinytest.add 'model.insert - inserts a Mutant', (test) ->
colossus = new Mutant( name: '<NAME>', gender: 'male' )
colossus.insert()
mutant = Mutant.findOne( name: '<NAME>' )
test.equal mutant.name, colossus.name
test.matches mutant._id, /\S{17,}/
test.instanceOf mutant.createdAt, Date
test.instanceOf mutant.updatedAt, Date
Tinytest.add 'model.insert (invalid) - returns false', (test) ->
mutant = new Mutant( name: '' )
id = mutant.insert()
test.isFalse id
Tinytest.add 'model.insert (invalid) - does not set timestamps', (test) ->
mutant = new Mutant( name: '' )
mutant.insert()
test.isUndefined mutant.createdAt
test.isUndefined mutant.updatedAt
Tinytest.add 'model.insert (persisted) - updates document', (test) ->
mutant = new Mutant( name: '<NAME>', gender: 'male' )
id = mutant.insert()
mutant.name = '<NAME>'
mutant.insert()
test.equal Mutant.findOne( _id: id ).name, '<NAME>'
Tinytest.add 'model.insert (persisted, invalid) - fails', (test) ->
mutant = new Mutant( name: '<NAME>', gender: 'male' )
id = mutant.insert()
mutant.name = ''
test.isFalse mutant.insert()
test.equal Mutant.findOne( _id: id ).name, '<NAME>'
# model.update
Tinytest.add 'model.update (not persisted) - return false', (test) ->
gambit = new Mutant
gambit.name = '<NAME>'
test.isFalse gambit.update()
Tinytest.add 'model.update (persisted, invalid) - returns false', (test) ->
rogue = Mutant.insert( name: '<NAME>', gender: 'female' )
rogue.name = ''
test.isFalse rogue.update()
Tinytest.add 'model.update (persisted, valid) - updates document', (test) ->
ragnar = Mutant.insert( name: '<NAME>', gender: 'male' )
ragnar.name = '<NAME>'
ragnar.update()
test.equal Mutant.findOne( _id: ragnar._id ).name, '<NAME>'
# model.remove
Tinytest.add 'model.remove (persisted) - removes the document', (test) ->
spiderman = Mutant.insert( name: '<NAME>', gender: 'male' )
result = spiderman.remove()
test.isUndefined Mutant.findOne( _id: spiderman._id )
test.equal result, 1
Tinytest.add 'model.remove (not persisted) - returns false', (test) ->
mutant = new Mutant( name: '<NAME>' )
test.isFalse mutant.remove()
# model.persisted
Tinytest.add 'persisted - returns true', (test) ->
mutant = Mutant.findOne()
test.isTrue mutant.persisted()
Tinytest.add 'persisted (new) - returns false', (test) ->
mutant = new Mutant( name: '<NAME>' )
test.isFalse mutant.persisted()
# model.isValid
Tinytest.add 'isValid (valid) - returns true', (test) ->
mutant = new Mutant( name: '<NAME>', gender: 'male' )
test.isTrue mutant.isValid()
Tinytest.add 'isValid (invalid) - returns false', (test) ->
mutant = new Mutant( name: '<NAME>' )
test.isFalse mutant.isValid()
# model.attributes
Tinytest.add 'attributes - returns attributes', (test) ->
mutant = Mutant.findOne( name: '<NAME>' )
test.equal mutant.attributes().name, '<NAME>'
test.equal mutant.attributes().gender, 'male'
# model.hasErrors
Tinytest.add 'hasErrors (invalid) - returns true', (test) ->
mutant = new Mutant
mutant.isValid()
test.isTrue mutant.hasErrors()
Tinytest.add 'hasErrors (valid) - returns false', (test) ->
mutant = new Mutant( name: '<NAME>', gender: 'male' )
test.isFalse mutant.hasErrors()
# model.errorMessages
Tinytest.add 'errorMessages (invalid) - returns error', (test) ->
mutant = new Mutant
mutant.isValid()
test.equal mutant.errorMessages(), 'name is missing, length of name must be between 5 and 50, gender is invalid'
Tinytest.add 'errorMessages (valid) - returns empty string', (test) ->
mutant = new Mutant( name: '<NAME>', gender: 'female' )
mutant.isValid()
test.equal mutant.errorMessages(), ''
| true | # Relationships
Tinytest.add 'has a - mutant has a team', (test) ->
test.equal wolverine.team()._id, xmen._id
Tinytest.add 'has a - team has a leader', (test) ->
test.equal xmen.leader()._id, xavier._id
Tinytest.add 'has many - team has many mutants', (test) ->
xmen_mutant_ids = (mutant._id for mutant in xmen.mutants())
mutant_ids = (mutant._id for mutant in [xavier, wolverine, storm])
test.equal xmen_mutant_ids, mutant_ids
Tinytest.add 'has an_embedded - team has an embedded headquarter', (test) ->
test.equal xmen.headquarter.name, xmansion.name
Tinytest.add 'has many_embedded - team has many embedded vehicles', (test) ->
xmen_vehicle_names = (vehicle.name for vehicle in xmen.vehicles)
vehicle_names = (vehicle.name for vehicle in [blackbird, aston])
test.equal xmen_vehicle_names, vehicle_names
# all
Tinytest.add 'all - returns an array', (test) ->
mutants = Mutant.all()
test.instanceOf mutants, Array
Tinytest.add 'all - returns array of Mutants', (test) ->
mutants = Mutant.all()
test.instanceOf mutants[0], Mutant
Tinytest.add 'all (with query) - returns subset', (test) ->
mutants = Mutant.all( name: /to/ )
test.length mutants, 1
# all with options
Tinytest.add 'all - ascending sort', (test) ->
mutants = Mutant.all( {}, { sort: { name: 1 }} )
test.equal mutants[0].name, "PI:NAME:<NAME>END_PI"
Tinytest.add 'all - descending sort', (test) ->
mutants = Mutant.all( {}, { sort: { name: -1 }} )
test.equal mutants[0].name, "Wolverine"
# find
Tinytest.add 'find - returns a cursor', (test) ->
mutants = Mutant.find( {} )
test.equal mutants._cursorDescription.collectionName, 'mutants'
Tinytest.add 'find - returns all', (test) ->
mutants = Mutant.find( {} )
test.equal mutants.fetch().length, 3
Tinytest.add 'find - returns subset', (test) ->
mutants = Mutant.find( name: /Xa/ )
test.equal mutants.fetch().length, 1
Tinytest.add 'find - transforms to Mutant', (test) ->
mutants = Mutant.find( {} )
test.instanceOf mutants.fetch()[0], Mutant
# find with options
Tinytest.add 'find - ascending sort', (test) ->
mutants = Mutant.find( {}, { sort: { name: 1 }})
test.equal mutants.fetch()[0].name, "PI:NAME:<NAME>END_PI"
Tinytest.add 'find - descending sort', (test) ->
mutants = Mutant.find( {}, { sort: { name: -1 }})
test.equal mutants.fetch()[0].name, "PI:NAME:<NAME>END_PI"
# insert
Tinytest.add 'insert - sets name', (test) ->
test.equal storm.name, 'Storm'
Tinytest.add 'insert - adds createdAt', (test) ->
test.instanceOf storm.createdAt, Date
Tinytest.add 'insert - adds updatedAt', (test) ->
test.instanceOf storm.updatedAt, Date
Tinytest.add 'insert - is valid', (test) ->
test.isTrue storm.isValid()
Tinytest.add 'insert - returns a Mutant', (test) ->
test.instanceOf storm, Mutant
Tinytest.add 'insert - assigns an id', (test) ->
test.isNotNull storm._id
test.notEqual storm._id, undefined
test.length storm._id, 17
Tinytest.add 'insert - has no errors', (test) ->
test.isFalse storm.hasErrors()
Tinytest.add 'insert - has no error messages', (test) ->
test.length storm.errorMessages(), 0
Tinytest.add 'insert (invalid) - is invalid', (test) ->
bo = Mutant.insert name: 'PI:NAME:<NAME>END_PI'
test.isFalse bo.isValid()
Tinytest.add 'insert (invalid) - does not insert', (test) ->
bo = Mutant.insert name: 'PI:NAME:<NAME>END_PI'
test.isUndefined Mutant.findOne(name: 'Bo')
Tinytest.add 'insert (invalid) - does not assign an id', (test) ->
bo = Mutant.insert name: 'PI:NAME:<NAME>END_PI'
test.equal bo._id, undefined
Tinytest.add 'insert (invalid) - returns a Mutant', (test) ->
bo = Mutant.insert name: 'PI:NAME:<NAME>END_PI'
test.instanceOf bo, Mutant
Tinytest.add 'insert (invalid) - has errors', (test) ->
bo = Mutant.insert name: 'PI:NAME:<NAME>END_PI'
test.isTrue bo.hasErrors()
Tinytest.add 'insert (invalid) - has 1 error message', (test) ->
bo = Mutant.insert name: 'PI:NAME:<NAME>END_PI'
test.equal bo.errorMessages(), "length of name must be between 5 and 50, gender is invalid"
# findOne
Tinytest.add 'findOne - returns a Mutant', (test) ->
mutant = Mutant.findOne()
test.instanceOf mutant, Mutant
Tinytest.add 'findOne (not found) - returns undefined', (test) ->
mutant = Mutant.findOne( name: 'PI:NAME:<NAME>END_PI' )
test.isUndefined mutant
# count
Tinytest.add 'count - returns count', (test) ->
count = Mutant.count()
test.equal count, 3
Tinytest.add 'count (with query) - returns count', (test) ->
count = Mutant.count( name: /to/ )
test.equal count, 1
# toString
Tinytest.add 'toString - returns the collection name', (test) ->
name = Mutant.toString()
test.equal name, 'mutants'
# clone
Tinytest.add 'clone - returns a clone of Mutant', (test) ->
copy = Mutant.clone( storm )
test.equal copy.name, storm.name
test.equal copy.createdAt, storm.createdAt
test.equal copy.updatedAt, storm.updatedAt
Tinytest.add 'clone - is not persisted', (test) ->
copy = Mutant.clone( storm )
test.isUndefined copy._id
test.isFalse copy.persisted()
# remove
Tinytest.add 'remove - destroys the Mutant', (test) ->
mutant = Mutant.insert( name: 'PI:NAME:<NAME>END_PI', gender: 'male' )
test.isTrue mutant.persisted()
Mutant.remove( name: 'PI:NAME:<NAME>END_PI' )
test.isUndefined Mutant.findOne( name: 'PI:NAME:<NAME>END_PI' )
# model.insert
Tinytest.add 'model.insert - inserts a Mutant', (test) ->
colossus = new Mutant( name: 'PI:NAME:<NAME>END_PI', gender: 'male' )
colossus.insert()
mutant = Mutant.findOne( name: 'PI:NAME:<NAME>END_PI' )
test.equal mutant.name, colossus.name
test.matches mutant._id, /\S{17,}/
test.instanceOf mutant.createdAt, Date
test.instanceOf mutant.updatedAt, Date
Tinytest.add 'model.insert (invalid) - returns false', (test) ->
mutant = new Mutant( name: '' )
id = mutant.insert()
test.isFalse id
Tinytest.add 'model.insert (invalid) - does not set timestamps', (test) ->
mutant = new Mutant( name: '' )
mutant.insert()
test.isUndefined mutant.createdAt
test.isUndefined mutant.updatedAt
Tinytest.add 'model.insert (persisted) - updates document', (test) ->
mutant = new Mutant( name: 'PI:NAME:<NAME>END_PI', gender: 'male' )
id = mutant.insert()
mutant.name = 'PI:NAME:<NAME>END_PI'
mutant.insert()
test.equal Mutant.findOne( _id: id ).name, 'PI:NAME:<NAME>END_PI'
Tinytest.add 'model.insert (persisted, invalid) - fails', (test) ->
mutant = new Mutant( name: 'PI:NAME:<NAME>END_PI', gender: 'male' )
id = mutant.insert()
mutant.name = ''
test.isFalse mutant.insert()
test.equal Mutant.findOne( _id: id ).name, 'PI:NAME:<NAME>END_PI'
# model.update
Tinytest.add 'model.update (not persisted) - return false', (test) ->
gambit = new Mutant
gambit.name = 'PI:NAME:<NAME>END_PI'
test.isFalse gambit.update()
Tinytest.add 'model.update (persisted, invalid) - returns false', (test) ->
rogue = Mutant.insert( name: 'PI:NAME:<NAME>END_PI', gender: 'female' )
rogue.name = ''
test.isFalse rogue.update()
Tinytest.add 'model.update (persisted, valid) - updates document', (test) ->
ragnar = Mutant.insert( name: 'PI:NAME:<NAME>END_PI', gender: 'male' )
ragnar.name = 'PI:NAME:<NAME>END_PI'
ragnar.update()
test.equal Mutant.findOne( _id: ragnar._id ).name, 'PI:NAME:<NAME>END_PI'
# model.remove
Tinytest.add 'model.remove (persisted) - removes the document', (test) ->
spiderman = Mutant.insert( name: 'PI:NAME:<NAME>END_PI', gender: 'male' )
result = spiderman.remove()
test.isUndefined Mutant.findOne( _id: spiderman._id )
test.equal result, 1
Tinytest.add 'model.remove (not persisted) - returns false', (test) ->
mutant = new Mutant( name: 'PI:NAME:<NAME>END_PI' )
test.isFalse mutant.remove()
# model.persisted
Tinytest.add 'persisted - returns true', (test) ->
mutant = Mutant.findOne()
test.isTrue mutant.persisted()
Tinytest.add 'persisted (new) - returns false', (test) ->
mutant = new Mutant( name: 'PI:NAME:<NAME>END_PI' )
test.isFalse mutant.persisted()
# model.isValid
Tinytest.add 'isValid (valid) - returns true', (test) ->
mutant = new Mutant( name: 'PI:NAME:<NAME>END_PI', gender: 'male' )
test.isTrue mutant.isValid()
Tinytest.add 'isValid (invalid) - returns false', (test) ->
mutant = new Mutant( name: 'PI:NAME:<NAME>END_PI' )
test.isFalse mutant.isValid()
# model.attributes
Tinytest.add 'attributes - returns attributes', (test) ->
mutant = Mutant.findOne( name: 'PI:NAME:<NAME>END_PI' )
test.equal mutant.attributes().name, 'PI:NAME:<NAME>END_PI'
test.equal mutant.attributes().gender, 'male'
# model.hasErrors
Tinytest.add 'hasErrors (invalid) - returns true', (test) ->
mutant = new Mutant
mutant.isValid()
test.isTrue mutant.hasErrors()
Tinytest.add 'hasErrors (valid) - returns false', (test) ->
mutant = new Mutant( name: 'PI:NAME:<NAME>END_PI', gender: 'male' )
test.isFalse mutant.hasErrors()
# model.errorMessages
Tinytest.add 'errorMessages (invalid) - returns error', (test) ->
mutant = new Mutant
mutant.isValid()
test.equal mutant.errorMessages(), 'name is missing, length of name must be between 5 and 50, gender is invalid'
Tinytest.add 'errorMessages (valid) - returns empty string', (test) ->
mutant = new Mutant( name: 'PI:NAME:<NAME>END_PI', gender: 'female' )
mutant.isValid()
test.equal mutant.errorMessages(), ''
|
[
{
"context": "/lib/mongorito'\n\nMongorito.connect 'mongorito', ['127.0.0.1:27017']\nMongorito.cache ['127.0.0.1:11211']\n\nrequ",
"end": 82,
"score": 0.9997084140777588,
"start": 73,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
},
{
"context": "mongorito', ['127.0.0.1:27017']\nMongorit... | tests/mongorito.test.coffee | tj/mongorito | 3 | Mongorito = require '../lib/mongorito'
Mongorito.connect 'mongorito', ['127.0.0.1:27017']
Mongorito.cache ['127.0.0.1:11211']
require 'should'
class Post
constructor: ->
super 'posts'
Post = Mongorito.bake Post
describe 'Mongorito', ->
describe 'creating new record', ->
it 'should create new record in "posts" collection', (done) ->
post = new Post
post.title = 'Very nice post!'
post.author = 'Vadim'
post.save ->
Post.find (err, posts) ->
posts.length.should.equal 1
do done
describe 'editing record', ->
it 'should save edited version of the post', (done) ->
Post.find (err, posts) ->
post = posts[0]
post.title = 'Edited title!'
post.save ->
do done
describe 'getting record', ->
it 'should fetch just edited post', (done) ->
Post.find (err, posts) ->
posts[0].title.should.equal 'Edited title!'
do done
describe 'deleting record', ->
it 'should remove post', (done) ->
Post.find (err, posts) ->
posts[0].remove ->
Post.find (err, posts) ->
posts.length.should.equal 0
do done | 23623 | Mongorito = require '../lib/mongorito'
Mongorito.connect 'mongorito', ['127.0.0.1:27017']
Mongorito.cache ['127.0.0.1:11211']
require 'should'
class Post
constructor: ->
super 'posts'
Post = Mongorito.bake Post
describe 'Mongorito', ->
describe 'creating new record', ->
it 'should create new record in "posts" collection', (done) ->
post = new Post
post.title = 'Very nice post!'
post.author = '<NAME>'
post.save ->
Post.find (err, posts) ->
posts.length.should.equal 1
do done
describe 'editing record', ->
it 'should save edited version of the post', (done) ->
Post.find (err, posts) ->
post = posts[0]
post.title = 'Edited title!'
post.save ->
do done
describe 'getting record', ->
it 'should fetch just edited post', (done) ->
Post.find (err, posts) ->
posts[0].title.should.equal 'Edited title!'
do done
describe 'deleting record', ->
it 'should remove post', (done) ->
Post.find (err, posts) ->
posts[0].remove ->
Post.find (err, posts) ->
posts.length.should.equal 0
do done | true | Mongorito = require '../lib/mongorito'
Mongorito.connect 'mongorito', ['127.0.0.1:27017']
Mongorito.cache ['127.0.0.1:11211']
require 'should'
class Post
constructor: ->
super 'posts'
Post = Mongorito.bake Post
describe 'Mongorito', ->
describe 'creating new record', ->
it 'should create new record in "posts" collection', (done) ->
post = new Post
post.title = 'Very nice post!'
post.author = 'PI:NAME:<NAME>END_PI'
post.save ->
Post.find (err, posts) ->
posts.length.should.equal 1
do done
describe 'editing record', ->
it 'should save edited version of the post', (done) ->
Post.find (err, posts) ->
post = posts[0]
post.title = 'Edited title!'
post.save ->
do done
describe 'getting record', ->
it 'should fetch just edited post', (done) ->
Post.find (err, posts) ->
posts[0].title.should.equal 'Edited title!'
do done
describe 'deleting record', ->
it 'should remove post', (done) ->
Post.find (err, posts) ->
posts[0].remove ->
Post.find (err, posts) ->
posts.length.should.equal 0
do done |
[
{
"context": " type: 'NONE'\n text_key: 'resource.type.none.label'\n unit: ResourceUnit.UNITS.NONE\n APP",
"end": 194,
"score": 0.7171162366867065,
"start": 194,
"tag": "KEY",
"value": ""
}
] | plugins/starpeace-client/industry/resource-type.coffee | Eric1212/starpeace-website-client | 0 |
import ResourceUnit from '~/plugins/starpeace-client/industry/resource-unit.coffee'
export default class ResourceType
@TYPES:
NONE:
type: 'NONE'
text_key: 'resource.type.none.label'
unit: ResourceUnit.UNITS.NONE
APPLIANCE:
type: 'APPLIANCE'
text_key: 'resource.type.appliance.label'
unit: ResourceUnit.UNITS.ITEMS
AUTOMOBILE:
type: 'AUTOMOBILE'
text_key: 'resource.type.automobile.label'
unit: ResourceUnit.UNITS.CARS
BOOK:
type: 'BOOK'
text_key: 'resource.type.book.label'
unit: ResourceUnit.UNITS.ITEMS
CHEMICAL:
type: 'CHEMICAL'
text_key: 'resource.type.chemical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
CLOTHES:
type: 'CLOTHES'
text_key: 'resource.type.clothes.label'
unit: ResourceUnit.UNITS.ITEMS
COAL:
type: 'COAL'
text_key: 'resource.type.coal.label'
unit: ResourceUnit.UNITS.KILOGRAMS
COMPACT_DISC:
type: 'COMPACT_DISC'
text_key: 'resource.type.compact_disc.label'
unit: ResourceUnit.UNITS.ITEMS
COMPUTER:
type: 'COMPUTER'
text_key: 'resource.type.computer.label'
unit: ResourceUnit.UNITS.ITEMS
COMPUTER_SERVICES:
type: 'COMPUTER_SERVICES'
text_key: 'resource.type.computer_services.label'
unit: ResourceUnit.UNITS.HOURS
CONSTRUCTION:
type: 'CONSTRUCTION'
text_key: 'resource.type.construction.label'
unit: ResourceUnit.UNITS.TONS
CRUDE_OIL:
type: 'CRUDE_OIL'
text_key: 'resource.type.crude_oil.label'
unit: ResourceUnit.UNITS.LITER
ELECTRONIC_COMPONENT:
type: 'ELECTRONIC_COMPONENT'
text_key: 'resource.type.electronic_component.label'
unit: ResourceUnit.UNITS.ITEMS
FABRIC:
type: 'FABRIC'
text_key: 'resource.type.fabric.label'
unit: ResourceUnit.UNITS.METERS
FRESH_FOOD:
type: 'FRESH_FOOD'
text_key: 'resource.type.fresh_food.label'
unit: ResourceUnit.UNITS.KILOGRAMS
FURNITURE:
type: 'FURNITURE'
text_key: 'resource.type.furniture.label'
unit: ResourceUnit.UNITS.ITEMS
GASOLINE:
type: 'GASOLINE'
text_key: 'resource.type.gasoline.label'
unit: ResourceUnit.UNITS.LITER
LEGAL_SERVICES:
type: 'LEGAL_SERVICES'
text_key: 'resource.type.legal_services.label'
unit: ResourceUnit.UNITS.HOURS
LIQUOR:
type: 'LIQUOR'
text_key: 'resource.type.liquor.label'
unit: ResourceUnit.UNITS.ITEMS
MACHINERY:
type: 'MACHINERY'
text_key: 'resource.type.machinery.label'
unit: ResourceUnit.UNITS.MACHINES
METAL:
type: 'METAL'
text_key: 'resource.type.metal.label'
unit: ResourceUnit.UNITS.KILOGRAMS
MOVIE:
type: 'MOVIE'
text_key: 'resource.type.movie.label'
unit: ResourceUnit.UNITS.ITEMS
ORE:
type: 'ORE'
text_key: 'resource.type.ore.label'
unit: ResourceUnit.UNITS.KILOGRAMS
ORGANIC_MATERIAL:
type: 'ORGANIC_MATERIAL'
text_key: 'resource.type.organic_material.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PAPER:
type: 'PAPER'
text_key: 'resource.type.paper.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PRINTED_MATERIAL:
type: 'PRINTED_MATERIAL'
text_key: 'resource.type.printed_material.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PHARMACEUTICAL:
type: 'PHARMACEUTICAL'
text_key: 'resource.type.pharmaceutical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PLASTIC:
type: 'PLASTIC'
text_key: 'resource.type.plastic.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PROCESSED_FOOD:
type: 'PROCESSED_FOOD'
text_key: 'resource.type.processed_food.label'
unit: ResourceUnit.UNITS.ITEMS
RAW_CHEMICAL:
type: 'RAW_CHEMICAL'
text_key: 'resource.type.raw_chemical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
SILICON:
type: 'SILICON'
text_key: 'resource.type.silicon.label'
unit: ResourceUnit.UNITS.KILOGRAMS
STONE:
type: 'STONE'
text_key: 'resource.type.stone.label'
unit: ResourceUnit.UNITS.KILOGRAMS
TIMBER:
type: 'TIMBER'
text_key: 'resource.type.timber.label'
unit: ResourceUnit.UNITS.KILOGRAMS
TOY:
type: 'TOY'
text_key: 'resource.type.toy.label'
unit: ResourceUnit.UNITS.ITEMS
| 140688 |
import ResourceUnit from '~/plugins/starpeace-client/industry/resource-unit.coffee'
export default class ResourceType
@TYPES:
NONE:
type: 'NONE'
text_key: 'resource.type.none<KEY>.label'
unit: ResourceUnit.UNITS.NONE
APPLIANCE:
type: 'APPLIANCE'
text_key: 'resource.type.appliance.label'
unit: ResourceUnit.UNITS.ITEMS
AUTOMOBILE:
type: 'AUTOMOBILE'
text_key: 'resource.type.automobile.label'
unit: ResourceUnit.UNITS.CARS
BOOK:
type: 'BOOK'
text_key: 'resource.type.book.label'
unit: ResourceUnit.UNITS.ITEMS
CHEMICAL:
type: 'CHEMICAL'
text_key: 'resource.type.chemical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
CLOTHES:
type: 'CLOTHES'
text_key: 'resource.type.clothes.label'
unit: ResourceUnit.UNITS.ITEMS
COAL:
type: 'COAL'
text_key: 'resource.type.coal.label'
unit: ResourceUnit.UNITS.KILOGRAMS
COMPACT_DISC:
type: 'COMPACT_DISC'
text_key: 'resource.type.compact_disc.label'
unit: ResourceUnit.UNITS.ITEMS
COMPUTER:
type: 'COMPUTER'
text_key: 'resource.type.computer.label'
unit: ResourceUnit.UNITS.ITEMS
COMPUTER_SERVICES:
type: 'COMPUTER_SERVICES'
text_key: 'resource.type.computer_services.label'
unit: ResourceUnit.UNITS.HOURS
CONSTRUCTION:
type: 'CONSTRUCTION'
text_key: 'resource.type.construction.label'
unit: ResourceUnit.UNITS.TONS
CRUDE_OIL:
type: 'CRUDE_OIL'
text_key: 'resource.type.crude_oil.label'
unit: ResourceUnit.UNITS.LITER
ELECTRONIC_COMPONENT:
type: 'ELECTRONIC_COMPONENT'
text_key: 'resource.type.electronic_component.label'
unit: ResourceUnit.UNITS.ITEMS
FABRIC:
type: 'FABRIC'
text_key: 'resource.type.fabric.label'
unit: ResourceUnit.UNITS.METERS
FRESH_FOOD:
type: 'FRESH_FOOD'
text_key: 'resource.type.fresh_food.label'
unit: ResourceUnit.UNITS.KILOGRAMS
FURNITURE:
type: 'FURNITURE'
text_key: 'resource.type.furniture.label'
unit: ResourceUnit.UNITS.ITEMS
GASOLINE:
type: 'GASOLINE'
text_key: 'resource.type.gasoline.label'
unit: ResourceUnit.UNITS.LITER
LEGAL_SERVICES:
type: 'LEGAL_SERVICES'
text_key: 'resource.type.legal_services.label'
unit: ResourceUnit.UNITS.HOURS
LIQUOR:
type: 'LIQUOR'
text_key: 'resource.type.liquor.label'
unit: ResourceUnit.UNITS.ITEMS
MACHINERY:
type: 'MACHINERY'
text_key: 'resource.type.machinery.label'
unit: ResourceUnit.UNITS.MACHINES
METAL:
type: 'METAL'
text_key: 'resource.type.metal.label'
unit: ResourceUnit.UNITS.KILOGRAMS
MOVIE:
type: 'MOVIE'
text_key: 'resource.type.movie.label'
unit: ResourceUnit.UNITS.ITEMS
ORE:
type: 'ORE'
text_key: 'resource.type.ore.label'
unit: ResourceUnit.UNITS.KILOGRAMS
ORGANIC_MATERIAL:
type: 'ORGANIC_MATERIAL'
text_key: 'resource.type.organic_material.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PAPER:
type: 'PAPER'
text_key: 'resource.type.paper.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PRINTED_MATERIAL:
type: 'PRINTED_MATERIAL'
text_key: 'resource.type.printed_material.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PHARMACEUTICAL:
type: 'PHARMACEUTICAL'
text_key: 'resource.type.pharmaceutical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PLASTIC:
type: 'PLASTIC'
text_key: 'resource.type.plastic.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PROCESSED_FOOD:
type: 'PROCESSED_FOOD'
text_key: 'resource.type.processed_food.label'
unit: ResourceUnit.UNITS.ITEMS
RAW_CHEMICAL:
type: 'RAW_CHEMICAL'
text_key: 'resource.type.raw_chemical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
SILICON:
type: 'SILICON'
text_key: 'resource.type.silicon.label'
unit: ResourceUnit.UNITS.KILOGRAMS
STONE:
type: 'STONE'
text_key: 'resource.type.stone.label'
unit: ResourceUnit.UNITS.KILOGRAMS
TIMBER:
type: 'TIMBER'
text_key: 'resource.type.timber.label'
unit: ResourceUnit.UNITS.KILOGRAMS
TOY:
type: 'TOY'
text_key: 'resource.type.toy.label'
unit: ResourceUnit.UNITS.ITEMS
| true |
import ResourceUnit from '~/plugins/starpeace-client/industry/resource-unit.coffee'
export default class ResourceType
@TYPES:
NONE:
type: 'NONE'
text_key: 'resource.type.nonePI:KEY:<KEY>END_PI.label'
unit: ResourceUnit.UNITS.NONE
APPLIANCE:
type: 'APPLIANCE'
text_key: 'resource.type.appliance.label'
unit: ResourceUnit.UNITS.ITEMS
AUTOMOBILE:
type: 'AUTOMOBILE'
text_key: 'resource.type.automobile.label'
unit: ResourceUnit.UNITS.CARS
BOOK:
type: 'BOOK'
text_key: 'resource.type.book.label'
unit: ResourceUnit.UNITS.ITEMS
CHEMICAL:
type: 'CHEMICAL'
text_key: 'resource.type.chemical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
CLOTHES:
type: 'CLOTHES'
text_key: 'resource.type.clothes.label'
unit: ResourceUnit.UNITS.ITEMS
COAL:
type: 'COAL'
text_key: 'resource.type.coal.label'
unit: ResourceUnit.UNITS.KILOGRAMS
COMPACT_DISC:
type: 'COMPACT_DISC'
text_key: 'resource.type.compact_disc.label'
unit: ResourceUnit.UNITS.ITEMS
COMPUTER:
type: 'COMPUTER'
text_key: 'resource.type.computer.label'
unit: ResourceUnit.UNITS.ITEMS
COMPUTER_SERVICES:
type: 'COMPUTER_SERVICES'
text_key: 'resource.type.computer_services.label'
unit: ResourceUnit.UNITS.HOURS
CONSTRUCTION:
type: 'CONSTRUCTION'
text_key: 'resource.type.construction.label'
unit: ResourceUnit.UNITS.TONS
CRUDE_OIL:
type: 'CRUDE_OIL'
text_key: 'resource.type.crude_oil.label'
unit: ResourceUnit.UNITS.LITER
ELECTRONIC_COMPONENT:
type: 'ELECTRONIC_COMPONENT'
text_key: 'resource.type.electronic_component.label'
unit: ResourceUnit.UNITS.ITEMS
FABRIC:
type: 'FABRIC'
text_key: 'resource.type.fabric.label'
unit: ResourceUnit.UNITS.METERS
FRESH_FOOD:
type: 'FRESH_FOOD'
text_key: 'resource.type.fresh_food.label'
unit: ResourceUnit.UNITS.KILOGRAMS
FURNITURE:
type: 'FURNITURE'
text_key: 'resource.type.furniture.label'
unit: ResourceUnit.UNITS.ITEMS
GASOLINE:
type: 'GASOLINE'
text_key: 'resource.type.gasoline.label'
unit: ResourceUnit.UNITS.LITER
LEGAL_SERVICES:
type: 'LEGAL_SERVICES'
text_key: 'resource.type.legal_services.label'
unit: ResourceUnit.UNITS.HOURS
LIQUOR:
type: 'LIQUOR'
text_key: 'resource.type.liquor.label'
unit: ResourceUnit.UNITS.ITEMS
MACHINERY:
type: 'MACHINERY'
text_key: 'resource.type.machinery.label'
unit: ResourceUnit.UNITS.MACHINES
METAL:
type: 'METAL'
text_key: 'resource.type.metal.label'
unit: ResourceUnit.UNITS.KILOGRAMS
MOVIE:
type: 'MOVIE'
text_key: 'resource.type.movie.label'
unit: ResourceUnit.UNITS.ITEMS
ORE:
type: 'ORE'
text_key: 'resource.type.ore.label'
unit: ResourceUnit.UNITS.KILOGRAMS
ORGANIC_MATERIAL:
type: 'ORGANIC_MATERIAL'
text_key: 'resource.type.organic_material.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PAPER:
type: 'PAPER'
text_key: 'resource.type.paper.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PRINTED_MATERIAL:
type: 'PRINTED_MATERIAL'
text_key: 'resource.type.printed_material.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PHARMACEUTICAL:
type: 'PHARMACEUTICAL'
text_key: 'resource.type.pharmaceutical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PLASTIC:
type: 'PLASTIC'
text_key: 'resource.type.plastic.label'
unit: ResourceUnit.UNITS.KILOGRAMS
PROCESSED_FOOD:
type: 'PROCESSED_FOOD'
text_key: 'resource.type.processed_food.label'
unit: ResourceUnit.UNITS.ITEMS
RAW_CHEMICAL:
type: 'RAW_CHEMICAL'
text_key: 'resource.type.raw_chemical.label'
unit: ResourceUnit.UNITS.KILOGRAMS
SILICON:
type: 'SILICON'
text_key: 'resource.type.silicon.label'
unit: ResourceUnit.UNITS.KILOGRAMS
STONE:
type: 'STONE'
text_key: 'resource.type.stone.label'
unit: ResourceUnit.UNITS.KILOGRAMS
TIMBER:
type: 'TIMBER'
text_key: 'resource.type.timber.label'
unit: ResourceUnit.UNITS.KILOGRAMS
TOY:
type: 'TOY'
text_key: 'resource.type.toy.label'
unit: ResourceUnit.UNITS.ITEMS
|
[
{
"context": "# Author: Josh Bass\n\nReact = require(\"react\");\n\nCreateInventory = req",
"end": 19,
"score": 0.9998821020126343,
"start": 10,
"tag": "NAME",
"value": "Josh Bass"
}
] | src/client/components/inventory/InventoryView.coffee | jbass86/Aroma | 0 | # Author: Josh Bass
React = require("react");
CreateInventory = require("./CreateInventory.coffee");
Filters = require("client/components/filters/FiltersView.coffee");
InventoryTable = require("./InventoryTable.coffee");
require("./res/styles/inventory.scss");
module.exports = React.createClass
getInitialState: ->
@filter_types = [{key: "name", name: "Name", type: "text"}, {key: "type", name: "Type", type: "text"}, \
{key: "acquire_date", name: "Acquire Date", type: "date"}, {key: "cost", name: "Cost", type: "number"}, \
{key: "sale_price", name: "Sale Price", type: "number"}, \
{key: "acquire_location", name: "Acquire Location", type: "text"}];
{inventory_items: [], filters: {}};
componentDidMount: ->
@updateInventory();
render: ->
<div className="common-view">
<div className="section-title">
Inventory
</div>
<CreateInventory inventoryUpdate={@updateInventory} />
<Filters filterTypes={@filter_types} applyFilters={@applyFilters} name="inventory_filters" />
<InventoryTable inventoryUpdate={@updateInventory} items={@state.inventory_items} order_model={@props.order_model} />
</div>
applyFilters: (filters) ->
@setState({filters: filters}, () =>
@updateInventory();
);
updateInventory: () ->
$.get("aroma/secure/get_inventory", {token: window.sessionStorage.token, filters: @state.filters}, (response) =>
if (response.success)
@setState(inventory_items: response.results);
);
| 25250 | # Author: <NAME>
React = require("react");
CreateInventory = require("./CreateInventory.coffee");
Filters = require("client/components/filters/FiltersView.coffee");
InventoryTable = require("./InventoryTable.coffee");
require("./res/styles/inventory.scss");
module.exports = React.createClass
getInitialState: ->
@filter_types = [{key: "name", name: "Name", type: "text"}, {key: "type", name: "Type", type: "text"}, \
{key: "acquire_date", name: "Acquire Date", type: "date"}, {key: "cost", name: "Cost", type: "number"}, \
{key: "sale_price", name: "Sale Price", type: "number"}, \
{key: "acquire_location", name: "Acquire Location", type: "text"}];
{inventory_items: [], filters: {}};
componentDidMount: ->
@updateInventory();
render: ->
<div className="common-view">
<div className="section-title">
Inventory
</div>
<CreateInventory inventoryUpdate={@updateInventory} />
<Filters filterTypes={@filter_types} applyFilters={@applyFilters} name="inventory_filters" />
<InventoryTable inventoryUpdate={@updateInventory} items={@state.inventory_items} order_model={@props.order_model} />
</div>
applyFilters: (filters) ->
@setState({filters: filters}, () =>
@updateInventory();
);
updateInventory: () ->
$.get("aroma/secure/get_inventory", {token: window.sessionStorage.token, filters: @state.filters}, (response) =>
if (response.success)
@setState(inventory_items: response.results);
);
| true | # Author: PI:NAME:<NAME>END_PI
React = require("react");
CreateInventory = require("./CreateInventory.coffee");
Filters = require("client/components/filters/FiltersView.coffee");
InventoryTable = require("./InventoryTable.coffee");
require("./res/styles/inventory.scss");
module.exports = React.createClass
getInitialState: ->
@filter_types = [{key: "name", name: "Name", type: "text"}, {key: "type", name: "Type", type: "text"}, \
{key: "acquire_date", name: "Acquire Date", type: "date"}, {key: "cost", name: "Cost", type: "number"}, \
{key: "sale_price", name: "Sale Price", type: "number"}, \
{key: "acquire_location", name: "Acquire Location", type: "text"}];
{inventory_items: [], filters: {}};
componentDidMount: ->
@updateInventory();
render: ->
<div className="common-view">
<div className="section-title">
Inventory
</div>
<CreateInventory inventoryUpdate={@updateInventory} />
<Filters filterTypes={@filter_types} applyFilters={@applyFilters} name="inventory_filters" />
<InventoryTable inventoryUpdate={@updateInventory} items={@state.inventory_items} order_model={@props.order_model} />
</div>
applyFilters: (filters) ->
@setState({filters: filters}, () =>
@updateInventory();
);
updateInventory: () ->
$.get("aroma/secure/get_inventory", {token: window.sessionStorage.token, filters: @state.filters}, (response) =>
if (response.success)
@setState(inventory_items: response.results);
);
|
[
{
"context": "\n# @fileoverview Tests for jsx-uses-vars\n# @author Yannick Croissant\n###\n\n'use strict'\n\n# ----------------------------",
"end": 72,
"score": 0.9998454451560974,
"start": 55,
"tag": "NAME",
"value": "Yannick Croissant"
}
] | src/tests/rules/jsx-uses-vars.coffee | danielbayley/eslint-plugin-coffee | 21 | ###*
# @fileoverview Tests for jsx-uses-vars
# @author Yannick Croissant
###
'use strict'
# -----------------------------------------------------------------------------
# Requirements
# -----------------------------------------------------------------------------
eslint = require 'eslint'
ruleNoUnusedVars = require '../../rules/no-unused-vars'
path = require 'path'
{RuleTester} = eslint
# -----------------------------------------------------------------------------
# Tests
# -----------------------------------------------------------------------------
ruleTester = new RuleTester parser: path.join __dirname, '../../..'
linter = ruleTester.linter ? eslint.linter
linter.defineRule(
'jsx-uses-vars'
require 'eslint-plugin-react/lib/rules/jsx-uses-vars'
)
ruleTester.run 'no-unused-vars', ruleNoUnusedVars,
valid: [
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = null
bar = React.render(<App/>)
return bar
foo()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
React.render(<App/>)
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
React.render(<App/>)
'''
,
# parser: 'babel-eslint'
code: '''
### eslint jsx-uses-vars: 1 ###
a = 1
React.render(<img src={a} />)
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
f = ->
<App />
f()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
<App.Hello />
'''
,
# ,
# code: """
# ### eslint jsx-uses-vars: 1 ###
# App = null
# <App:Hello />
# """
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
<HelloMessage />
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: ->
HelloMessage = <div>Hello</div>
return HelloMessage
<HelloMessage />
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = { Foo: { Bar: {} } }
bar = React.render(<App.Foo.Bar/>)
return bar
foo()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = { Foo: { Bar: { Baz: {} } } }
bar = React.render(<App.Foo.Bar.Baz/>)
return bar
foo()
'''
]
invalid: [
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
'''
errors: [message: "'App' is assigned a value but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
unused = null
React.render(<App unused=""/>)
'''
errors: [message: "'unused' is assigned a value but never used."]
,
,
# code: """
# ### eslint jsx-uses-vars: 1 ###
# App = null
# Hello = null
# React.render(<App:Hello/>)
# """
# errors: [message: "'Hello' is defined but never used."]
code: '''
### eslint jsx-uses-vars: 1 ###
Button = null
Input = null
React.render(<Button.Input unused=""/>)
'''
errors: [message: "'Input' is assigned a value but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class unused
'''
errors: [message: "'unused' is defined but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: ->
HelloMessage = <div>Hello</div>
return HelloMessage
'''
errors: [
message: "'HelloMessage' is defined but never used."
line: 2
]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: (HelloMessage) ->
HelloMessage = <div>Hello</div>
return HelloMessage
'''
errors: [
message: "'HelloMessage' is defined but never used."
line: 2
]
,
# parser: 'babel-eslint'
code: '''
### eslint jsx-uses-vars: 1 ###
import {Hello} from 'Hello'
Greetings = (Hello) ->
Hello = require('Hello').default
return <Hello />
Greetings()
'''
errors: [
message: "'Hello' is defined but never used."
line: 2
]
# parser: 'babel-eslint'
]
| 19202 | ###*
# @fileoverview Tests for jsx-uses-vars
# @author <NAME>
###
'use strict'
# -----------------------------------------------------------------------------
# Requirements
# -----------------------------------------------------------------------------
eslint = require 'eslint'
ruleNoUnusedVars = require '../../rules/no-unused-vars'
path = require 'path'
{RuleTester} = eslint
# -----------------------------------------------------------------------------
# Tests
# -----------------------------------------------------------------------------
ruleTester = new RuleTester parser: path.join __dirname, '../../..'
linter = ruleTester.linter ? eslint.linter
linter.defineRule(
'jsx-uses-vars'
require 'eslint-plugin-react/lib/rules/jsx-uses-vars'
)
ruleTester.run 'no-unused-vars', ruleNoUnusedVars,
valid: [
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = null
bar = React.render(<App/>)
return bar
foo()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
React.render(<App/>)
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
React.render(<App/>)
'''
,
# parser: 'babel-eslint'
code: '''
### eslint jsx-uses-vars: 1 ###
a = 1
React.render(<img src={a} />)
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
f = ->
<App />
f()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
<App.Hello />
'''
,
# ,
# code: """
# ### eslint jsx-uses-vars: 1 ###
# App = null
# <App:Hello />
# """
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
<HelloMessage />
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: ->
HelloMessage = <div>Hello</div>
return HelloMessage
<HelloMessage />
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = { Foo: { Bar: {} } }
bar = React.render(<App.Foo.Bar/>)
return bar
foo()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = { Foo: { Bar: { Baz: {} } } }
bar = React.render(<App.Foo.Bar.Baz/>)
return bar
foo()
'''
]
invalid: [
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
'''
errors: [message: "'App' is assigned a value but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
unused = null
React.render(<App unused=""/>)
'''
errors: [message: "'unused' is assigned a value but never used."]
,
,
# code: """
# ### eslint jsx-uses-vars: 1 ###
# App = null
# Hello = null
# React.render(<App:Hello/>)
# """
# errors: [message: "'Hello' is defined but never used."]
code: '''
### eslint jsx-uses-vars: 1 ###
Button = null
Input = null
React.render(<Button.Input unused=""/>)
'''
errors: [message: "'Input' is assigned a value but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class unused
'''
errors: [message: "'unused' is defined but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: ->
HelloMessage = <div>Hello</div>
return HelloMessage
'''
errors: [
message: "'HelloMessage' is defined but never used."
line: 2
]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: (HelloMessage) ->
HelloMessage = <div>Hello</div>
return HelloMessage
'''
errors: [
message: "'HelloMessage' is defined but never used."
line: 2
]
,
# parser: 'babel-eslint'
code: '''
### eslint jsx-uses-vars: 1 ###
import {Hello} from 'Hello'
Greetings = (Hello) ->
Hello = require('Hello').default
return <Hello />
Greetings()
'''
errors: [
message: "'Hello' is defined but never used."
line: 2
]
# parser: 'babel-eslint'
]
| true | ###*
# @fileoverview Tests for jsx-uses-vars
# @author PI:NAME:<NAME>END_PI
###
'use strict'
# -----------------------------------------------------------------------------
# Requirements
# -----------------------------------------------------------------------------
eslint = require 'eslint'
ruleNoUnusedVars = require '../../rules/no-unused-vars'
path = require 'path'
{RuleTester} = eslint
# -----------------------------------------------------------------------------
# Tests
# -----------------------------------------------------------------------------
ruleTester = new RuleTester parser: path.join __dirname, '../../..'
linter = ruleTester.linter ? eslint.linter
linter.defineRule(
'jsx-uses-vars'
require 'eslint-plugin-react/lib/rules/jsx-uses-vars'
)
ruleTester.run 'no-unused-vars', ruleNoUnusedVars,
valid: [
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = null
bar = React.render(<App/>)
return bar
foo()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
React.render(<App/>)
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
React.render(<App/>)
'''
,
# parser: 'babel-eslint'
code: '''
### eslint jsx-uses-vars: 1 ###
a = 1
React.render(<img src={a} />)
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
f = ->
<App />
f()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
<App.Hello />
'''
,
# ,
# code: """
# ### eslint jsx-uses-vars: 1 ###
# App = null
# <App:Hello />
# """
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
<HelloMessage />
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: ->
HelloMessage = <div>Hello</div>
return HelloMessage
<HelloMessage />
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = { Foo: { Bar: {} } }
bar = React.render(<App.Foo.Bar/>)
return bar
foo()
'''
,
code: '''
### eslint jsx-uses-vars: 1 ###
foo = ->
App = { Foo: { Bar: { Baz: {} } } }
bar = React.render(<App.Foo.Bar.Baz/>)
return bar
foo()
'''
]
invalid: [
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
'''
errors: [message: "'App' is assigned a value but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
App = null
unused = null
React.render(<App unused=""/>)
'''
errors: [message: "'unused' is assigned a value but never used."]
,
,
# code: """
# ### eslint jsx-uses-vars: 1 ###
# App = null
# Hello = null
# React.render(<App:Hello/>)
# """
# errors: [message: "'Hello' is defined but never used."]
code: '''
### eslint jsx-uses-vars: 1 ###
Button = null
Input = null
React.render(<Button.Input unused=""/>)
'''
errors: [message: "'Input' is assigned a value but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class unused
'''
errors: [message: "'unused' is defined but never used."]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: ->
HelloMessage = <div>Hello</div>
return HelloMessage
'''
errors: [
message: "'HelloMessage' is defined but never used."
line: 2
]
,
code: '''
### eslint jsx-uses-vars: 1 ###
class HelloMessage
render: (HelloMessage) ->
HelloMessage = <div>Hello</div>
return HelloMessage
'''
errors: [
message: "'HelloMessage' is defined but never used."
line: 2
]
,
# parser: 'babel-eslint'
code: '''
### eslint jsx-uses-vars: 1 ###
import {Hello} from 'Hello'
Greetings = (Hello) ->
Hello = require('Hello').default
return <Hello />
Greetings()
'''
errors: [
message: "'Hello' is defined but never used."
line: 2
]
# parser: 'babel-eslint'
]
|
[
{
"context": " queue: queue\n users:\n jysperm: 'pass'\n\n app.use bodyParser.json()\n app.use a",
"end": 419,
"score": 0.8638279438018799,
"start": 415,
"tag": "PASSWORD",
"value": "pass"
},
{
"context": " .post '/'\n .send\n locals: name: ... | test/agent.test.coffee | jysperm/pomo-mailer | 1 | bodyParser = require 'body-parser'
supertest = require 'supertest'
express = require 'express'
{Agent, Queue} = pomoMailer
describe 'agent', ->
describe 'express', ->
mails = []
app = express()
before ->
queue = new Queue
mailer: mockMailer mails
mongodb: 'mongodb://localhost/pomo-mailer-test'
agent = new Agent
queue: queue
users:
jysperm: 'pass'
app.use bodyParser.json()
app.use agent.express()
queue.QueueModel.remove()
it 'should success', (done) ->
supertest app
.post '/'
.send
locals: name: 'agent'
address: 'jysperm@gmail.com'
.auth 'jysperm', 'pass'
.expect 202
.end done
it 'should forbidden', (done) ->
supertest app
.post '/'
.send
locals: name: 'agent'
address: 'jysperm@gmail.com'
.expect 403
.end done
after ->
Q.delay(10).then ->
mails.length.should.be.equal 1
mails[0].locals.name.should.be.equal 'agent'
| 140741 | bodyParser = require 'body-parser'
supertest = require 'supertest'
express = require 'express'
{Agent, Queue} = pomoMailer
describe 'agent', ->
describe 'express', ->
mails = []
app = express()
before ->
queue = new Queue
mailer: mockMailer mails
mongodb: 'mongodb://localhost/pomo-mailer-test'
agent = new Agent
queue: queue
users:
jysperm: '<PASSWORD>'
app.use bodyParser.json()
app.use agent.express()
queue.QueueModel.remove()
it 'should success', (done) ->
supertest app
.post '/'
.send
locals: name: '<NAME>'
address: '<EMAIL>'
.auth 'jysperm', '<PASSWORD>'
.expect 202
.end done
it 'should forbidden', (done) ->
supertest app
.post '/'
.send
locals: name: '<NAME>'
address: '<EMAIL>'
.expect 403
.end done
after ->
Q.delay(10).then ->
mails.length.should.be.equal 1
mails[0].locals.name.should.be.equal 'agent'
| true | bodyParser = require 'body-parser'
supertest = require 'supertest'
express = require 'express'
{Agent, Queue} = pomoMailer
describe 'agent', ->
describe 'express', ->
mails = []
app = express()
before ->
queue = new Queue
mailer: mockMailer mails
mongodb: 'mongodb://localhost/pomo-mailer-test'
agent = new Agent
queue: queue
users:
jysperm: 'PI:PASSWORD:<PASSWORD>END_PI'
app.use bodyParser.json()
app.use agent.express()
queue.QueueModel.remove()
it 'should success', (done) ->
supertest app
.post '/'
.send
locals: name: 'PI:NAME:<NAME>END_PI'
address: 'PI:EMAIL:<EMAIL>END_PI'
.auth 'jysperm', 'PI:PASSWORD:<PASSWORD>END_PI'
.expect 202
.end done
it 'should forbidden', (done) ->
supertest app
.post '/'
.send
locals: name: 'PI:NAME:<NAME>END_PI'
address: 'PI:EMAIL:<EMAIL>END_PI'
.expect 403
.end done
after ->
Q.delay(10).then ->
mails.length.should.be.equal 1
mails[0].locals.name.should.be.equal 'agent'
|
[
{
"context": "les/uuid')\n .set('Authorization', 'Bearer valid.signed.token')\n .end (error, response) -",
"end": 10934,
"score": 0.550494372844696,
"start": 10929,
"tag": "KEY",
"value": "valid"
}
] | test/integration/rest/v1/roles.coffee | Romakita/connect | 0 | # Test dependencies
chai = require 'chai'
sinon = require 'sinon'
sinonChai = require 'sinon-chai'
supertest = require 'supertest'
expect = chai.expect
# Assertions
chai.use sinonChai
chai.should()
# Code under test
server = require '../../../../server'
Role = require '../../../../models/Role'
AccessToken = require '../../../../models/AccessToken'
request = supertest(server)
describe 'RESTful Role Routes', ->
{err, res} = {}
describe 'GET /v1/roles', ->
describe 'without valid token', ->
before (done) ->
request
.get('/v1/roles')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with valid token', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'list').callsArgWith 1, null, []
request
.get('/v1/roles')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.list.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with a list of roles', ->
res.body.should.be.an 'array'
describe 'GET /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.get('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'get').callsArgWith(1, null, null)
request
.get('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.get.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid token and known role id', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'get').callsArgWith(1, null, role)
request
.get('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.get.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with a resource', ->
res.body.name.should.equal role.name
describe 'POST /v1/roles', ->
describe 'without valid token', ->
before (done) ->
request
.post('/v1/roles')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with valid data', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'insert').callsArgWith(1, null, role)
request
.post("/v1/roles")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: 'custom' })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.insert.restore()
it 'should respond 201', ->
res.statusCode.should.equal 201
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with the resource', ->
res.body.should.have.property 'name'
describe 'with invalid data', ->
role = new Role name: false
validation = role.validate()
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'insert').callsArgWith(1, validation, undefined)
request
.post("/v1/roles")
.set('Authorization', 'Bearer valid.signed.token')
.send({ application_type: false })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.insert.restore()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with an error', ->
res.body.error.should.contain 'validation_error'
describe 'PATCH /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.patch('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, null, null)
request
.patch('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid data', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, null, role)
request
.patch("/v1/roles/uuid")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: 'custom' })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with the resource', ->
res.body.name.should.equal role.name
describe 'with invalid data', ->
role = new Role name: false
validation = role.validate()
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, validation, undefined)
request
.patch("/v1/roles/uuid")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: false })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with an error', ->
res.body.error.should.contain 'validation_error'
describe 'DELETE /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.del('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'delete').callsArgWith(1, null, null)
request
.del('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.delete.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid request', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'delete').callsArgWith(1, null, role)
request
.del('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.delete.restore()
it 'should respond 204', ->
res.statusCode.should.equal 204
| 213780 | # Test dependencies
chai = require 'chai'
sinon = require 'sinon'
sinonChai = require 'sinon-chai'
supertest = require 'supertest'
expect = chai.expect
# Assertions
chai.use sinonChai
chai.should()
# Code under test
server = require '../../../../server'
Role = require '../../../../models/Role'
AccessToken = require '../../../../models/AccessToken'
request = supertest(server)
describe 'RESTful Role Routes', ->
{err, res} = {}
describe 'GET /v1/roles', ->
describe 'without valid token', ->
before (done) ->
request
.get('/v1/roles')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with valid token', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'list').callsArgWith 1, null, []
request
.get('/v1/roles')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.list.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with a list of roles', ->
res.body.should.be.an 'array'
describe 'GET /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.get('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'get').callsArgWith(1, null, null)
request
.get('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.get.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid token and known role id', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'get').callsArgWith(1, null, role)
request
.get('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.get.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with a resource', ->
res.body.name.should.equal role.name
describe 'POST /v1/roles', ->
describe 'without valid token', ->
before (done) ->
request
.post('/v1/roles')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with valid data', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'insert').callsArgWith(1, null, role)
request
.post("/v1/roles")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: 'custom' })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.insert.restore()
it 'should respond 201', ->
res.statusCode.should.equal 201
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with the resource', ->
res.body.should.have.property 'name'
describe 'with invalid data', ->
role = new Role name: false
validation = role.validate()
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'insert').callsArgWith(1, validation, undefined)
request
.post("/v1/roles")
.set('Authorization', 'Bearer valid.signed.token')
.send({ application_type: false })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.insert.restore()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with an error', ->
res.body.error.should.contain 'validation_error'
describe 'PATCH /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.patch('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, null, null)
request
.patch('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid data', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, null, role)
request
.patch("/v1/roles/uuid")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: 'custom' })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with the resource', ->
res.body.name.should.equal role.name
describe 'with invalid data', ->
role = new Role name: false
validation = role.validate()
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, validation, undefined)
request
.patch("/v1/roles/uuid")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: false })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with an error', ->
res.body.error.should.contain 'validation_error'
describe 'DELETE /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.del('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'delete').callsArgWith(1, null, null)
request
.del('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.delete.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid request', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'delete').callsArgWith(1, null, role)
request
.del('/v1/roles/uuid')
.set('Authorization', 'Bearer <KEY>.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.delete.restore()
it 'should respond 204', ->
res.statusCode.should.equal 204
| true | # Test dependencies
chai = require 'chai'
sinon = require 'sinon'
sinonChai = require 'sinon-chai'
supertest = require 'supertest'
expect = chai.expect
# Assertions
chai.use sinonChai
chai.should()
# Code under test
server = require '../../../../server'
Role = require '../../../../models/Role'
AccessToken = require '../../../../models/AccessToken'
request = supertest(server)
describe 'RESTful Role Routes', ->
{err, res} = {}
describe 'GET /v1/roles', ->
describe 'without valid token', ->
before (done) ->
request
.get('/v1/roles')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with valid token', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'list').callsArgWith 1, null, []
request
.get('/v1/roles')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.list.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with a list of roles', ->
res.body.should.be.an 'array'
describe 'GET /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.get('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'get').callsArgWith(1, null, null)
request
.get('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.get.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid token and known role id', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'get').callsArgWith(1, null, role)
request
.get('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.get.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with a resource', ->
res.body.name.should.equal role.name
describe 'POST /v1/roles', ->
describe 'without valid token', ->
before (done) ->
request
.post('/v1/roles')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with valid data', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'insert').callsArgWith(1, null, role)
request
.post("/v1/roles")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: 'custom' })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.insert.restore()
it 'should respond 201', ->
res.statusCode.should.equal 201
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with the resource', ->
res.body.should.have.property 'name'
describe 'with invalid data', ->
role = new Role name: false
validation = role.validate()
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'insert').callsArgWith(1, validation, undefined)
request
.post("/v1/roles")
.set('Authorization', 'Bearer valid.signed.token')
.send({ application_type: false })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.insert.restore()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with an error', ->
res.body.error.should.contain 'validation_error'
describe 'PATCH /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.patch('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, null, null)
request
.patch('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid data', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, null, role)
request
.patch("/v1/roles/uuid")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: 'custom' })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 200', ->
res.statusCode.should.equal 200
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with the resource', ->
res.body.name.should.equal role.name
describe 'with invalid data', ->
role = new Role name: false
validation = role.validate()
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'patch').callsArgWith(2, validation, undefined)
request
.patch("/v1/roles/uuid")
.set('Authorization', 'Bearer valid.signed.token')
.send({ name: false })
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.patch.restore()
it 'should respond 400', ->
res.statusCode.should.equal 400
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'application/json'
it 'should respond with an error', ->
res.body.error.should.contain 'validation_error'
describe 'DELETE /v1/roles/:id', ->
describe 'without valid token', ->
before (done) ->
request
.del('/v1/roles/uuid')
.end (error, response) ->
err = error
res = response
done()
it 'should respond 40x', ->
res.statusCode.should.equal 400
it 'should respond with error', ->
res.body.error.should.equal 'invalid_request'
it 'should respond with error_description', ->
res.body.error_description.should.equal 'An access token is required'
describe 'with unknown role id', ->
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'delete').callsArgWith(1, null, null)
request
.del('/v1/roles/uuid')
.set('Authorization', 'Bearer valid.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.delete.restore()
it 'should respond 404', ->
res.statusCode.should.equal 404
it 'should respond with JSON', ->
res.headers['content-type'].should.contain 'text/html'
it 'should respond with "Not found."', ->
res.text.should.contain 'Not found.'
describe 'with valid request', ->
role = new Role name: 'custom'
before (done) ->
sinon.stub(AccessToken, 'verify').callsArgWith(2, null, {})
sinon.stub(Role, 'delete').callsArgWith(1, null, role)
request
.del('/v1/roles/uuid')
.set('Authorization', 'Bearer PI:KEY:<KEY>END_PI.signed.token')
.end (error, response) ->
err = error
res = response
done()
after ->
AccessToken.verify.restore()
Role.delete.restore()
it 'should respond 204', ->
res.statusCode.should.equal 204
|
[
{
"context": ".total_grand > threshold\n groups.push name: name, time: time\n else\n otherTotal += time",
"end": 5544,
"score": 0.689735472202301,
"start": 5540,
"tag": "NAME",
"value": "name"
}
] | app/summary_report.coffee | AzureMentor/toggl-pdf | 1 | Report = require './report'
moment = require 'moment'
timeFormat = require 'time-format-utils'
RAD = Math.PI / 180
COLORS = [
"#4dc3ff", "#bc85e6", "#df7baa", "#f68d38", "#b27636",
"#8ab734", "#14a88e", "#268bb5", "#6668b4", "#a4506c",
"#67412c", "#3c6526", "#094558", "#bc2d07", "#999999"
]
# keeps own state; returns function that takes HEX color and returns it shaded
getShader = ->
dict = {}
# from: http://stackoverflow.com/a/13542669/390493
shade = (color, percent) ->
f = parseInt(color.slice(1), 16)
t = if percent < 0 then 0 else 255
p = if percent < 0 then percent * -1 else percent
R = f >> 16
G = f >> 8 & 0x00FF
B = f & 0x0000FF
'#' + (0x1000000 + (Math.round((t - R) * p) + R) * 0x10000 + (Math.round((t - G) * p) + G) * 0x100 + Math.round((t - B) * p) + B).toString(16).slice(1)
getCount = (color) ->
x = dict[color] or 0
dict[color] = x + 1
x
return (color) ->
shade color, getCount(color.toLowerCase()) / 5
class SummaryReport extends Report
finalize: ->
@colorShift = Math.floor Math.random() * COLORS.length
@translate 0, 50
@reportHeader('Summary report')
@translate 0, 75
@selectedFilters()
@translate 0, 50
@barChart()
@translate 0, 180
@pieChart()
@translate 280, 0
@subPieChart()
@addPage()
@reportTable()
@translate 0, 10
@createdWith()
fileName: ->
"Toggl_#{@data.params?.grouping}_#{@data.params?.since}_to_#{@data.params?.until}"
sector: (cx, cy, r, startAngle, endAngle) ->
sweepFlag = endAngle - startAngle > 180
x1 = cx - r * Math.cos -startAngle * RAD
y1 = cy + r * Math.sin -startAngle * RAD
x2 = cx - r * Math.cos -endAngle * RAD
y2 = cy + r * Math.sin -endAngle * RAD
["M", cx, cy, "L", x1, y1, "A", r, r, 0, +sweepFlag, 1, x2, y2, "z"]
barChart: ->
@data.activity.rows.sort (a, b) -> a[0] - b[0]
dates = []
values = []
for row in @data.activity.rows
values.push if row[1] then row[1] / 3600.0 else 0.0
dates.push moment(row[0])
maxValue = Math.ceil Math.max.apply(null, values)
heights =
for val in values
if maxValue > 0 and val > 0
Math.ceil val / maxValue * 120
else
0
# Draw barchart grid
LINE_START = 35
LINE_END = 540
@doc.lineWidth(0.5).strokeColor '#e6e6e6'
@doc.moveTo(LINE_START, 5).lineTo(LINE_END, 5).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 35).lineTo(LINE_END, 35).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 65).lineTo(LINE_END, 65).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 95).lineTo(LINE_END, 95).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 145).lineTo(LINE_END, 145).dash(1, space: 1).stroke()
yAxisText = (val) ->
if val > 10
"#{Math.round(val)} h"
else
"#{val.toFixed(2)} h"
@doc.fontSize(9).fillColor '#6d6d6d'
if maxValue > 0
@doc.text yAxisText(maxValue), 550, 0.1, width: 0
@doc.text yAxisText(maxValue * 0.75), 550, 30, width: 0
@doc.text yAxisText(maxValue * 0.5), 550, 60, width: 0
@doc.text yAxisText(maxValue * 0.25), 550, 90, width: 0
MAX_DAYS = 31
PADDING_LEFT = 45
MIN_BAR_WIDTH = 12
MAX_BAR_HEIGHT = 125
BAR_GRAPH_WIDTH = LINE_END - LINE_START - 2 * (PADDING_LEFT - LINE_START)
barCount = @data.activity.rows.length
barWidth = MAX_DAYS / barCount * MIN_BAR_WIDTH
if barCount==1
PADDING_LEFT = PADDING_LEFT + (BAR_GRAPH_WIDTH - barWidth)/2
pad = if barCount > 1 then (BAR_GRAPH_WIDTH - barCount * barWidth) / (barCount-1) else 0
barWidthPad = barWidth + pad
@doc.font('FontBold').fontSize 8
# Draw barchart bars
cx = PADDING_LEFT
for height, i in values
if height == 0
@doc.rect(cx, MAX_BAR_HEIGHT, barWidth, -2).fill '#929292'
else
@doc.rect(cx, MAX_BAR_HEIGHT, barWidth, -heights[i]).fill '#2cc1e6'
# Draw labels above bars
if barCount <= 16
time = "#{height.toFixed(2)}"
if @data.duration_format != 'decimal'
time = timeFormat.secondsToSmallHhmm(height*3600)
@doc.text time, cx, MAX_BAR_HEIGHT - heights[i] - 15, width: barWidth, align: 'center'
cx += barWidthPad
# Draw barchart horizontal date labels
cx = PADDING_LEFT
zoom = @data.activity.zoom_level
dateFormat = switch zoom
when 'day' then 'Do MMM'
when 'week' then 'DD.MM'
when 'month' then 'MMM'
@doc.font('FontRegular').fontSize 7
@doc.undash().lineWidth(0.5).strokeColor '#6d6d6d'
modValue = if barCount <= 12 then 1
else if barCount > 12 and barCount <= 22 then 2
else if barCount > 22 then 3
modValue = 2 if zoom == 'week' and barCount > 8
halfBar = barWidth / 2
for height, i in values
if i % modValue == 0
@doc.moveTo(cx + halfBar, MAX_BAR_HEIGHT + 2).lineTo(cx + halfBar, MAX_BAR_HEIGHT + 5).stroke()
@doc.fill('#6d6d6d').text dates[i].format(dateFormat), cx - (barWidthPad / 2) - 2, 125 + 5, width: barWidthPad * 2, align: 'center'
cx += barWidthPad
subPieChart: ->
@pieChart 'subgrouping'
grouping: (groupingType) ->
@data.params?[groupingType] or @data.env[groupingType]
pieChart: (part = 'grouping') ->
title = @capitalize @grouping(part)
@doc.fontSize(14).fill('#000').text title, 50, 1
groups = []
otherTotal = 0
filterOthers = (time, name, threshold) =>
if time / @data.total_grand > threshold
groups.push name: name, time: time
else
otherTotal += time
if part is 'subgrouping'
subgroups = {}
for group, i in @data.data
groupColor = getColor group.title, i + @colorShift
for item, i in group.items
title = (getTitle item.title)
unless subgroups[title]?
subgroups[title] =
name:
time_entry: title
hex_color: unless isClient(group.title) then groupColor else nextColor i
time: item.time
else
subgroups[title].time += item.time
filterOthers(obj.time, obj.name, 0.05) for title, obj of subgroups
else
filterOthers(time, name, 0.06) for {time, title: name} in @data.data
groups.sort (a, b) -> b.time - a.time
if otherTotal > 0
groups.push
name:
time_entry: 'Other'
hex_color: '#D3D3D3'
time: otherTotal
if part is 'subgrouping'
shade = getShader()
for x in groups
x.name.hex_color = shade x.name.hex_color
# Donut chart
angle = 90
for group, i in groups
angleplus = 360 * group.time / @data.total_grand
path = @sector 150, 130, 100, angle, angle + angleplus
@doc.path(path.join(', ')).fill getColor group.name, i + @colorShift
angle += angleplus
@doc.circle(150, 130, 40).fill "#fff"
# Donut labels
@doc.fontSize 10
cy = 255
for group, i in groups
@doc.circle(63, cy, 8).fill getColor group.name, i + @colorShift
title = getTitle group.name
groupName = if title.length > 30
title.substr(0, 25) + '...'
else
title
@doc.fillColor('#000000').text groupName, 83, cy - 6, width: 200
labelWidth = @doc.widthOfString groupName
@doc.fillColor('#6d6d6d').text @displayDuration(group.time), 93 + labelWidth, cy - 6
cy = cy + 20
getTitle = (title) ->
if typeof title is 'object'
if title.time_entry
return title.time_entry
if title.user
return title.user
if title.project
if title.client
return title.project + ' - ' + title.client
else
return title.project
if title.client
return title.client
if 'task' of title # even if `null`!
return title.task or '(no task)'
return '-'
else
return title or '(no title)'
isClient = (title) ->
typeof title is 'object' and title.client isnt undefined and Object.keys(title).length is 1
nextColor = (i) ->
COLORS[i % COLORS.length]
getColor = (title, i) ->
if typeof title is 'object'
if isClient title
return nextColor i
if title.hex_color
return title.hex_color
if title.color
return COLORS[title.color]
if title.user
return nextColor i
return '#999999'
reportTable: ->
@translate 0, 20
@doc.fontSize(7)
@doc.font('FontBold').fill '#6f7071'
@doc.text "#{@capitalize(@grouping 'grouping')} / #{@capitalize(@grouping 'subgrouping')}", 55, 10
if @isFree()
@doc.text 'Duration', 450, 10
else
@doc.text 'Duration', 390, 10
@doc.text 'Amount', 450, 10
@translate 0, 20
@doc.fill('#000000')
for group in @data.data
@doc.font 'FontBold'
@doc.text (getTitle group.title), 55, 10
if @isFree()
@doc.text @displayDuration(group.time), 450, 10
else
@doc.text @displayDuration(group.time), 390, 10
amounts = for cur in group.total_currencies when cur.amount?
cur.amount.toFixed(2) + " " + cur.currency
@doc.text amounts.join(', '), 450, 10
@translate 0, 20
@doc.font 'FontRegular'
for item in group.items
lineHeight = 90
title = getTitle item.title
lineCount = title.length / lineHeight
@doc.text title, 60, 10, width: 330, lineCap: lineCount
if @isFree()
@doc.text @displayDuration(item.time), 450, 10
else
@doc.text @displayDuration(item.time), 390, 10
@doc.text item.sum.toFixed(2) + " " + item.cur, 450, 10 if item.sum? and item.sum > 0
@translate 0, 20
# If the we have multiline description then lets move the lines down
@translate 0, 13 * Math.ceil lineCount if lineCount > 1
if @posY > Report.PAGE_HEIGHT - Report.MARGIN_BOTTOM
@doc.text ++@pageNum
@addPage()
@translate 0, 20
module.exports = SummaryReport
| 162893 | Report = require './report'
moment = require 'moment'
timeFormat = require 'time-format-utils'
RAD = Math.PI / 180
COLORS = [
"#4dc3ff", "#bc85e6", "#df7baa", "#f68d38", "#b27636",
"#8ab734", "#14a88e", "#268bb5", "#6668b4", "#a4506c",
"#67412c", "#3c6526", "#094558", "#bc2d07", "#999999"
]
# keeps own state; returns function that takes HEX color and returns it shaded
getShader = ->
dict = {}
# from: http://stackoverflow.com/a/13542669/390493
shade = (color, percent) ->
f = parseInt(color.slice(1), 16)
t = if percent < 0 then 0 else 255
p = if percent < 0 then percent * -1 else percent
R = f >> 16
G = f >> 8 & 0x00FF
B = f & 0x0000FF
'#' + (0x1000000 + (Math.round((t - R) * p) + R) * 0x10000 + (Math.round((t - G) * p) + G) * 0x100 + Math.round((t - B) * p) + B).toString(16).slice(1)
getCount = (color) ->
x = dict[color] or 0
dict[color] = x + 1
x
return (color) ->
shade color, getCount(color.toLowerCase()) / 5
class SummaryReport extends Report
finalize: ->
@colorShift = Math.floor Math.random() * COLORS.length
@translate 0, 50
@reportHeader('Summary report')
@translate 0, 75
@selectedFilters()
@translate 0, 50
@barChart()
@translate 0, 180
@pieChart()
@translate 280, 0
@subPieChart()
@addPage()
@reportTable()
@translate 0, 10
@createdWith()
fileName: ->
"Toggl_#{@data.params?.grouping}_#{@data.params?.since}_to_#{@data.params?.until}"
sector: (cx, cy, r, startAngle, endAngle) ->
sweepFlag = endAngle - startAngle > 180
x1 = cx - r * Math.cos -startAngle * RAD
y1 = cy + r * Math.sin -startAngle * RAD
x2 = cx - r * Math.cos -endAngle * RAD
y2 = cy + r * Math.sin -endAngle * RAD
["M", cx, cy, "L", x1, y1, "A", r, r, 0, +sweepFlag, 1, x2, y2, "z"]
barChart: ->
@data.activity.rows.sort (a, b) -> a[0] - b[0]
dates = []
values = []
for row in @data.activity.rows
values.push if row[1] then row[1] / 3600.0 else 0.0
dates.push moment(row[0])
maxValue = Math.ceil Math.max.apply(null, values)
heights =
for val in values
if maxValue > 0 and val > 0
Math.ceil val / maxValue * 120
else
0
# Draw barchart grid
LINE_START = 35
LINE_END = 540
@doc.lineWidth(0.5).strokeColor '#e6e6e6'
@doc.moveTo(LINE_START, 5).lineTo(LINE_END, 5).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 35).lineTo(LINE_END, 35).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 65).lineTo(LINE_END, 65).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 95).lineTo(LINE_END, 95).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 145).lineTo(LINE_END, 145).dash(1, space: 1).stroke()
yAxisText = (val) ->
if val > 10
"#{Math.round(val)} h"
else
"#{val.toFixed(2)} h"
@doc.fontSize(9).fillColor '#6d6d6d'
if maxValue > 0
@doc.text yAxisText(maxValue), 550, 0.1, width: 0
@doc.text yAxisText(maxValue * 0.75), 550, 30, width: 0
@doc.text yAxisText(maxValue * 0.5), 550, 60, width: 0
@doc.text yAxisText(maxValue * 0.25), 550, 90, width: 0
MAX_DAYS = 31
PADDING_LEFT = 45
MIN_BAR_WIDTH = 12
MAX_BAR_HEIGHT = 125
BAR_GRAPH_WIDTH = LINE_END - LINE_START - 2 * (PADDING_LEFT - LINE_START)
barCount = @data.activity.rows.length
barWidth = MAX_DAYS / barCount * MIN_BAR_WIDTH
if barCount==1
PADDING_LEFT = PADDING_LEFT + (BAR_GRAPH_WIDTH - barWidth)/2
pad = if barCount > 1 then (BAR_GRAPH_WIDTH - barCount * barWidth) / (barCount-1) else 0
barWidthPad = barWidth + pad
@doc.font('FontBold').fontSize 8
# Draw barchart bars
cx = PADDING_LEFT
for height, i in values
if height == 0
@doc.rect(cx, MAX_BAR_HEIGHT, barWidth, -2).fill '#929292'
else
@doc.rect(cx, MAX_BAR_HEIGHT, barWidth, -heights[i]).fill '#2cc1e6'
# Draw labels above bars
if barCount <= 16
time = "#{height.toFixed(2)}"
if @data.duration_format != 'decimal'
time = timeFormat.secondsToSmallHhmm(height*3600)
@doc.text time, cx, MAX_BAR_HEIGHT - heights[i] - 15, width: barWidth, align: 'center'
cx += barWidthPad
# Draw barchart horizontal date labels
cx = PADDING_LEFT
zoom = @data.activity.zoom_level
dateFormat = switch zoom
when 'day' then 'Do MMM'
when 'week' then 'DD.MM'
when 'month' then 'MMM'
@doc.font('FontRegular').fontSize 7
@doc.undash().lineWidth(0.5).strokeColor '#6d6d6d'
modValue = if barCount <= 12 then 1
else if barCount > 12 and barCount <= 22 then 2
else if barCount > 22 then 3
modValue = 2 if zoom == 'week' and barCount > 8
halfBar = barWidth / 2
for height, i in values
if i % modValue == 0
@doc.moveTo(cx + halfBar, MAX_BAR_HEIGHT + 2).lineTo(cx + halfBar, MAX_BAR_HEIGHT + 5).stroke()
@doc.fill('#6d6d6d').text dates[i].format(dateFormat), cx - (barWidthPad / 2) - 2, 125 + 5, width: barWidthPad * 2, align: 'center'
cx += barWidthPad
subPieChart: ->
@pieChart 'subgrouping'
grouping: (groupingType) ->
@data.params?[groupingType] or @data.env[groupingType]
pieChart: (part = 'grouping') ->
title = @capitalize @grouping(part)
@doc.fontSize(14).fill('#000').text title, 50, 1
groups = []
otherTotal = 0
filterOthers = (time, name, threshold) =>
if time / @data.total_grand > threshold
groups.push name: <NAME>, time: time
else
otherTotal += time
if part is 'subgrouping'
subgroups = {}
for group, i in @data.data
groupColor = getColor group.title, i + @colorShift
for item, i in group.items
title = (getTitle item.title)
unless subgroups[title]?
subgroups[title] =
name:
time_entry: title
hex_color: unless isClient(group.title) then groupColor else nextColor i
time: item.time
else
subgroups[title].time += item.time
filterOthers(obj.time, obj.name, 0.05) for title, obj of subgroups
else
filterOthers(time, name, 0.06) for {time, title: name} in @data.data
groups.sort (a, b) -> b.time - a.time
if otherTotal > 0
groups.push
name:
time_entry: 'Other'
hex_color: '#D3D3D3'
time: otherTotal
if part is 'subgrouping'
shade = getShader()
for x in groups
x.name.hex_color = shade x.name.hex_color
# Donut chart
angle = 90
for group, i in groups
angleplus = 360 * group.time / @data.total_grand
path = @sector 150, 130, 100, angle, angle + angleplus
@doc.path(path.join(', ')).fill getColor group.name, i + @colorShift
angle += angleplus
@doc.circle(150, 130, 40).fill "#fff"
# Donut labels
@doc.fontSize 10
cy = 255
for group, i in groups
@doc.circle(63, cy, 8).fill getColor group.name, i + @colorShift
title = getTitle group.name
groupName = if title.length > 30
title.substr(0, 25) + '...'
else
title
@doc.fillColor('#000000').text groupName, 83, cy - 6, width: 200
labelWidth = @doc.widthOfString groupName
@doc.fillColor('#6d6d6d').text @displayDuration(group.time), 93 + labelWidth, cy - 6
cy = cy + 20
getTitle = (title) ->
if typeof title is 'object'
if title.time_entry
return title.time_entry
if title.user
return title.user
if title.project
if title.client
return title.project + ' - ' + title.client
else
return title.project
if title.client
return title.client
if 'task' of title # even if `null`!
return title.task or '(no task)'
return '-'
else
return title or '(no title)'
isClient = (title) ->
typeof title is 'object' and title.client isnt undefined and Object.keys(title).length is 1
nextColor = (i) ->
COLORS[i % COLORS.length]
getColor = (title, i) ->
if typeof title is 'object'
if isClient title
return nextColor i
if title.hex_color
return title.hex_color
if title.color
return COLORS[title.color]
if title.user
return nextColor i
return '#999999'
reportTable: ->
@translate 0, 20
@doc.fontSize(7)
@doc.font('FontBold').fill '#6f7071'
@doc.text "#{@capitalize(@grouping 'grouping')} / #{@capitalize(@grouping 'subgrouping')}", 55, 10
if @isFree()
@doc.text 'Duration', 450, 10
else
@doc.text 'Duration', 390, 10
@doc.text 'Amount', 450, 10
@translate 0, 20
@doc.fill('#000000')
for group in @data.data
@doc.font 'FontBold'
@doc.text (getTitle group.title), 55, 10
if @isFree()
@doc.text @displayDuration(group.time), 450, 10
else
@doc.text @displayDuration(group.time), 390, 10
amounts = for cur in group.total_currencies when cur.amount?
cur.amount.toFixed(2) + " " + cur.currency
@doc.text amounts.join(', '), 450, 10
@translate 0, 20
@doc.font 'FontRegular'
for item in group.items
lineHeight = 90
title = getTitle item.title
lineCount = title.length / lineHeight
@doc.text title, 60, 10, width: 330, lineCap: lineCount
if @isFree()
@doc.text @displayDuration(item.time), 450, 10
else
@doc.text @displayDuration(item.time), 390, 10
@doc.text item.sum.toFixed(2) + " " + item.cur, 450, 10 if item.sum? and item.sum > 0
@translate 0, 20
# If the we have multiline description then lets move the lines down
@translate 0, 13 * Math.ceil lineCount if lineCount > 1
if @posY > Report.PAGE_HEIGHT - Report.MARGIN_BOTTOM
@doc.text ++@pageNum
@addPage()
@translate 0, 20
module.exports = SummaryReport
| true | Report = require './report'
moment = require 'moment'
timeFormat = require 'time-format-utils'
RAD = Math.PI / 180
COLORS = [
"#4dc3ff", "#bc85e6", "#df7baa", "#f68d38", "#b27636",
"#8ab734", "#14a88e", "#268bb5", "#6668b4", "#a4506c",
"#67412c", "#3c6526", "#094558", "#bc2d07", "#999999"
]
# keeps own state; returns function that takes HEX color and returns it shaded
getShader = ->
dict = {}
# from: http://stackoverflow.com/a/13542669/390493
shade = (color, percent) ->
f = parseInt(color.slice(1), 16)
t = if percent < 0 then 0 else 255
p = if percent < 0 then percent * -1 else percent
R = f >> 16
G = f >> 8 & 0x00FF
B = f & 0x0000FF
'#' + (0x1000000 + (Math.round((t - R) * p) + R) * 0x10000 + (Math.round((t - G) * p) + G) * 0x100 + Math.round((t - B) * p) + B).toString(16).slice(1)
getCount = (color) ->
x = dict[color] or 0
dict[color] = x + 1
x
return (color) ->
shade color, getCount(color.toLowerCase()) / 5
class SummaryReport extends Report
finalize: ->
@colorShift = Math.floor Math.random() * COLORS.length
@translate 0, 50
@reportHeader('Summary report')
@translate 0, 75
@selectedFilters()
@translate 0, 50
@barChart()
@translate 0, 180
@pieChart()
@translate 280, 0
@subPieChart()
@addPage()
@reportTable()
@translate 0, 10
@createdWith()
fileName: ->
"Toggl_#{@data.params?.grouping}_#{@data.params?.since}_to_#{@data.params?.until}"
sector: (cx, cy, r, startAngle, endAngle) ->
sweepFlag = endAngle - startAngle > 180
x1 = cx - r * Math.cos -startAngle * RAD
y1 = cy + r * Math.sin -startAngle * RAD
x2 = cx - r * Math.cos -endAngle * RAD
y2 = cy + r * Math.sin -endAngle * RAD
["M", cx, cy, "L", x1, y1, "A", r, r, 0, +sweepFlag, 1, x2, y2, "z"]
barChart: ->
@data.activity.rows.sort (a, b) -> a[0] - b[0]
dates = []
values = []
for row in @data.activity.rows
values.push if row[1] then row[1] / 3600.0 else 0.0
dates.push moment(row[0])
maxValue = Math.ceil Math.max.apply(null, values)
heights =
for val in values
if maxValue > 0 and val > 0
Math.ceil val / maxValue * 120
else
0
# Draw barchart grid
LINE_START = 35
LINE_END = 540
@doc.lineWidth(0.5).strokeColor '#e6e6e6'
@doc.moveTo(LINE_START, 5).lineTo(LINE_END, 5).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 35).lineTo(LINE_END, 35).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 65).lineTo(LINE_END, 65).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 95).lineTo(LINE_END, 95).dash(1, space: 1).stroke()
@doc.moveTo(LINE_START, 145).lineTo(LINE_END, 145).dash(1, space: 1).stroke()
yAxisText = (val) ->
if val > 10
"#{Math.round(val)} h"
else
"#{val.toFixed(2)} h"
@doc.fontSize(9).fillColor '#6d6d6d'
if maxValue > 0
@doc.text yAxisText(maxValue), 550, 0.1, width: 0
@doc.text yAxisText(maxValue * 0.75), 550, 30, width: 0
@doc.text yAxisText(maxValue * 0.5), 550, 60, width: 0
@doc.text yAxisText(maxValue * 0.25), 550, 90, width: 0
MAX_DAYS = 31
PADDING_LEFT = 45
MIN_BAR_WIDTH = 12
MAX_BAR_HEIGHT = 125
BAR_GRAPH_WIDTH = LINE_END - LINE_START - 2 * (PADDING_LEFT - LINE_START)
barCount = @data.activity.rows.length
barWidth = MAX_DAYS / barCount * MIN_BAR_WIDTH
if barCount==1
PADDING_LEFT = PADDING_LEFT + (BAR_GRAPH_WIDTH - barWidth)/2
pad = if barCount > 1 then (BAR_GRAPH_WIDTH - barCount * barWidth) / (barCount-1) else 0
barWidthPad = barWidth + pad
@doc.font('FontBold').fontSize 8
# Draw barchart bars
cx = PADDING_LEFT
for height, i in values
if height == 0
@doc.rect(cx, MAX_BAR_HEIGHT, barWidth, -2).fill '#929292'
else
@doc.rect(cx, MAX_BAR_HEIGHT, barWidth, -heights[i]).fill '#2cc1e6'
# Draw labels above bars
if barCount <= 16
time = "#{height.toFixed(2)}"
if @data.duration_format != 'decimal'
time = timeFormat.secondsToSmallHhmm(height*3600)
@doc.text time, cx, MAX_BAR_HEIGHT - heights[i] - 15, width: barWidth, align: 'center'
cx += barWidthPad
# Draw barchart horizontal date labels
cx = PADDING_LEFT
zoom = @data.activity.zoom_level
dateFormat = switch zoom
when 'day' then 'Do MMM'
when 'week' then 'DD.MM'
when 'month' then 'MMM'
@doc.font('FontRegular').fontSize 7
@doc.undash().lineWidth(0.5).strokeColor '#6d6d6d'
modValue = if barCount <= 12 then 1
else if barCount > 12 and barCount <= 22 then 2
else if barCount > 22 then 3
modValue = 2 if zoom == 'week' and barCount > 8
halfBar = barWidth / 2
for height, i in values
if i % modValue == 0
@doc.moveTo(cx + halfBar, MAX_BAR_HEIGHT + 2).lineTo(cx + halfBar, MAX_BAR_HEIGHT + 5).stroke()
@doc.fill('#6d6d6d').text dates[i].format(dateFormat), cx - (barWidthPad / 2) - 2, 125 + 5, width: barWidthPad * 2, align: 'center'
cx += barWidthPad
subPieChart: ->
@pieChart 'subgrouping'
grouping: (groupingType) ->
@data.params?[groupingType] or @data.env[groupingType]
pieChart: (part = 'grouping') ->
title = @capitalize @grouping(part)
@doc.fontSize(14).fill('#000').text title, 50, 1
groups = []
otherTotal = 0
filterOthers = (time, name, threshold) =>
if time / @data.total_grand > threshold
groups.push name: PI:NAME:<NAME>END_PI, time: time
else
otherTotal += time
if part is 'subgrouping'
subgroups = {}
for group, i in @data.data
groupColor = getColor group.title, i + @colorShift
for item, i in group.items
title = (getTitle item.title)
unless subgroups[title]?
subgroups[title] =
name:
time_entry: title
hex_color: unless isClient(group.title) then groupColor else nextColor i
time: item.time
else
subgroups[title].time += item.time
filterOthers(obj.time, obj.name, 0.05) for title, obj of subgroups
else
filterOthers(time, name, 0.06) for {time, title: name} in @data.data
groups.sort (a, b) -> b.time - a.time
if otherTotal > 0
groups.push
name:
time_entry: 'Other'
hex_color: '#D3D3D3'
time: otherTotal
if part is 'subgrouping'
shade = getShader()
for x in groups
x.name.hex_color = shade x.name.hex_color
# Donut chart
angle = 90
for group, i in groups
angleplus = 360 * group.time / @data.total_grand
path = @sector 150, 130, 100, angle, angle + angleplus
@doc.path(path.join(', ')).fill getColor group.name, i + @colorShift
angle += angleplus
@doc.circle(150, 130, 40).fill "#fff"
# Donut labels
@doc.fontSize 10
cy = 255
for group, i in groups
@doc.circle(63, cy, 8).fill getColor group.name, i + @colorShift
title = getTitle group.name
groupName = if title.length > 30
title.substr(0, 25) + '...'
else
title
@doc.fillColor('#000000').text groupName, 83, cy - 6, width: 200
labelWidth = @doc.widthOfString groupName
@doc.fillColor('#6d6d6d').text @displayDuration(group.time), 93 + labelWidth, cy - 6
cy = cy + 20
getTitle = (title) ->
if typeof title is 'object'
if title.time_entry
return title.time_entry
if title.user
return title.user
if title.project
if title.client
return title.project + ' - ' + title.client
else
return title.project
if title.client
return title.client
if 'task' of title # even if `null`!
return title.task or '(no task)'
return '-'
else
return title or '(no title)'
isClient = (title) ->
typeof title is 'object' and title.client isnt undefined and Object.keys(title).length is 1
nextColor = (i) ->
COLORS[i % COLORS.length]
getColor = (title, i) ->
if typeof title is 'object'
if isClient title
return nextColor i
if title.hex_color
return title.hex_color
if title.color
return COLORS[title.color]
if title.user
return nextColor i
return '#999999'
reportTable: ->
@translate 0, 20
@doc.fontSize(7)
@doc.font('FontBold').fill '#6f7071'
@doc.text "#{@capitalize(@grouping 'grouping')} / #{@capitalize(@grouping 'subgrouping')}", 55, 10
if @isFree()
@doc.text 'Duration', 450, 10
else
@doc.text 'Duration', 390, 10
@doc.text 'Amount', 450, 10
@translate 0, 20
@doc.fill('#000000')
for group in @data.data
@doc.font 'FontBold'
@doc.text (getTitle group.title), 55, 10
if @isFree()
@doc.text @displayDuration(group.time), 450, 10
else
@doc.text @displayDuration(group.time), 390, 10
amounts = for cur in group.total_currencies when cur.amount?
cur.amount.toFixed(2) + " " + cur.currency
@doc.text amounts.join(', '), 450, 10
@translate 0, 20
@doc.font 'FontRegular'
for item in group.items
lineHeight = 90
title = getTitle item.title
lineCount = title.length / lineHeight
@doc.text title, 60, 10, width: 330, lineCap: lineCount
if @isFree()
@doc.text @displayDuration(item.time), 450, 10
else
@doc.text @displayDuration(item.time), 390, 10
@doc.text item.sum.toFixed(2) + " " + item.cur, 450, 10 if item.sum? and item.sum > 0
@translate 0, 20
# If the we have multiline description then lets move the lines down
@translate 0, 13 * Math.ceil lineCount if lineCount > 1
if @posY > Report.PAGE_HEIGHT - Report.MARGIN_BOTTOM
@doc.text ++@pageNum
@addPage()
@translate 0, 20
module.exports = SummaryReport
|
[
{
"context": "//www.melis.io/scripts/check.php'\n}\n\nTESTTOKEN = '12345678'\n\nBetaInvite = Mixin.create(\n\n ajax: service()\n\n",
"end": 533,
"score": 0.9207977056503296,
"start": 525,
"tag": "KEY",
"value": "12345678"
}
] | app/mixins/beta-invite.coffee | melis-wallet/melis-cm-client | 1 | import Mixin from '@ember/object/mixin'
import { inject as service } from '@ember/service'
import { get, set } from '@ember/object'
import RSVP from 'rsvp'
import config from '../config/environment'
import {isAjaxError, isNotFoundError, isForbiddenError} from 'ember-ajax/errors'
import Logger from 'melis-cm-svcs/utils/logger'
INVITE_URIS= {
regtest: 'https://www-regtest.melis.io/scripts/check.php'
test: 'https://www-test.melis.io/scripts/check.php'
main: 'https://www.melis.io/scripts/check.php'
}
TESTTOKEN = '12345678'
BetaInvite = Mixin.create(
ajax: service()
_inviteUrl: ( ->
INVITE_URIS[@get('cm.network')]
).property('cm.network')
_doInviteRequest: (token, confirm) ->
method =
if confirm then 'DELETE' else 'GET'
@get('ajax').request(@get('_inviteUrl'),
method: method
data:
token: token
).catch((e) ->
Logger.error "Invite check failed: ", e
if isNotFoundError(e)
throw {ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-failure')}
if isAjaxError(e)
throw {ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-failure')}
else
throw {ex: 'TokenError', msg: @get('i18n').t('aa.error.generic')}
)
validateInvite: (token) ->
if @get('cm.testMode') && token == TESTTOKEN
return RSVP.resolve(true)
@_doInviteRequest(token, false).then((res) ->
if get(res, 'status') == 'ok' then true else false
).catch((e) -> throw(e))
confirmInvite: (token) ->
if @get('cm.testMode') && token == TESTTOKEN
return RSVP.resolve(true)
@_doInviteRequest(token, true)
#
# Ask a token to complete the operation
#
checkInvite: (operation)->
pending = RSVP.defer()
if request = @get('pendingRequest')
pending.reject(ex: 'TfaBusy', msg: @get('i18n').t('aa.error.busy'))
else
@setProperties(
modalType: 'token'
tfaOperation: operation
aComponent: 'wallet/token-input'
pendingRequest: pending
)
@get('modalManager').showModal(@get('modalId')).catch( =>
@rejectPending(ex: 'TfaAborted', msg: @get('i18n').t('aa.error.token-req'))
)
return pending.promise
validToken: (token, devicePass) ->
operation = @get('tfaOperation')
response = null
self = @
if operation
if !get(operation, 'running')
@validateInvite(token).then((res) ->
set(operation, 'running', true)
if res
operation(token: token)
else
self.rejectPending(ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-invalid'))
).then((res) ->
response = res
self.confirmInvite(token)
).then((res) ->
self.dismissAndResolve(response)
).catch((e) ->
self.rejectPending(e)
).finally(->
set(operation, 'running', false)
)
else
@dismissAndResolve(null)
)
export default BetaInvite
| 199099 | import Mixin from '@ember/object/mixin'
import { inject as service } from '@ember/service'
import { get, set } from '@ember/object'
import RSVP from 'rsvp'
import config from '../config/environment'
import {isAjaxError, isNotFoundError, isForbiddenError} from 'ember-ajax/errors'
import Logger from 'melis-cm-svcs/utils/logger'
INVITE_URIS= {
regtest: 'https://www-regtest.melis.io/scripts/check.php'
test: 'https://www-test.melis.io/scripts/check.php'
main: 'https://www.melis.io/scripts/check.php'
}
TESTTOKEN = '<KEY>'
BetaInvite = Mixin.create(
ajax: service()
_inviteUrl: ( ->
INVITE_URIS[@get('cm.network')]
).property('cm.network')
_doInviteRequest: (token, confirm) ->
method =
if confirm then 'DELETE' else 'GET'
@get('ajax').request(@get('_inviteUrl'),
method: method
data:
token: token
).catch((e) ->
Logger.error "Invite check failed: ", e
if isNotFoundError(e)
throw {ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-failure')}
if isAjaxError(e)
throw {ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-failure')}
else
throw {ex: 'TokenError', msg: @get('i18n').t('aa.error.generic')}
)
validateInvite: (token) ->
if @get('cm.testMode') && token == TESTTOKEN
return RSVP.resolve(true)
@_doInviteRequest(token, false).then((res) ->
if get(res, 'status') == 'ok' then true else false
).catch((e) -> throw(e))
confirmInvite: (token) ->
if @get('cm.testMode') && token == TESTTOKEN
return RSVP.resolve(true)
@_doInviteRequest(token, true)
#
# Ask a token to complete the operation
#
checkInvite: (operation)->
pending = RSVP.defer()
if request = @get('pendingRequest')
pending.reject(ex: 'TfaBusy', msg: @get('i18n').t('aa.error.busy'))
else
@setProperties(
modalType: 'token'
tfaOperation: operation
aComponent: 'wallet/token-input'
pendingRequest: pending
)
@get('modalManager').showModal(@get('modalId')).catch( =>
@rejectPending(ex: 'TfaAborted', msg: @get('i18n').t('aa.error.token-req'))
)
return pending.promise
validToken: (token, devicePass) ->
operation = @get('tfaOperation')
response = null
self = @
if operation
if !get(operation, 'running')
@validateInvite(token).then((res) ->
set(operation, 'running', true)
if res
operation(token: token)
else
self.rejectPending(ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-invalid'))
).then((res) ->
response = res
self.confirmInvite(token)
).then((res) ->
self.dismissAndResolve(response)
).catch((e) ->
self.rejectPending(e)
).finally(->
set(operation, 'running', false)
)
else
@dismissAndResolve(null)
)
export default BetaInvite
| true | import Mixin from '@ember/object/mixin'
import { inject as service } from '@ember/service'
import { get, set } from '@ember/object'
import RSVP from 'rsvp'
import config from '../config/environment'
import {isAjaxError, isNotFoundError, isForbiddenError} from 'ember-ajax/errors'
import Logger from 'melis-cm-svcs/utils/logger'
INVITE_URIS= {
regtest: 'https://www-regtest.melis.io/scripts/check.php'
test: 'https://www-test.melis.io/scripts/check.php'
main: 'https://www.melis.io/scripts/check.php'
}
TESTTOKEN = 'PI:KEY:<KEY>END_PI'
BetaInvite = Mixin.create(
ajax: service()
_inviteUrl: ( ->
INVITE_URIS[@get('cm.network')]
).property('cm.network')
_doInviteRequest: (token, confirm) ->
method =
if confirm then 'DELETE' else 'GET'
@get('ajax').request(@get('_inviteUrl'),
method: method
data:
token: token
).catch((e) ->
Logger.error "Invite check failed: ", e
if isNotFoundError(e)
throw {ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-failure')}
if isAjaxError(e)
throw {ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-failure')}
else
throw {ex: 'TokenError', msg: @get('i18n').t('aa.error.generic')}
)
validateInvite: (token) ->
if @get('cm.testMode') && token == TESTTOKEN
return RSVP.resolve(true)
@_doInviteRequest(token, false).then((res) ->
if get(res, 'status') == 'ok' then true else false
).catch((e) -> throw(e))
confirmInvite: (token) ->
if @get('cm.testMode') && token == TESTTOKEN
return RSVP.resolve(true)
@_doInviteRequest(token, true)
#
# Ask a token to complete the operation
#
checkInvite: (operation)->
pending = RSVP.defer()
if request = @get('pendingRequest')
pending.reject(ex: 'TfaBusy', msg: @get('i18n').t('aa.error.busy'))
else
@setProperties(
modalType: 'token'
tfaOperation: operation
aComponent: 'wallet/token-input'
pendingRequest: pending
)
@get('modalManager').showModal(@get('modalId')).catch( =>
@rejectPending(ex: 'TfaAborted', msg: @get('i18n').t('aa.error.token-req'))
)
return pending.promise
validToken: (token, devicePass) ->
operation = @get('tfaOperation')
response = null
self = @
if operation
if !get(operation, 'running')
@validateInvite(token).then((res) ->
set(operation, 'running', true)
if res
operation(token: token)
else
self.rejectPending(ex: 'TokenFailure', msg: @get('i18n').t('aa.error.token-invalid'))
).then((res) ->
response = res
self.confirmInvite(token)
).then((res) ->
self.dismissAndResolve(response)
).catch((e) ->
self.rejectPending(e)
).finally(->
set(operation, 'running', false)
)
else
@dismissAndResolve(null)
)
export default BetaInvite
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.